Hey all [ T]/ *
I've been stuck on this problem for a few days; I'm trying to make a roguelike stat screen using variables and widgets but I can't quite get it right.
I want to apply the player.stat["etc"]
variables to the widget's text fields.
This: widget["character stats"].element["0004"].text = player.stat["hp"];
prints the static first value into the text field but if the character gets hit it doesn't change
This: widget["character stats"].element["0004"].text = $player.stat["hp"];
returns "null" in the text box; I think that's because the script can't pull the local variable to the widget?
I had a couple of goes at setting this as a global property but I might be doing that wrong lol
set_global_property("hp", $player.stat["hp"]);
widget["character stats"].element["0004"].text = global.property["hp"];
set_global_property("mp", player.stat["mp"]);
widget["character stats"].element["0005"].text = global.property["mp"];
If I apply the script to a global event like player taking damage it does work in the widget and the health will decrease from 100, but I need it to work generally from the stats. Like equipping a sword with +1 attack changing your attack value on the widget.
Any help would be much appreciated; I might be going about it the wrong way. 🙂