I would like to know how sustainable the Frankenstein code I made for rolling D20s for skill checks is. Mainly, it works, I think, but is there a way to tell if it is working as intended?
I am not getting errors anymore and it seems to alternate between fail and success but I have no idea if it’s actually doing what I want it to?
I threw it together using some pastebin guides by Michael Maxwell as well as a guide on *rand rolls.
Example:
*create strength 10
*create d20 0
*create strengthmodifier 0
*create rollresult 0
*page_break
Blah blah
*fake_choice
#blah
*set strength+10
Blah
*fake_choice
#blah
*rand d20 1 20
*set strengthmodifier (strength/10)
*set rollresult (d20 + strengthmodifier)
*page_break
*if (rollresult >= 13)
Yay
*if (rollresult < 13)
Boo
*page_break
Blah blah blah
*finish
With this system how do I avoids the stats page rerolling thing? The page_break doesn’t seem to be enough but what should I do? I’ve tried everything but nothing works.
I also tried
*create strength 10
*create d20 0
*create strengthmodifier 0
*create rollresult 0
*create rollsuccess “false”
*create rollfail “false”
*page_break
Blah blah
*fake_choice
#blah
*set strength+10
Blah
*fake_choice
#blah
*gosub skillchecks
*if (rollresult >= 10)
*set rollsuccess “true”
*goto next1
*if (rollresult < 10)
*set rollfail “true
*goto next 1
*label skillchecks
*rand d20 1 20
*set strengthmodifier (strength/10)
*set rollresult (d20 + strengthmodifier)
*return
*label next1
*if (rollsuccess = true)
Yay
*page_break
*if (rollfail = true)
Boo
*page_break
Blah
*finish
And I’ve tried atleast five to six iterations of the second one with no success. I’d appreciate help figuring out how to stop the rolling loop and if my code even is rolling correctly.