I would like to edit the escape rate formula in RPG Maker XP. I know that the formula is "Successful escape rate = 50 × actors' average agility ÷ enemies' average agility," but I don't know where to find that formula in the default scripts so I can edit it. Where is it?
P.S. Does an escape rate of 100 mean guaranteed escape?
It's inside Scene_Battle2 - the method is "update_phase2_escape". I'm looking at the script in a game where I already modified this, but I think the comment right before the relevant line is "Determine if the escape is successful" and it will be a true or false evaluation that starts with "rand(100) < (formula)". Therefore, if you use this format, then yes a value of 100 or more will mean the escape is always successful, since all random float-type numbers 0-100 will be less than 100.
Tip: You can hit Ctrl + Alt + F inside the script editor to search all scripts for a certain word or phrase. I found the right spot by using this function with the word "escape".
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
Shaz:
Oh, sorry.
Wavelength:
I found it and was able to make it work! Thank you.
P.S. I didn't know there was a "Search-All" function in the script editor. Thanks for the info.
@Wavelength
There is another way, and I'm wondering what advantage your preferred approach would have over the very straightforward one that I use. (If I use it, it must be straightforward!)
Script BattleManager
line 224
change @escape_ratio += 0.1
to read @escape_ratio += 1