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’
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??
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