Reason why ToString isn't working on structured global variable

Trying to get a text object to call from a Global Structured variable


ToString(GlobalVariable(skillpoints.damage_multiplier)) + " /5"

However, it’s still reading as “0” no matter how many points are put in.

Wasn’t an issue when I was just using regular GlobalVariables, only when structured. Is this a syntax thing?


No this is correct and works for me, same as GlobalVariableString(skillpoints.damage_multiplier)

Should be a problem at filling the structure variable.

you might be right.

Is changing the structure children of a global variable just

Change the Global Variable skillpoints.damage_multiplier add + 1 ?

It worked for me as well. Make sure the set and get variable names are spelled identically including capitalization. Make sure they’re both global. Check the debugger. See if there are 2 variables with similar names. (Meaning 1 is misspelled)

Check if something is “breaking” the structure. Structures are very delicate. Sometimes an event will “break” or reset a variable structure. Check the value right after you set it and see if it’s being set. There might be something else causing the problem like the variable being used without any children names like skillpoints or some other action that might reset the variable. Check the variable in different places.

Occasionally, I’ll check the debugger and I’ve done something that causes a variable’s children to be there own variables. It can be tough to see the problem.

If you’re still having problems, you can post a pic of the variables in use. Maybe a fresh pair of eyes can see something.

You may be right. Thanks to you both.

It was the spelling haha.

1 Like

We’ve all been there. Sometimes for hours.