Making a 'success rate'?

i’m pretty much a beginner in gdevelop and i’m trying to make some sort of d&d like rpg game. it mostly relies on random encounters. luckily i already got that covered though, the only problem i had is making a ‘success rate’ :confused:

i tried using random() - which is the same way i did for the random encounters - but, it doesn’t really work the way it’s supposed to. am i missing something??

What do you mean by “success rate”? What are you trying to count and/or calculate as success?

i don’t really know how to explain it well but, it’s like a chance of getting a critical hit by the enemy? sorry, i’m not really fluent in english…

D&D usually checks a d20 against the target number of the enemy. So, say you have an enemy with a total armor of 11, you need an 11 and above to check if your attack hit. Usually a 20 means a critical hit which means that when you roll the damage dice you double the damage. I am currently working on a similar turn based game with critical hits.

In gdevelop freeform it would go like this.

  • Do Random(19)+1 to variable CheckDice

  • If CheckDice < EnemyArmor — Attack Fails

  • If CheckDice >= EnemyArmor — Attack Succeeds

    • If CheckDice = 20 — Do 2 to Variable AttackModifier

I hope you find that useful…


MeX1Co’s advice above is exactly how I’d do it.

ah, i never thought of that :sweat_smile: thanks a lot though! i’ll try using the same methods for it and I hope it works well.