- Joined
- Mar 14, 2012
- Messages
- 231
- Reaction score
- 85
- First Language
- english
- Primarily Uses
- N/A
So I'm using VE Hit Formula and I input the formula 'result = $gameVariables.setValue(491, Math.randomInt(20) + 1); if (v[491] >= b.def){sethit (1.0)} else {sethit (0.0)} '
Essentially this is suppose to recreate the DnD way of handling hits/misses where a d20 is rolled and if the roll is higher than the defending creature, the attack hits.
As you can see, every time the player attacks, the d20 is rolled for Variable 491. Using the debug menu, I can see that yes, Variable 491 'rolls' between 1 - 20, however, when the attacks should hit, they always miss. I'm stumped for now. Any help would be greatly appreciated.
Edit: "result = $gameVariables.setValue(491, Math.randomInt(20) + 1); if (v[491] >= b.def) {result = 100} else { result = 0}" does not work either. The Variable changes every time anyone attacks according to the Console, but for some reason Hit Rate doesn't change :/
Essentially this is suppose to recreate the DnD way of handling hits/misses where a d20 is rolled and if the roll is higher than the defending creature, the attack hits.
As you can see, every time the player attacks, the d20 is rolled for Variable 491. Using the debug menu, I can see that yes, Variable 491 'rolls' between 1 - 20, however, when the attacks should hit, they always miss. I'm stumped for now. Any help would be greatly appreciated.
Edit: "result = $gameVariables.setValue(491, Math.randomInt(20) + 1); if (v[491] >= b.def) {result = 100} else { result = 0}" does not work either. The Variable changes every time anyone attacks according to the Console, but for some reason Hit Rate doesn't change :/
Last edited:

