Monday, July 27, 2015

Bit of a Block

Reality hit me in the face today as I tried to implement the system described below: I learned you can't create objects in Blueprints. Whaaa?

Only Actors can be created. Several people said to just make Actors for everything, so they're suggesting I make an Actor for every command issued and for each spell.

That sounds terrible. An actor is an object in the scene. A command is not and should not be an actor. What is the position of a command? How do you render a command? No, I refuse to do that.

Even if I wanted, I still couldn't structure it the way I wanted even with Actors. I'm not going to place an instance of a Fireball in every level just so I can attach it to my character.

All is not lost, though. We have the power of code by our side. The Command and Ability system will just need to be primarily driven in code. I can call into a native function that creates objects, and I can even return references to those objects. I just need to manage lifetime myself, but I'm used to that. I was hoping to do it all in Blueprints, but mostly as a self-imposed challenge. I'll gladly use code if it means the game is better structured.

I'm still not clear how you attach an instance of a Blueprint to an Actor. Let's say I have a Blueprint of a Fireball. It is the script for a Fireball, the visuals, etc. I would like some of my characters to have a Fireball as one of its abilities. What mechanism do I use to point to the Blueprint? Perhaps I make the Fireball an Actor Component and add it that way? I'm pretty sure you can add Actor Components at runtime, which will be important to support gaining abilities via level up.

But then again, you can't even instantiate objects so I probably shouldn't assume anything.

No comments:

Post a Comment