For game start, better is to use the history folder. you can fire an event from a country's history or use the "global" history. Otherwise, for triggers likeWhat is the current hack we should use in order to fire an event at (or pretty much at) game start? It seems that simply setting a trigger like
won't work. I learned there is something called "on_actions" but I don't like the idea of having a condition be checked every time a research is started, because it's an arbitrary condition, or every time a character is created, and then check if it's a ruler, and then if it's the right dynasty, in order to show an event with info on the ruler. It seems pretty uneconomical to me. I don't know what happened to the good old days when we could just set a date for an event to fire and it would just work as you would expect intuitively.C++:trigger = { game_date = 1836.1.5 }
EDIT:
Answered on my own:
you can put a weekly pulse check in a journal entry:
I saw this approach in the Voice of the People DLC file: \game\common\journal_entries\02_french_monarchism.txtC++:some_journal_entry { ... on_weekly_pulse = { events = { my_mod_event_name.1 } effect = { // leave empty if you just want to fire the event and let the event handle effects } } ... }
I don't know if it's better optimization to use a variable to check if the event should be fired in this events {} block or in the event's trigger {} block. I have copied the approach from VoP:
C++:... trigger = { is_player = yes ruler = { has_ideology = ideology:ideology_orleanist } NOT = { has_variable = fra_start } // using my own variable to avoid calling this event ever again after the first time } ... immediate = { set_variable = fra_start } ...
game_date
, typically you'll use comparative operators, <
or >
, rather than =
.Overall though, in Victoria 3, there are no mean time to happen events, all events must be triggered by an on_action or another effect.
As for optimization, unless the event is being call constantly, I think it's about the same to use a conditional check on whether to trigger it or just put it in the event trigger.
- 1
- 1