Hi all!
I know that I can find the formula for the encounter rate at the function Game_Player.prototype.makeEncounterCount() located on the rpg_objects. Now, i want to modify the formula so I always get 3 more steps or 3 less steps than the specified Enc. Steps.
Ex: If I specify 10 for a certain map, I can get the number 7 through 13.
Thanks!
Help with formula for encounter rate.
● ARCHIVED · READ-ONLY
-
-
Try this ...
Code:Game_Player.prototype.makeEncounterCount = function() { var n = $gameMap.encounterStep(); this._encounterCount = n - 3 + Math.randomInt(7); }
Save this code into a new file with a .js extension into your Plugins folder, and add it as a plugin, rather than modifying rpg_objects.js - that way, if you update your project, you won't have to reapply the changes. -
Thanks Shaz! Now, there should be something about how the steps are calculated that I dont get. To be honest, I tried different formulas on a sandbox that should work but didnt on the MV. And the same happened with the formula you pasted. It works on a sandbox, but on the MV it gets an encounter on steps 4,5,6 and 7. mostly on 5 and 6 and never past 7. (the encounter step is specified at 10).
EDIT: Yeah, there is something else that gets factored in. I used this formula :
Code:With the number at 10 and I get an encounter every 5 steps. So maybe after the formula something like divided by 2 takes place? Any way, ill play with those numbers and let you know.var n = $gameMap.encounterStep(); this._encounterCount = n ; -
Interesting ... here:
Code:Game_Player.prototype.updateEncounterCount = function() { if (this.canEncounter()) { this._encounterCount -= this.encounterProgressValue(); } }; Game_Player.prototype.encounterProgressValue = function() { var value = $gameMap.isBush(this.x, this.y) ? 2 : 1; if ($gameParty.hasEncounterHalf()) { value *= 0.5; } if (this.isInShip()) { value *= 0.5; } return value; };
could have something to do with it? Do you have any of those conditions (half encounter rate provided by any feature/state/etc, on terrain designated with the bush tag, or in a ship?
Maybe you could change that function to always return 1 (by adding it to your script and removing all the logic and just returning 1 as the value), or change your encounter formula to multiply the result by 2. -
Yeah, makes sense. The value of 0.5 is the one cutting our steps by half. I´m certainly I dont have the the condition of EncounterfHalf. So maybe my grass has the bush condition, which i didn't know it existed. Now I know more. I just tested in plain dust tile and it doesnt get cut by half. So, There we go.
Thanks Shaz, as always, appreciated! -
I think bush is meant to double the rate. Try the long grass and see if it does.
-
I just removed the flag of bush in all my tiles, i dont expect the ecounter rate to vary from tile to tile. And now your formula works.
Thanks! -
The bush flag also makes the characters' lower halves semi-transparent to add to the effect of walking through long grass. So you'll notice a difference in the appearance when that happens.