Hello! I am trying to get the count of abilities learned by a combatant in the player start turn node in a combat.

I am using select Ability node to store all abilities. Trying to use the Change Variable node to set abilityListCount as the Int List Count of allAbilities, and then output the integer to the Unity Console.

I keep getting an output of 0, when of course the combatant has more than 0 abilities. Is there something I am missing? Thank you for your support!

https://imgur.com/a/JdBZQmQ
  • edited January 2023
    The Int List Count value type stores the number of variables in an int variable list. To get the number of things stored in selected data use the Selected Data Count value type or use the Store Selected Data Quantity node.
    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!
  • Thank you @gamingislove!

    The next issue I am running into is I am trying to check an ability variable from one of these abilities in the list. I am testing this by changing a variable to the selected data list index 0 and another one for 1. But they both return a value of zero, when I have the ability variable set to 1 and 2 respectively. Any insight is appreciated! Still learning a lot :)

    https://imgur.com/a/AxRzZJd
  • You need to use the Selected Data variable origin instead of Selected Data List. The List versions here always refer to variable lists, but you want to access a single variable (which is the most common use).
    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 I think this is where I am confused. When I select All Abilities of a combatant, does it not create a variable list of the abilities? Ultimately, I am trying to use a loop node to check each ability in selected data (all abilities of the combatant) and use the loop int as the index it is checking.

    It doesn't seem like I can specify which Ability out of the multiple I have selected to check with the Selected Data origin. Am I missing something?
  • @Krozo
    The list that is created is the abilities themselves.

    You want to use "Select Selected Data" to select one Ability from the list of abilities in your selected data. It's best to use "First" and remove the ability as you iterate through the selected data. If you don't want to lose the Select Data list, you can copy the list with Select Selected Data "All" and just use that copy to iterate through.
    That's how I use it.
  • @Dre788 That makes so much sense! Thank you :) I’ll give this a shot
  • Selected data and variables are not the same thing.
    Abilities stored in selected data are just selected data - their variables can be accessed via the Selected Data variable origin :)
    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.