edited November 2024 in ORK Support
Hello, I am researching whether it is possible, through this tool, to implement a mechanic where I can select 5 abilities of the same character, and then have these abilities execute one after another. That is, when one finishes, the next one starts, until all 5 are completed.

If possible, how could this implementation be approached? I am trying to do it in a customized way using ORK 3 in Unity, but I haven't yet found the flexibility that allows me to do so.

I am trying to build abilities as an AbilityAction to store them in an array and then trigger them one after another with a delay between each, using CastAction. However, I'm not sure if this is the best way or if I can use the existing system to do it without having to create my own script:


List<Combatant> combatants = ORK.Game.Combatants.GetInBattle();

List<AbilityShortcut> list = combatants[3].Abilities.GetAll();

AbilityAction baseAction = new AbilityAction(combatants[3], list[0]);
baseAction.SetTargets(combatants);

combatants[3].Actions.CastAction(baseAction);
Post edited by vlakdo on
  • There are already systems available for this, i.e. the action queue or adding next actions to use.
    Also, you start an action like this:
    combatant.Actions.AddAccess(action, true);
    action being the action instance, pass on true or false depending on if a new turn should be initialized.

    The action queue is e.g. used by the active time battle system if you allow selecting multiple actions to be used one after another. You can enqueue actions like this:
    combatant.Actions.EnqueueAction(action);
    Actions in the queue will be used once the previous action finished - e.g. fire the first action and enqueue the rest afterwards.

    Next actions are automatically used when the system promps a combatant to select an action, you can add next actions like this:
    combatant.Actions.AddNextAction(action, NextBattleActionChange.Add);
    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!
  • @gamingislove thank you. One question: is 'action' equivalent to the 'AbilityAction' object that I used in my example code?

    And this makes the character execute all their queued attacks and abilities before another character continues, right? (That's what I want to achieve)
  • Yes, any kind of action (i.e. deriving from BaseAction) can be used, e.g. ItemAction for using an item, etc.

    Yes, the action queue is used one after another at the end of an action.

    Contrary, the next action feature uses the next action whenever the system asks a combatant to select actions, e.g. when a combatant's turn starts in turn based battles. So, this'll automatically use the next action instead of opening the battle menu or using battle AI to select the actions.
    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!
  • @gamingislove understood, thank you very much for the help!
Sign In or Register to comment.