Unable to get the value from a "InstancedStruct" variable

Hello there,

To make it short, I want to make a Hades-like skill tree. Each skill affects a specific variable in the game, sometimes it’s a int, sometimes a bool, sometimes a float… you get the idea.

To avoid having a long list of useless variables, I’m tring to use a “InstancedStruct” variable instead.

Then inside my data table, I select the correct variable and add a value.

image

After that, whenever I want to get a specific value for a specific skill, I run this function to get the correct InstancedStruct variable:

But then, when I do a “Get Instanced Struct Value”… impossible to get the value. I can’t connect anything to it, I can’t break it… it always returns “not valid”. I know the function is getting the right data, and I know this is a float. I just can’t manage to connect it to my next function.

Thanks a lot for your help :slight_smile:

you have to know the struct type when you GetInstancedStructValue. (you can do this by pulling off and using break struct or connecting it to a valid struct type)

so in your Event DungeonLost, it must expect a specific struct, lets say your float struct from your example.

any array of InstancedStruct called Variable isnt useful because you dont know what the variable is (or if you do you dont need InstancedStruct)

what i do is have a struct/Map with (GameplayTag, FinstancedStruct) the tag defines the type ie float and then you can switch and retrieve it

I’m not sure to understand what you mean.

The “variable” output is just an “InstancedStruct” variable, which contains this (a variable type and a value):

image

But it’s not always a float, it depends on the skill inside my data table.

For this example, I know this is a float. And I just want to get the “value”, so the “50”.

I don’t know what I’m supposed to do with this output:

Thanks!

Well, seems like it wasn’t working because the only things that are accepted here are structures, not variables like bools or floats.

So I just created a struct containing only a float variable, and it works now :slight_smile:

yep but what i mean is the function needs to know what the value is, so in this case float struct.

so if all you variables are floats you dont need instanced struct, if they have different things then you need a way to ID them. ie use a TMap of GameplayTag/InstancedStruct for you variables and then can get
Variable.Damage → float
Variable.Description → FText
etc

but yes it does need to be a struct but as a tip, Vectors are structs, GameplayTags are struct so some data you can just pass though