change attribute game.criticalChance random (1,100)
rule any
if game.critical chance = 1
if game.critical chance = 15
do....
rule any
if game.critical chance = 16
if game.critical chance = 100
do..
In my opinion it could be something like that, but putting 100 if is long, maybe there is a way to include the first 15 numbers in one if and the remaining 85 in another if in the second rule
There are other ways but @UltraLionBlu's way is simple and easy. Except you can say game.criticalChance random(1,100) like he says, but only need one condition. <=15 will give you either 1-15 (yes) or 16-100 (no). If you want to control is via an attribute, you just say <= self.attribute and have self.attribute be the % chance you want.
@Armelline said:
There are other ways but @UltraLionBlu's way is simple and easy. Except you can say game.criticalChance random(1,100) like he says, but only need one condition. <=15 will give you either 1-15 (yes) or 16-100 (no). If you want to control is via an attribute, you just say <= self.attribute and have self.attribute be the % chance you want.
Great Armelline, it was so obvious but I didn't think about it
Comments
change attribute game.criticalChance random (1,100)
rule any
if game.critical chance = 1
if game.critical chance = 15
do....
rule any
if game.critical chance = 16
if game.critical chance = 100
do..
In my opinion it could be something like that, but putting 100 if is long, maybe there is a way to include the first 15 numbers in one if and the remaining 85 in another if in the second rule
There are other ways but @UltraLionBlu's way is simple and easy. Except you can say game.criticalChance random(1,100) like he says, but only need one condition. <=15 will give you either 1-15 (yes) or 16-100 (no). If you want to control is via an attribute, you just say <= self.attribute and have self.attribute be the % chance you want.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Great Armelline, it was so obvious but I didn't think about it
Walaa!
Looks good. If you wanted to do this in a single behavior, you could use:
Change Attribute self.critical to floor(random(1,100)/85)
or
Change Attribute self.critical to floor(random(1,100)/(100-self.criticalChance))
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User