• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

ZenthWolf

First Lieutenant
41 Badges
Apr 24, 2016
251
261
  • Hearts of Iron III
  • Crusader Kings II: Reapers Due
  • March of the Eagles
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Europa Universalis III
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Crusader Kings III
  • Stellaris: Federations
  • Prison Architect
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Holy Fury
  • Stellaris: Distant Stars
  • Tyranny - Bastards Wound
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Tyranny: Archon Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Pre-order
  • Cities: Skylines
  • Victoria 2
  • Teleglitch: Die More Edition
  • Europa Universalis IV
I've been trying to understand what I can about scripting, but some of it is escaping me. For instance, in trying to understand the part of the liberate wargoal:

Code:
      parameter:planet = {     
         create_country = {
           name = random
           government = random
           released_by_country = root
           released_from_country = parameter:planet.owner
           species = parameter:planet
           ethos = fromfromfrom
           flag = random
           type = default
           day_zero_contact = no
         }
       }

Most of it is pretty straightforward, but I cannot grasp what "parameter:planet" is doing, or "fromfromfrom", which I only can deal with, because of the top of the file spells out that this is a country- specifically the "target" country, so I think the newly created one? Then shouldn't it be ethos = root (which seemed to work in a brief test I did)?

When I try to search on questions like this, I get lots of information about what effects, modifiers, scopes, and triggers there are, but not anything to understand their usage/implementation. Sorry for being super dumb, but is there a good resource to read on this?
 
Yeah the script can be really funky. From what I understood, from, fromfrom , ... are the catch-all variables where you need documentation to understand. (If there is another way please enlight me.) Prev, prevprev, ... seems to refer to the previous scope. (again, I'm also a noob here so..)

So now to understand this part of the script. Go to the start of the document and you'll see :

Code:
# effect, effect, root and from are main attacker and defender, war is fromfrom, fromfromfrom is the target country, effect which executes when the demand is accepted

So to be clear :
In the effect part
root = main attacker (who declared the war)
from = main defender
fromfrom = the war
fromfromfrom = target country (so who will have to liberate the planet/country, it does not need to be the same as the main defender)

Now for the parameter: planet is for the script to know what you are talking about. What kind of object and which one. You can see the list of parameters at the start of liberate_planet plus this comment at the start of the file
Code:
# parameters, data containing the specifics, eg which planet we're talking about

As for why is it fromfromfrom and not root. I have no idea. Or.. maybe ... wait.

Ok. Apparently fromfromfrom is not the guy who get attacked but who will get the goodies once the war is over. That makes sense I guess. So by putting

Code:
ethos = root

you force the new country to be the ethos from the declarer of the war.

Code:
ethos = fromfromfrom

make it that they get the ethos from the one who should get the credit. Why the

Code:
released_by_country = root

is not fromfromfrom is the new guess.
 
That is correct, fromfromfrom is the country who benefits from the wargoal.

I guess they still put in "released_by_country = root" because root is country which set the wargoal. In a sense root "had the idea" to liberate them and so gets the opinion bonus.
 
From what I understood, from, fromfrom , ... are the catch-all variables where you need documentation to understand.

Yeah, I understood these in this context, but it's actually good to hear that it I pretty much need the documentation per file. My worry was that these were somehow changing with the scope I was in.

Code:
ethos = fromfromfrom
make it that they get the ethos from the one who should get the credit.

This makes better sense. My one test was as a solo attacker, so I didn't see a difference.

Now for the parameter: planet is for the script to know what you are talking about. What kind of object and which one. You can see the list of parameters at the start of liberate_planet plus this comment at the start of the file

So, the code snippet above is saying something like, "On the targetted planet, we create a new government, with these details", great. Then we get to here:

Code:
species = parameter:planet

As far as I understand, a planet is not inherently associated with a species, so I would expect this to be targeting a pop on the planet somehow. As for testing, if Empire A (founded by Species A) conquers a planet with Species B, which is later liberated, the new state gets Species B.
However, if species A migrate to the planet first, and all of species B are purged before the liberation, then the new government is founded by species A.

The point is, there is fluidity in the "species" of a planet via the pops, so why target the planet?

On this note, I've tried several things, including:

Code:
ethos = parameter:planet

to affect the ethos of the new nation, hoping for the same logic (if saying look at the planet can return the species of a pop, maybe it can also return the ethos of a pop). All attempts so far have lead to Despicable Neutrals, rather than the intended effect.