I'm using the Phase battle system. I'm trying to access via script, which faction's phase is currently active. Is there a way to access this? This is the main thing I need but fully I'd like:
1) What faction's phase is currently active
2) function that ends the phase
3) An event that triggers when the phase changes
Are these items possible through script?
if(ORK.Battle.SelectingCombatant != null &&
ORK.Battle.SelectingCombatant.Faction == ORK.Factions.Get(index))
index being the ID/index of the faction in the editor, you can also check via the faction's GUID string.
2) Like this:
But make sure if ORK.Battle.System isn't null (e.g. outside of battle) and ORK.Battle.System.settings is actually a PhaseBattleSystem (in case you use multiple battle systems).
3) You can register to the turn changed handler (takes a function with no parameters):
ORK.Battle.TurnChanged += YourFunction
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!