Hey there gang, a while back I got a bit of code to add to the RPG_Object.js that removed the ability to flee from random battles. I want this to only happen on my games hard setting however. So I need to add an extra check to see if variable 14 = 2. If it does = 2 then the escape command should be removed.
I've tried some things from searching .js forums but have had no luck so I thought I would ask here. I'll post the code I use.
Game_Player.prototype.executeEncounter = function() {
if (!$gameMap.isEventRunning() && this._encounterCount <= 0) {
this.makeEncounterCount();
var troopId = this.makeEncounterTroopId();
if ($dataTroops[troopId]) {
BattleManager.setup(troopId, false, false);
BattleManager.onEncounter();
return true;
} else {
return false;
}
} else {
return false;
}
};
Would love any help I could get on this one if anyone would like to lend a hand. And thanks for taking a look. 🙂
I've tried some things from searching .js forums but have had no luck so I thought I would ask here. I'll post the code I use.
Game_Player.prototype.executeEncounter = function() {
if (!$gameMap.isEventRunning() && this._encounterCount <= 0) {
this.makeEncounterCount();
var troopId = this.makeEncounterTroopId();
if ($dataTroops[troopId]) {
BattleManager.setup(troopId, false, false);
BattleManager.onEncounter();
return true;
} else {
return false;
}
} else {
return false;
}
};
Would love any help I could get on this one if anyone would like to lend a hand. And thanks for taking a look. 🙂