Thanks for your answers.
I somehow managed to do something with my spell. I created a class derived from actor, which I spawn whenever the user use the corresponding input. But, this is not generic at all and I think this is not the most efficient way to do so.
If I understand correctly what you said and how the blueprint works, a possibility would be a class Spell derived from Actor which implement all the effects needed and then the character use these blueprints to spawn the spells.
There is how I see it in a rough way.
Please, obviously don’t mind the formating, this is just to illustrate
Spell : public Actor
{
/* Functions */
CheckCondition
Damage
Heal
Boost
SpawnChicken
...
/* Parameter */
manaCost
power
incantationTime
chicken
...
}
In order to “create” a spell I just have to create a Bluprint based on this class and assemble the differents effects (function) and set the parameters of the spell via the blueprint editor.
Then, to launch a spell :
1- The character spawn the blueprint spell and set the different parameters (the target, the caster mana, etc…)
2- The spell then start, check if the caster has enough mana (and all the other conditions) If the condition are not met, the spell is aborted. Else it call the different effect on the target and then die.
Or something like that. Spawning a spell then check the condition is kind of odd. I would rather check the condition, then spawn the spell. But if the conditions are in the spell, how to get those conditions without spawning the spell first?** Is it possible to have a access to the blueprint value without spawning an instance? **(like a static)
My other question now is :** how to reference the spells in my character?** To spawn a spell I think it is possible to spawn a blueprint with just knowing the name of the blueprint, so I could have an array of string and manipulate those string to equip/unequip/learn new spells. Is it a good way?
Thanks again for your help