He has 20 attribute points to distribute amongst his stats. No stat can be lower than 5 and no higher than 20. How do I go about programming this in the screen itself, so the buttons disable themselves or stop working once they've hit the right conditions?
Right now, this is my code with all of my experimentation removed:
Code: Select all
screen characterCreation:
grid 4 1:
text "Strength" xalign 0.1 yalign 0.10
text "[Protag.Strength]" xalign 0.15 yalign .10
textbutton "-" xalign 0.17 yalign .10:
action[ SetField( Protag, "Strength", Protag.Strength-1 ), SetField( Protag, "attributePoints", Protag.attributePoints+1) ]
textbutton "+" xalign 0.19 yalign.10:
action[ SetField( Protag, "Strength", Protag.Strength+1 ), SetField( Protag, "attributePoints", Protag.attributePoints-1 ) ]
text "Attribute Points" xalign 0.0 yalign 0.30
text "[Protag.attributePoints]" xalign 0.25 yalign 0.30
Another experiment was instead of trying to do all of this on the screen, I'd call a function every time a button was pressed. That however caused the buttons to completely deactivate.
Does anyone have any ideas on how to do this or is the impossible kicking me to the curb?