I’m having trouble with with math, i want the code to recognize different variables and make addition of these variables and show in the stats screen.
The variable Head_life have the value of 1 the remainder has a value of 0, what I intended was to add these variables presented and by the logic the final text should be 1. this is a test tha i did.
My code looks like this:
Armor Stats
*stat_chart
text Life (Head_life + Body_life + LeftArm_life+ RightArm_life+ Legs_life)
I think you need a
*set life head + legs etc
somewhere at the beginning of the stats file before that IIRC
and have it just be
*stat_chart
text life life
If you can remember that CS can only cope with two items at a time, that makes it easier. e.g. (1 + 2) is two items, (1 + 2 + 3) is three items and confuses the engine. That’s why you need the parentheses (1 + 2) + 3 works because it does the two items in the parentheses first, turning them into just one item.