Announcement

Collapse
No announcement yet.

Editing class field variables in properties, without need to spawn object from class

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Editing class field variables in properties, without need to spawn object from class

    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:
    1. In Blueprint asset in Default Properties or in graph.
    2. 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:
    1. Create class variable in blueprint like in my case it would class'RPGEffectBase'.
    2. The assign to that variable your Blueprint.
    3. After blueprint is assigned, you can set it's public properties trough class or in properties panel.
    4. Then you can ConstructObject out of this blueprint in C++ using provided values for variables.

    Here is image of what I mean:

    https://dl.dropboxusercontent.com/u/...properties.png[/shot]


    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.
    5
    Yes.
    100.00%
    5
    No.
    0.00%
    0
    I don't care.
    0.00%
    0
    Last edited by iniside; 05-07-2014, 12:31 PM.
    https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

    #2
    We had a quick chat about this on IRC, I think creating lots of BPs shouldn't be too bad. If there are parameters that are affected every time an effect is spawned, that should probably be passed into it after creation.
    Lead Programmer - UE4 Animation/Physics/Audio Team - Epic Games
    Twitter: @EpicJamesG

    Comment


      #3
      Thanks for insight.

      After some thinking I have hacked problem around by using structs, and Set/Get to setup things in advance and start passing it around.
      It's bit convoluted when you have lots of structs in blueprint, but at least now I can keep everything in one place if I choose so.


      Thanks for making me think about this issue again
      https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

      Comment

      Working...
      X