[Question] Spell System

Hey, I’m wondering if i should simply use a SpawnActor (Spawn Actor from Class) node to spawn the correct spell blueprint when the Selected Magic Hotkey input is pressed and then handle the effects of the spell in that blueprints Event Begin Play, or if i should use something different like an Event Dispatcher.

I personaly would use the class spawner, this is what I use to spawn physical bullet from my weapon blueprint and it work perfectly.

So yeah, like you said, just attach the particle to your blueprint at spawn, or event put it in the blueprint component so you won’t have to attach it in the event graph.

Hello,
If your spell can be consider as a projectile (even a static one), you sure will have easy way in spawning it like a projectile.

I was talking with Keytotruth about this on skype, and from the sounds of it what i want to do is handle all the basic spell functionality in the Event Begin Play of the spell blueprint, and then any additional inputs (like detonating a mine) should be handled with Event Dispatchers.

if you want to control the spell from the player, you can either use event dispatcher or just a call. knowing wich spell you are using and calling to that spell in the player’s blueprint, This is up to you.

OR you can set the “auto receive input” to true in the blueprint so when iot is spawned, it automatically receive input from keyboard and mouse. so that mean, no call, and no event dispatcher.

I keep track of the selected skill, which contains the info about which blueprint class to spawn.
It seems like simply doing this: http://puu.sh/do6Uy/3d6e042883.png

and then handling all of the spells functionality in Event Begin Play should work. I’d use an event dispatcher to bind events like pressing E to detonate a mine while the actor is alive.

EDIT: I believe auto receive input will disable all of the actual player control. This does not work for leaving a mine/trap on the ground for a period of time and being mobile while allowing an input to detonate.

oh I don’t know if it will disable player input, but yeah the event dispatcher is you’r best chance I guess. and the image you linked is exactly it.

And this is the blueprint I use in my player controller to change the selected weapon using mouse wheel.

As you can see I only have 2 weapon right now, so weapon index and the actor variable “weapon”

there might be an easier way to do that but this is how I do it…

edit: I just tried the auto input on my weapon blueprint and it is not preventing the player from receiving input, everything work as supposed.

http://puu.sh/dobQ1/0b060c4e36.png

Thanks for the help guys

so you got it working! was my blueprint screenshot any usefull?

Its not so much that i didn’t know how to do it, it’s more that i was wondering if the way i was doing it was the correct way, which it was. I found an easy way to test it.
Letting me know that enabling input on them doesnt disable any character input is helpful, makes my life easier.