The title says it all. Is there a way to make map random encounters inescapable?
Make random encounters inescapable?
RGSS3 Script RequestsDo you have evented encounters too? Do you want them to be escapable still (ie - does this request ONLY apply to random encounters, or all encounters)?
If you don't have any evented encounters, or want them to be inescapable as well, it'll be easier.
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
If you don't have any evented encounters, or want them to be inescapable as well, it'll be easier.
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
In the maps where this is required, there are no evented encounters, just random.
If this is being done by a script, is there any way to make it so that there is a varying chance of a battle being escapable or not? So sometimes you could, sometimes not?
If this is being done by a script, is there any way to make it so that there is a varying chance of a battle being escapable or not? So sometimes you could, sometimes not?
class Game_Player < Game_Character #random escapable encounter def encounter return false if $game_map.interpreter.running? return false if $game_system.encounter_disabled return false if @encounter_count > 0 make_encounter_count troop_id = make_encounter_troop_id return false unless $data_troops[troop_id] #Change 50 for the percentage you want, 100% = not escapable, 0% = always escapable BattleManager.setup(troop_id,isEscapable?(50)) BattleManager.on_encounter return true end def isEscapable?(percentage) if ($game_switches[10] == true) #CHANGE THIS SWITCH ID[10] BY THE ONE OF YOU CHOICE r = rand(100) if (r < percentage) return true else return false end return true end return true end endChange the 50 of isEscapable?(50) by the percentage you want 100 = impossible to escape always, and 0 = escape is always possible, 50 = 1 chance on 2
and change the 10 of $game_switches[10] by your switch id you want to activate non-escapable random battle
and change the 10 of $game_switches[10] by your switch id you want to activate non-escapable random battle
I don't think I'm using this right...
So I've put it under Materials, then changed the 50 to 100, then I made a switch to activate this (which was switch 88) and then changed in the script to 88, and still after activating that switch, all random encounters can be escaped.
I don't know if it's important information to note, but I'm using the Yanfly Ace Battle Engine.
sorry it 100 for always escapable, and 0 for not escapable, try to set it to 0, it should work with Yanfly Battle engine, you are probably using it right it not complicated the selected switch just need to be activated 🙂
if you are using switch 88, no chance of escape :
if you are using switch 88, no chance of escape :
Code:
class Game_Player < Game_Character #random escapable encounter def encounter return false if $game_map.interpreter.running? return false if $game_system.encounter_disabled return false if @encounter_count > 0 make_encounter_count troop_id = make_encounter_troop_id return false unless $data_troops[troop_id] #Change 50 for the percentage you want, 100% = not escapable, 0% = always escapable BattleManager.setup(troop_id,isEscapable?(0)) BattleManager.on_encounter return true end def isEscapable?(percentage) if ($game_switches[88] == true) #CHANGE THIS SWITCH ID[10] BY THE ONE OF YOU CHOICE r = rand(100) if (r < percentage) return true else return false end return true end return true end end
Thanks! It works like a charm!
Original thread: https://forums.rpgmakerweb.com/threads/make-random-encounters-inescapable.37208/