0
Answered

I need to use a text input to change the attribute value.

Naythan 4 months ago in Stats updated by Marti (Lead Developer) 4 months ago 2

Thank you eagleeyez and Marti.  You guys are a real help here!


 I figured out how to make an attribute value and a stat value write to the UI.  But I can't seem to get a text input to write to the attribute so I can set the attribute value.
Also, I can use this[value] formula which gives me a decimal, but if I change it to round[value] it doesn't show a value.  Any ideas?

Thank you

Unity version:
2018.4.23f1
Game Creator version:
1.1.8
GOOD, I'M SATISFIED
Satisfaction mark by Naythan 4 months ago

I think I'm on to something.
I set a Global Variable (STR) to 100, set it as a string

I set a Stat Base Value to 100, formula to global[STR]

I set the Attribute to min value to 0, Current value to 1

This allows me to use a text input to write a number to the Global (STR) which writes to a UI text field.

I can subtract 1 every time I press a button. The only problem I see is that my Attribute value goes down and I can't bring it back up again by typing into the Text Input box.
Not sure this makes sense...

Answered

Think about Formulas as normal math formulas. It may be easier to replace symbols with an X, as we're more used to that.


The value "this[value]" is replaced with a value, let's say X, so if you want to round this value, you use round[X]. If you expand this, you get:


 round[this[value]]