Neither wait nor campaign_wait will pause script execution. They merely stop execution on the 'local thread', if you will. I'm not exactly sure how many threads the game can execute in parallel, but it's a lot. Consider this example:
Code:
monitor_event PreFactionTurnStart
campaign_wait 0.1
set_event_counter test_counter 1
end_monitor
monitor_event FactionTurnStart
if I_EventCounter test_counter == 1
historic_event test_event
end_if
end_monitor
The test_event will not fire because the FactionTurnStart event is triggered less than 0.1 seconds after the PreFactionTurnStart event (from my tests, it's actually less than 0.001 seconds in isolated conditions). The campaign_wait pauses execution of the thread in the PreFactionTurnStart monitor, but it doesn't pause anything else in the script. Replacing campaign_wait with wait does not change the results. In fact, I can't see any difference between wait and campaign_wait and the Docudemons says they're the same. Removing the wait/campaign_wait in the script above makes the test_event fire.
So, the main concern with using wait/campaign_wait is "de-synchronizing" effects in different monitors. Fortunately, we can address this using the 'while' loop. In the example script above, we could say:
Code:
monitor_event PreFactionTurnStart
set_event_counter setting_up 1
campaign_wait 0.1
set_event_counter test_counter 1
set_event_counter setting_up 0 ;release processes that need to wait for setup to finish
end_monitor
monitor_event FactionTurnStart
while I_EventCounter setting_up == 1 ;wait for the effects of the PreFactionTurnStart monitor to finish
end_while
if I_EventCounter test_counter == 1
historic_event test_event
end_if
end_monitor
'while' appears to the have the same effect in script as wait and campaign_wait, which limits the appropriate uses of wait and campaign_wait to only a handful of very specific scenarios (such as waiting for a non-identifiable character to finish their death animation).
Originally Posted by
Gigantus
Afaik 'campaign_wait' delays any pending actions on the map
What are these "pending actions"? If you test fire campaign_wait or wait 10 (10 seconds), there is no noticeable effect on the strat map. It doesn't prevent characters from completing their actions, pause audio events, disable the UI, or anything else that I can tell.
P.S. It's quite possible that wait and campaign_wait have different effects on the battle map, I only have experience on the strat map.