Picking one element from array?

Hello all,

I have a game im making and have spells i want to cast, at certain levels more powers become available (Level 1=Fireball & Level 5=Hells Gate). Now I can do every thing calling individual boolean’s and setting them but is alot of extra unnecessary work. What I want to do is make a array of boolean’s or a structure containing each of my powers like this (Which one is best to use, An Array or Structure?)

Then with the array/structure I want to scroll threw each power making one true and rest false if the right level is had in blueprint so I can determine what power is active.

For example your level 8 and have 3 powers available, when you press the 1 key have it switch to the next power available to you. So if fireball is active you press 1 key now fireball is no longer active but hell’s gate is active.

How do I achieve this and which is best used a structure or array? Any help is appreciated, Thank You!


PS: I have read documentation and do not understand as it only covers basics.

hey onimike, i’ve had a quick read through your post and tried to find you a solution, if this is not what you meant then simply ignore it :slight_smile:

here’s one way i would do it using Enumerations, it’s very quick and allows you a great amount of freedom and most importantly at least for myself it stays away from using too many booleans and turning them on and off all the time.
then inside of the functions like cast fireball and cast hellgate you can do your fancy stuff of actually casting the spells. Now to advance to the next spell all you would have to do is increase the variable called “Skill to Cast” by one and it would call the next function in line. I’ve left out the part of increasing the variable by one, because it wasn’t clear how you would want to do that from your post. If you need any more help or if I’ve misunderstood your post please say and i’can give it another shot :slight_smile:

For my spell system, which i gonna reveal in next 24h on marketplace forum (shameless plugin:D) i use actor based spells, which always exist if can be used/was learned and activate them by direct communication, which allow a lot more complex system then projectile, one time effect.

Wow thank you so much looks like that is exactly what i needed.

Thanks again this is awesome!