• 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.
Showing developer posts only. Show all posts in this thread.
So this means you could expand a vanilla culture group from a separate file? E.G., adding Norse-Gael to the North Germanic group without actually editing the vanilla culture file.

Yes. Or from your own file just owerwriting a single variable like high_god_name or color.
 
Update:

- Possible to execute files with effects from console

1. Create a text file under the game folder or under the Crusader Kings II folder under documents.
2. Write any effect(s) in it
3. Open the console and write: run filename.txt

The effects will be executed with the scope of the current character.

Example:

Code:
treasury = 1000
set_character_flag = test_flag
change_martial = 20
1 = {
   set_province_flag = province_test_flag
}
k_france = {
   set_title_flag = title_test_flag
}
 
Last edited:
  • 4
Reactions:
One question, would it be possible to export the Job Titles and Job Actions file to folder structures? I ask here as you seem to be on a major push towards mod compatibility and these would be some of the last remaining files to make modular.

Already done, there is an update about it a few pages back.
 
  • 1
Reactions:
And is there any chance we may see some more untangling done on papal succession method to enable it for feudal states? (Could be interesting for an Holy Roman Empire council of electors sort of thing)

No, I have no plans on revisiting Papal succession (and probably not any other succession either) due to the complexity of it.
 
  • 1
Reactions:
Update:

- Fixed initializing errors in scripted triggers/effects
- Bookmarks are now sorted in chronological order
- Fixed missing space in localization of special titles
- Morale effect now works in unit & character scope
- Troops effect now works in unit & character scope
- Now possible to switch to owner scope from unit scope
- Now possible to switch to leader scope from unit scope
- Now possible to switch to location scope from unit Scope
- Added missing localization for leader event target
 
  • 6
Reactions:
Gars, what is this unit scope you mention? Is it it possible to scope to commander less army and set its morale?

You can scope from a character to unit (any_unit/random_unit), and yes you can now set morale and reinforce troops.
 
  • 1
Reactions:
I have seen this modifications are not present in patch 2.43 Beta 3, they will be present in the definitive version?
Most likely not for the patch, but for the next patch/DLC.
 
What do you mean? Can I scope to any_unit = { limit = { enemy} troops = -1 morale = -1} from a character event? Or must I target through an enemy commander?

Pseudo-code example btw

This would trigger if any enemy unit meets a unit lead by your character for a battle in your capital.

Code:
character_event = {
   id = 123

   is_triggered_only = yes
  
   trigger = {
     any_current_enemy = {
       any_army = {
         location = {
           ROOT = {
             is_capital = PREV
           }
         }
       }
     }
     any_army = {
       location = {
         ROOT = {
           is_capital = PREV
         }
       }
       OR = {
         owner = {
           character = ROOT
         }
         leader = {
           character = ROOT
         }
       }
     }
   }

   option = {
     random_current_enemy = {
       limit = {
         any_army = {
           location = {
             ROOT = {
               is_capital = PREV
             }
           }
         }
       }
       morale = -0.25
       troops = -0.25
       leader = {
         death = yes
       }
     }
     random_army = {
       limit = {
         location = {
           ROOT = {
             is_capital = PREV
           }
         }
         OR = {
           owner = {
             character = ROOT
           }
           leader = {
             character = ROOT
           }
         }
       }
       morale = 0.25
       troops = 0.25
       leader = {
         piety = 10
       }
     }
   }
}
 
  • 1
Reactions:
Update:

- Possible to construct buildings in forts
 
  • 2
  • 1
Reactions:
BOOYAH! Can we get access to the potentials to build trade post holdings too?

Most likely no. It's complicated code not fitted to move to scripts. Plus there's probably a lot of code in the game the checks for "illegal" trade posts that would interfere anyway.
 
Update:

- opinion_mother_child has been split into opinion_mother_child and opinion_mother_of_child
- opinion_father_of_child has been split into opinion_father_child and opinion_father_of_child
- opinion_uncle now works correctly
 
  • 3
  • 1
Reactions:
Update:

- any_playable_ruler now includes major revolters
- Added support for dynamic script flags

That last feature has been in EU4 for a while and here's how it works:

You append a script flag using @ and then a scope, like set_character_flag = some_flag_@ROOT. If the character has id 140 the saved flag will be some_flag_140. You can also use this in a trigger, like has_character_flag = is_friend_of_@FROM.

It works with character and province id as well as title tags (i.e. k_england).
 
Last edited:
  • 2
Reactions:
Very nice addition. Which are all the admisible scopes after @? I.e. do also THIS, PREV, FROMFROM, etc work with it?

Yes, all the same scopes that can be used elsewhere in triggers/effects.
 
And just to be sure, this allows us to set and check flags without needing to separately scope to the character or province or whatnot first, right?

It has nothing to do with how flags are checked or set. It only affects how you can compose the actual flag name, i.e. appending a dynamic part instead of just having "hard-scripted" names.
 
  • 1
Reactions:
Wait now I see,

Gars, will we be getting more ways to restore the flags? like has_character_flag = flag1@root for instance?

That's exactly like in my example. Or do I misunderstand you?
 
Ah, I had thought it could be used to set a flag dynamically on one character and then reference that character via the flag on another character through an event.

If this is what you mean:

The easiest way to accomplish that is with a zero-value opinion modifier. In a later event, you then have to search the possible characters for whoever has that modifier towards the character in question.

Then yes, you can do that (which is much nicer since you don't have to create additional opinion modifiers). Example:

Code:
# In start event
random_character = {
   set_character_flag = did_something_to_@ROOT
}

Code:
# In later event
random_character = {
   limit = {
     has_character_flag = did_something_to_@ROOT
   }
   ...
}
 
  • 1
Reactions:
Yes this is what I am talking about. If I now just had a scope that would let me scope to any character in the world, I would be able to replace the modifier mechanism I use in my targeting system. However, being able to inflict events on characters in a general vicinity deliberately will be enough for now I guess.


@Captain Gars Follow up question, when using this kinda events, the root would need to be the character who was the starter of the first event correct? I would not be able to use the flags to start an event randomly on the affected character some times later?

I do use it, but I need some way to store multiple targets, before calling them back into the event scoping to apply the effect. I have already written a working system, I just was hoping these flags would have options to let me do independent follow on event chains randomly firing from on_pulse events.

I'm not sure I understand what it is you want to do. Post example code here with some pseudo-code filling in for what you think can't be done. That way it's easier to figure out if it's doable, or if it can be implemented.