I want to inform the player about an upcoming combatant he is about to face. For me 1 combatant = 1 battle. After defeating a monster/combatant, he is shown a choice dialogue where he can decide if he wants to continue. I would like to inform him what awaits him next. The next battle is spawned by my custom code which is just enabling battle object which I already have in the scene.

Could I possibly get the information about the next combatant from the Battle object in my code? If so, how can I use that object in the Event, in the Show Choice dialogue to provide the user with the info?
  • edited March 2021
    Hm, the easiest way would probably be if you have your custom code store the combatant's name (or whatever info you want) into a global variable and use that in the dialogue via text codes.

    E.g. this would store the name of the combatant (first one defined on the Battle component) into the variable nextCombatant:
    ORK.Game.Variables.Set("nextCombatant", ORK.Combatants.GetName(battleComponent.combatant[0].id));
    battleComponent is the instance of the BattleComponent where the combatant is defined.
    Post edited by gamingislove on
    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!
  • Let's say I have the combatant name I want stored in the Global Variable. Is there any way to access this combatant from the event? E.g. Find combatant by name or similar? I know I could access the combatant name using a custom function, but I wish to use some more ORK functionalities in the event and the best way would be to get the combatant instance that ORK is familiar with in the event itself.
  • Well, no - the combatant doesn't exist at that point, as it's only created/instanced when the battle starts. So, all you have is the ID from the battle's setup, which you can use to access the settings of the combatant and get information from that.
    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!
Sign In or Register to comment.