I know the question title is vague, but a specific response to this problem is perfectly helpful for me:
Let's say there are 30 spells that a character can have, but a player can only have 6 spells "equipped" at once.
Right now it is very simple and I have an FSM that deals with the key presses and then goes on to cast that specific spell that follows from the key press (i.e. press 1 = flare, 2 = firebolt, 3 = fireball, etc.)
Lets say I have, in my project folder, 30 prefabs for different spells, and each time the key button is pressed, it creates (or pools, whatever) an instance of that prefab. How do I get a key press in an FSM correspond to whatever particular spell that is selected at the time (i.e. it can be changed at will).
I'd prefer something like 30 FSM's that can each individually handle the spells, with one FSM that deals with the 6 key presses and sends for whichever FSM is needed. I suppose I could do everything on one FSM if I had too (the problem being some spells need a lot more information when they are cast than others). So lets say I do have 30 individual FSM's. What is the proper way to have a send-event that can change in order to bring me to the correct one? I could figure it out with a giant if/then sort of thing but that's a mess.