How to create multiple instances of a blueprint in content browser?

I feel like I’m missing something.

I want to define a number of “spells.”
Each “spell” has some common values: name, mana cost, cooldown time, etc.
Each spell also has a class for the actor it creates when it is “cast” by a character.
These spells are not, by themselves, actors. However, spells have some behavior, such as “what are necessary configuration properties” (target area, target actor, etc) as well as the “actually cast spell” function that instantiates the configured actor.

I also want to create multiple “player classes”. (This is different from the general blueprint class system.)
My player controller would assign one of these player classes.
Each player class has a list of spells it can use.

I would like to define the spells as individual “things” in the content browser, that I can then assign to an array of “things” in the “player class” object.
(The blueprint class of the spells, is simply my “SpellBase” blueprint)

However, I can’t figure out how to create instances of blueprint objects and put them in the content browser; I can only instantiate them as actors in the world, or as components on another actor.

What am I missing?

It sounds like you want your spells to just be grouped by common functionality. For that you can use a blueprint structure. It’s similar to an enum in a way, but allows multiple types of data to be used. As for player classes I would create a class called Player_Base, which holds an array of that spell structure I mentioned. Then either by creating derived classes from Player_Base, or by assigning it through the GameMode or some other entry point, I’d push spells into the array which that player instance can use.

The problem with blueprint structures is that they don’t have functions, and can’t spawn actors when activated.
There are tons of “editable data types” in the editor – anything from “tire parameters” to “landscape material” to “sound attenuation.”
I’d like to make something like that, in blueprint, that allows me to edit blueprint instances (or blueprint instantiation defaults.)
That seems like it should be super simple to support using the existing UI, and it would be very powerful.
As in take an existing blueprint class, and create a bunch of “prefabs” that are differently configured templates using that blueprint.

What you need to do is create a blue print with the absolute basic functionality that all spells will share. Including events, variables, and functions. Then go to your content browser and right click on that blueprint and create a child blueprint of that base spell class.

I think the main problem is that he can’t make variables editable by clicking on the blueprint and viewing it in the details panel. That only works if you actually place the blueprint in the world.

MaxL got it!

If I could edit the public variables of a base class in a blueprint class defaults. I could create a “no-op” subclass for each thing I want, and that would work. But I can’t.

I was surprised that wasn’t allowed actually - duplicating the same blueprint, but changing the default values. For now I can only think of a dirty solution: make a master spell blueprint and create as many instances as you need of it in the World, then adjust their publicly editable values as you like, but make sure you keep the instances out of where the player would be. Now using the level/gamemode/etc blueprint teleport the spell to where you need to be at the right time, do the effects, etc then put it instance back somewhere the player will never reach it and turn off visibility/collisions/etc.

Not very pretty, but would work the way you want it to.

Yes. Now if I could adjust the defaults for a blueprint in the “Details” window in the main editor, rather than having to open the blueprint and find the Class Defaults tab, that’d be even better :slight_smile:

Yeah this is a bit of a tricky 1. Annoyingly MaxL’s solution is the best 1 for it. You can create all of those instances in the level somewhere and then add them into an array in another blueprint and just access the array to figure out what to spawn. I would create a dataset to store all the information about the different spells and generate them based on that but you can’t modify them at runtime.