Random Encounters When Moving

Dacuna

Veteran
Veteran
Joined
Feb 19, 2013
Messages
143
Reaction score
10
First Language
English
Primarily Uses
In one section of my game, I'm making a labyrinth where the character moves on his own, in the direction the player chooses.

For instance, the character moves down, and when he reaches an intersection, the player chooses "Left" or "Right".

The only problem is, I want to add in random encounters, but no monsters show up when the player is moving by Set Move Route.

Is there a way to enable random encounters when setting the move route?

Thanks.
 

Kai Monkey

Veteran
Veteran
Joined
Apr 3, 2012
Messages
166
Reaction score
119
First Language
RGSS3
Primarily Uses
Hey ♫

I have not tested it completely, so their may be some bugs, but try this:

Code:
################# Kaimonkey's Move Route Encounters Snippet################class Game_Player < Game_Character  #--------------------------------------------------------------------------  # * Execute Encounter Processing  #--------------------------------------------------------------------------  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]    BattleManager.setup(troop_id)    BattleManager.on_encounter    return true  end  def update_encounter    return if $TEST && Input.press?(:CTRL)    return if $game_party.encounter_none?    return if in_airship?    #return if @move_route_forcing    @encounter_count -= encounter_progress_value  end  def update_nonmoving(last_moving)    if $game_map.interpreter.running?      update_encounter if last_moving    else      if last_moving        $game_party.on_player_walk        return if check_touch_event      end      if movable? && Input.trigger?(:C)        return if get_on_off_vehicle        return if check_action_event      end      update_encounter if last_moving    end  endend 
 
Last edited by a moderator:

Kai Monkey

Veteran
Veteran
Joined
Apr 3, 2012
Messages
166
Reaction score
119
First Language
RGSS3
Primarily Uses
Are you sure that's the script that has the incompatibility issue? I havn't tested it yet, but I read through the whole code and there's no reason the two should interact

EDIT: Tested with the script, and it worked perfectly. Do you have anyother scripts installed?

EDIT EDIT: Wait, nevermind, found the bug, was nothing to do with Yanfly, but was to-do with when you are on a map with no encounters.

Here is the fix

Code:
################# Kaimonkey's Move Route Encounters Snippet################class Game_Player < Game_Character  #--------------------------------------------------------------------------  # * Execute Encounter Processing  #--------------------------------------------------------------------------  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]    BattleManager.setup(troop_id)    BattleManager.on_encounter    return true  end  def update_encounter    return if $TEST && Input.press?(:CTRL)    return if $game_party.encounter_none?    return if in_airship?    #return if @move_route_forcing    @encounter_count -= encounter_progress_value  end  def update_nonmoving(last_moving)    if $game_map.interpreter.running?      update_encounter if last_moving    else      if last_moving        $game_party.on_player_walk        return if check_touch_event      end      if movable? && Input.trigger?(:C)        return if get_on_off_vehicle        return if check_action_event      end      update_encounter if last_moving    end  endend  
 
Last edited by a moderator:

Dacuna

Veteran
Veteran
Joined
Feb 19, 2013
Messages
143
Reaction score
10
First Language
English
Primarily Uses
Oh yeah, that was it...

Well, thanks a lot for the fix!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top