edited May 2023 in ORK Scripting
Hey, what's the best way to get the name of the ability currently being used in a battle animation?

Basically I have a custom script that displays different text depending on what ability is used, but instead of having to create a different hardcoded event for each ability I just want to have a generic "Use Ability" event that does something like

Get Ability Name -> Call Function [Parameter: string, "Ability Name"] -> Show Dialogue

I already have a way to call the component/function that gets the text and sets it as a game variable that I print out in the Show Dialogue node. Now I just want a way to pass in an identifier based on what ability is being used
Post edited by Xavi on
  • If it's done in the battle event animating the action, the ability (or item) is available as local selected data via the data key action.
    With that, you can use the Store Selected Data Content node to get content information (e.g. the name) from the ability (via action local selected data) and store it into a variable.

    The Call Function node can use that variable as a parameter to call your custom function. Or directly use those variables in your dialogue, etc.
    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!
  • System works like a charm now! Always found selected data a little confusing but that explanation cleared it up thanks! :)
  • If you've got some programming experience, you can think of variables as value types and selected data as reference types :)
    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.