[Resolved][Working as intended]Bug Report: Are "Trigger (Script)" Priorities working?

  • 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.

Badok

First Lieutenant
47 Badges
Oct 1, 2018
232
100
  • Magicka 2: Ice, Death and Fury
  • Age of Wonders: Shadow Magic
  • Stellaris
  • Tyranny: Archon Edition
  • Surviving Mars
  • Age of Wonders III
  • Surviving Mars: First Colony Edition
  • Age of Wonders: Planetfall Sign Up
  • Age of Wonders: Planetfall Season pass
  • Age of Wonders: Planetfall
  • Europa Universalis IV
  • Prison Architect
  • Cities: Skylines
  • Pillars of Eternity
  • Crusader Kings II
  • Magicka 2
I'm trying to connect two mods together. I'm using global variables to achieve a sort of dependency injection - if the optional mod is enabled, it should save it's introduction event to the global storage, and the main mod will execute it at the proper time.

I use "Trigger (Script)" resources hooked up to "Start of round" event to set up the necessary variables. However I cannot influence the order in which the events trigger. It's always "Optional" mod first, and "Main" mod second, no matter how the Priority field is set up. Here's how I test it:

Main mod's "First turn" script defines variable TEST and tries to access variable TEST2.
1684152911223.png


The optional mod defines TEST2 and tries to access TEST:
1684152970427.png


With main mod's priority set to `0` I would expect that TEST would be set to 500 and no gold would be granted, because TEST2 is not set. Then optional mod would set TEST2 to 2500 and grant 500 imperium. However, the opposite is the case - no matter the Priority values, the optional mod's trigger is always evaluated first.

Is this a bug? Am I doing something wrong? Perhaps the priority is only ensured within one .rpk?
 
  • 1
Reactions:
Priority only makes sense if your scripts trigger from the same event. Your main mod runs every turn. Your optional mod every round.

So the events are:

Start Round (optional mod)
Start Turn Player 1 (main mod)
End Turn Player 1
Start Turn Player 2 (main mod)
End Turn Player 2
...
End Round
 
Last edited:
  • 1Like
Reactions:
Hoooly crap you're right, I didn't notice that one event uses `round` and the other `turn`. Mea maxima culpa. Thank you, I'll check if that resolves it (it definitely should)

Edit: Verified and yes, on the same event the priority works as intended. My bad.
 
Last edited: