Here is the issue. I’m not sure if anyone else have run into his issue, but I use some Blueprints as more elaborate data store. Where the only things that blueprint do is operate at some input data and providing results of that manipulation.
To put it into perspective I have RPGEffectBase class.
At the very upper level it doesn’t provide anything beyond selecting type (Periodic, Instant, Infinite) and some functionality needed to initialize it and apply to actor.
Then I created RPGEffect_Cost. This is blueprint class, created in editor. What it does it apply cost for using ability to character.
I have created fields for it like Health, Energy, Stamina etc.
Now the issue is that I can set those variables only in two ways:
- In Blueprint asset in Default Properties or in graph.
- In other blueprint asset as long as I construct object out of this class.
Neither of those solutions is plausible. The first one requires to to create X amount of Blueprint assets, and each only differs with numbers provided withing default properties.
Second solution adds complexity for blueprint creation, as you need to spawn object first, then set variables for it.
What would be nice solution is if we could:
- Create class variable in blueprint like in my case it would class’RPGEffectBase’.
- The assign to that variable your Blueprint.
- After blueprint is assigned, you can set it’s public properties trough class or in properties panel.
- Then you can ConstructObject out of this blueprint in C++ using provided values for variables.
Here is image of what I mean:
This would allow to more simply assign values for classes before construction and simplify more complex blueprint creation. As we don’t need to create that many blueprints or spawning blueprint in graph, just to set variables before sending it to code.