Make random encounters inescapable?

Koi

Veteran
Veteran
Joined
Aug 8, 2013
Messages
358
Reaction score
14
First Language
English
Primarily Uses
RMVXA
The title says it all. Is there a way to make map random encounters inescapable?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Do 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.
 

Koi

Veteran
Veteran
Joined
Aug 8, 2013
Messages
358
Reaction score
14
First Language
English
Primarily Uses
RMVXA
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?
 

Zarby

Veteran
Veteran
Joined
Dec 16, 2012
Messages
42
Reaction score
25
First Language
French
Primarily Uses
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
 

Koi

Veteran
Veteran
Joined
Aug 8, 2013
Messages
358
Reaction score
14
First Language
English
Primarily Uses
RMVXA
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
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.
 

Zarby

Veteran
Veteran
Joined
Dec 16, 2012
Messages
42
Reaction score
25
First Language
French
Primarily Uses
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 :

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
 
Last edited by a moderator:

Koi

Veteran
Veteran
Joined
Aug 8, 2013
Messages
358
Reaction score
14
First Language
English
Primarily Uses
RMVXA
Thanks! It works like a charm!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top