Derived stats

I dont remember what it’s called but I remember a choice game where the stats for health were like health = 100 + endurance * 2 or something and I want to recreate that. Is this possible? Am I imagining a game where the stats were like that?

Yep, it’s possible. Just throw some parentheses around each operation and you should be fine:

*set health (100+(endurance*2))

3 Likes

Thank you very much!

2 Likes

Going a little further. If you want it to be reactive, meaning, you want health to adjust every time endurance changes, you should put that logic into a subroutine and make calls to the subroutine to set the value of endurance instead of seting it directly.

*label set_endurance
*params new_value
*set endurance new_value
*set health (100+(endurance*2))
*return
4 Likes

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.