Hi -

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?

  • 1) There's no direct function or thing to call, but you can check the currently selecting combatant's faction:
    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
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you very much!
Sign In or Register to comment.