Inside a battle animation triggered from an ability, I use a Call Function block. Then inside this function, I'm trying to know the ability ID the combatant is currently using. I tried Combatant.Abilities.LastAbilityID, but it gives me the ID of the last completed ability instead of the one that's currently in use.

Any clue?
  • Generally, the used ability (or item) is available in battle events via selected data using the action key, but I don't think you can access that to e.g. pass on the ID in a Call Function node.

    I'd say the best way is to either write a custom node for this - what's the end goal, or what do you want to do with the ability ID in your function?
    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!
  • Well, I needed other parts of my code to have this information. I could rewrite this code into an event graph but sometimes I find it more convenient to use written code, especially if it's already there...

    Anyway, since the ability's battle event is always used by the same ability (it's not generic), I can create a local ORK string game variable with the hardcoded name of the ability and then, send it to my c# script via a Call Function block parameter. Then, since my c# script can receive function calls by different abilities, I will use a switch(abilityName) to redirect the behaviour properly. Maybe not super elegant, but it will work.

Sign In or Register to comment.