Rogue-Like Movement / Chase Mode / Surprise Attack

Great script, just wondering if there's any method to pause the event's movement when the player escapes an initiated battle and resumes movement after player has moved at least 2 blocks away?
Great script, just wondering if there's any method to pause the event's movement when the player escapes an initiated battle and resumes movement after player has moved at least 2 blocks away?
You can use a switch for that.

When setting up the event battle, tick allow escape. And you should get a conditional branch for escaping. 

In the escape conditional branch, set it to turn on self switch A/B/C/D

Set up a new page in the event and set the page condition to self switch A/B/C/D

In that page, set it to run as parallel, then simply put wait (time you want it to wait) then turn off the self switch.

This way when you escape the event should do nothing and wait there for awhile.

You can even set that page to "through" so your player can walk through the event during that wait period.
Hey thanks for the quick reply.

Unfortunately it isn't triggering the way I wanted to. Your suggestion is very much like the method I had implemented where if escape, the movement of the event is to change opacity to 128 and wait a certain length of frames. It seems my way and your way both conflict with the use of the chase script. Immediately after the wait is over chase gets initiated regardless of whether the player has moved or not.
Did a test here and it works without error. 

The opacity change will not work since the chase script has that in control. If you must use a semi-transparent during escape wait, try this version of the script:

Spoiler
#==============================================================================# ■ Meow Face Rogue-like movement & Chase#------------------------------------------------------------------------------# Author: Meow Face#===============================================================================begin  =========   Features:  =========  [1] Have the event move only when the player is moving      (Controlled by switch)  [2] Enemy remain half/fully hidden until the player is in range      (Surprise attack anyone?)  [3] Chase Mode, events will start chasing the player in range      (Or runs away, you can even set your own AI)  [4] Puts an exclamation mark on the event when chase starts      (You get to choose the balloon)  [5] Extra ENFORCED moveroute toward the player during chase      (Go striaght for player when in chase range, do normal chase when not, do random move        when player is 10 mas away)  [6] Chase Mode works for both rogue move/normal move      (So you get to choose which one you like most, rogue or normal)        ============   How To Use:  ============  [1] Put this script above Main and below Material  [2] Put <enemy> tag in the event's name  [3] Change the event's move type to Move Toward Player  [4] Turn the Switch on for rogue like move, off for normal move.    = Run Away Enemy =  ** If you set the move type to "custom" you can setup your own AI  ** Use "Move away from Player" x 3, "Random move" x 1, "Move one step forward" x 1  ** Check both repeat and ignore when unable to move tick boxes  ** You should be able to make an event that runs away from the player this way    ==================   Name Tag: <enemy>  ==================  Put <enemy> as a tag in an event's name to indicate it as an enemy for chase.  Event with <enemy> tag will be able to do chase with or without the rogue move switch.  The only difference between rogue/normal is it will not wait for the player   to do its move in normal mode and move only when the player is moving in rogue mode.    ===============   Controll Switch:  (default 1, can be changed)  ===============  Turn on the switch anytime anywhere to switch between rogue move and normal move  Rogue move only works for events with <enemy> name tag.    ================   Configure Points:  ================  You can set which switch number to turn on/off the rogue move  You can set the distance to trigger off chase mode  You can set the alpha/opacity of the enemy not in chase  You can set the speed/frequency of enemy in/not in chase    =============   Compabilities  =============  It's unlikely that this script will conflict with any other script unless they happen to  be using the same method name i used for new method. Old methods are all aliased.    =============   Terms of Use  =============  Free for use in any free/commercial games.  =end#==============================================================================module MF_RogueMove#==============================================================================# START OF CONFIGURATION#==============================================================================    SW_ROGUE = 1 #Switch number for turning the rogue move on/off (0 to turn it off)    DISTANCE = 3 #Distance for chase activation (1-10, 10 is about 640x640 pixels in screen size)    HIDE_OPACITY = 128 #Opacity of the enemy when player is not in range (0-255)    BALLOON = 1 # Pop-up Balloon type (1-10, 0 to turn it Off)    CHASE_SPEED = 4 # Enemy Speed when chasing the player (0-6)    CHASE_FREQUENCY = 6 # Enemy Move Frequency when chasing the player (0-6)    DEFAULT_SPEED = 4 # Enemy Move Speed when not chasing the player (0-6)    DEFAULT_FREQUENCY = 3 # Enemy Move Frequency when not chasing the player (0-6)  #==============================================================================# END OF CONFIGURATION# Edit anything pass this line at your own risk!#==============================================================================  end # DO NOT REMOVE THIS#==============================================================================class Game_Event < Game_Character  #--------------------------------------------------------------------------  # ◎ Alias Move Type: Move Toward Player  #--------------------------------------------------------------------------  alias meowface_mttp move_type_toward_player  def move_type_toward_player    if @event.name.include?('<enemy>') && distance_from_player <= MF_RogueMove:😀ISTANCE      move_toward_player      else      meowface_mttp    end  end  #--------------------------------------------------------------------------  # ◎ Alias update movement  #--------------------------------------------------------------------------  alias meowface_stop update_stop  def update_stop    if $game_switches[MF_RogueMove::SW_ROGUE] && @event.name.include?('<enemy>')      super      return update_self_movement if $game_player.moving?    else      meowface_stop    end  end  #--------------------------------------------------------------------------  # ○ New method: Get the Distance between Event and Player  #--------------------------------------------------------------------------  def distance_from_player    distance_x_from($game_player.x).abs + distance_y_from($game_player.y).abs  end    #--------------------------------------------------------------------------  # ○ New method: Start Chasing the Player  #--------------------------------------------------------------------------  def chase_player      if distance_from_player <= MF_RogueMove:😀ISTANCE && @escape != true        self.balloon_id = MF_RogueMove::BALLOON        @opacity = 255         @move_speed = MF_RogueMove::CHASE_SPEED        @move_frequency = MF_RogueMove::CHASE_FREQUENCY      else        @opacity = MF_RogueMove::HIDE_OPACITY        @move_speed = MF_RogueMove:😀EFAULT_SPEED        @move_frequency = MF_RogueMove:😀EFAULT_FREQUENCY      end  end  #--------------------------------------------------------------------------  # ◎ Alias Update Method  #--------------------------------------------------------------------------  alias meowface_rg_update update  def update    if @event.name.include?('<enemy>') && !$game_map.interpreter.running?      chase_player    end    meowface_rg_update  endend

Then in your event's move route, add a script call "@escape = true" to prevent transparency/chase update, "@escape = false" to re-enable it.

So your move route setting for escape will be something like:

@escape = truestep animation = offopacity = 128through = onwait (time)through = offstep animation = onopacity = 255@escape = falseedit:

note that you don't have to use a new event page for this method. just put that in the escape condition will do.

easier if you use a common event for it.
Thanks for the updated script!

Actually didn

t end up using it as it was an error on my end. One of the other scripts I was using was utilizing switch 2 which conflicted with your script.
you can change the switch id to whatever you want in the settings area
Due to the V3 to V4 forum migration the code format has been bugged and messed up for script pasting in the top post.


They promised a fix for that and working on to fix the code but since there seems to be no progress at the moment, i am adding this here temporary as an alternative copy until they finally fix the top post:


this one here is pulled from the old format so it might differs from the new format in the top post (if it get fixed)

Code:
#==============================================================================
# ■ Meow Face Rogue-like movement & Chase
#------------------------------------------------------------------------------
# Author: Meow Face
#==============================================================================
=begin

  =========
   Features:
  =========
  [1] Have the event move only when the player is moving
      (Controlled by switch)
  [2] Enemy remain half/fully hidden until the player is in range
      (Surprise attack anyone?)
  [3] Chase Mode, events will start chasing the player in range
      (Or runs away, you can even set your own AI)
  [4] Puts an exclamation mark on the event when chase starts
      (You get to choose the balloon)
  [5] Extra ENFORCED moveroute toward the player during chase
      (Go striaght for player when in chase range, do normal chase when not, do random move 
       when player is 10 mas away)
  [6] Chase Mode works for both rogue move/normal move
      (So you get to choose which one you like most, rogue or normal)
      
  ============
   How To Use:
  ============
  [1] Put this script above Main and below Material
  [2] Put <enemy> tag in the event's name
  [3] Change the event's move type to Move Toward Player
  [4] Turn the Switch on for rogue like move, off for normal move.
  
  = Run Away Enemy =
  ** If you set the move type to "custom" you can setup your own AI
  ** Use "Move away from Player" x 3, "Random move" x 1, "Move one step forward" x 1
  ** Check both repeat and ignore when unable to move tick boxes
  ** You should be able to make an event that runs away from the player this way
  
  ==================
   Name Tag: <enemy>
  ==================
  Put <enemy> as a tag in an event's name to indicate it as an enemy for chase.
  Event with <enemy> tag will be able to do chase with or without the rogue move switch.
  The only difference between rogue/normal is it will not wait for the player 
  to do its move in normal mode and move only when the player is moving in rogue mode.
  
  ===============
   Controll Switch:  (default 1, can be changed)
  ===============
  Turn on the switch anytime anywhere to switch between rogue move and normal move
  Rogue move only works for events with <enemy> name tag.
  
  ================
   Configure Points:
  ================
  You can set which switch number to turn on/off the rogue move
  You can set the distance to trigger off chase mode
  You can set the alpha/opacity of the enemy not in chase
  You can set the speed/frequency of enemy in/not in chase
  
  =============
   Compabilities
  =============
  It's unlikely that this script will conflict with any other script unless they happen to
  be using the same method name i used for new method. Old methods are all aliased.
  
  =============
   Terms of Use
  =============
  Free for use in any free/commercial games.
  
=end
#==============================================================================

module MF_RogueMove

#==============================================================================
# START OF CONFIGURATION
#==============================================================================
  
  SW_ROGUE = 1 #Switch number for turning the rogue move on/off (0 to turn it off)
  
  DISTANCE = 5 #Distance for chase activation (1-10, 10 is about 640x640 pixels in screen size)
  
  HIDE_OPACITY = 128 #Opacity of the enemy when player is not in range (0-255)
  
  BALLOON = 1 # Pop-up Balloon type (1-10, 0 to turn it Off)
  
  CHASE_SPEED = 4 # Enemy Speed when chasing the player (0-6)
  
  CHASE_FREQUENCY = 6 # Enemy Move Frequency when chasing the player (0-6)
  
  DEFAULT_SPEED = 4 # Enemy Move Speed when not chasing the player (0-6)
  
  DEFAULT_FREQUENCY = 3 # Enemy Move Frequency when not chasing the player (0-6)
  
#==============================================================================
# END OF CONFIGURATION
# Edit anything pass this line at your own risk!
#==============================================================================
  
end # DO NOT REMOVE THIS

#==============================================================================

class Game_Event < Game_Character
  #--------------------------------------------------------------------------
  # ◎ Alias Move Type: Move Toward Player
  #--------------------------------------------------------------------------
  alias meowface_mttp move_type_toward_player
  def move_type_toward_player
    if @event.name.include?('<enemy>') && distance_from_player <= MF_RogueMove::DISTANCE
      move_toward_player
      else
      meowface_mttp
    end
  end
  #--------------------------------------------------------------------------
  # ◎ Alias update movement
  #--------------------------------------------------------------------------
  alias meowface_stop update_stop
  def update_stop
    if $game_switches[MF_RogueMove::SW_ROGUE] && @event.name.include?('<enemy>')
      super
      return update_self_movement if $game_player.moving?
    else
      meowface_stop
    end
  end
  #--------------------------------------------------------------------------
  # ○ New method: Get the Distance between Event and Player
  #--------------------------------------------------------------------------
  def distance_from_player
    distance_x_from($game_player.x).abs + distance_y_from($game_player.y).abs
  end  
  #--------------------------------------------------------------------------
  # ○ New method: Start Chasing the Player
  #--------------------------------------------------------------------------
  def chase_player
      if distance_from_player <= MF_RogueMove::DISTANCE
        self.balloon_id = MF_RogueMove::BALLOON
        @opacity = 255 
        @move_speed = MF_RogueMove::CHASE_SPEED
        @move_frequency = MF_RogueMove::CHASE_FREQUENCY
      else
        @opacity = MF_RogueMove::HIDE_OPACITY
        @move_speed = MF_RogueMove::DEFAULT_SPEED
        @move_frequency = MF_RogueMove::DEFAULT_FREQUENCY
      end
  end
  #--------------------------------------------------------------------------
  # ◎ Alias Update Method
  #--------------------------------------------------------------------------
  alias meowface_rg_update update
  def update
    if @event.name.include?('<enemy>') && !$game_map.interpreter.running?
      chase_player
    end
    meowface_rg_update
  end
end
The code box is messed up
The code box is messed up
Literally one post above you fixed that.
Literally one post above you fixed that.
I know. I would have already deleted the message. But I guess they don't want me to fix my ing mistakes.
I know. I would have already deleted the message. But I guess they don't want me to fix my fricking mistakes.
Of course they don't delete messages. But let's not get salty. Simply making edit and state that you found the fixed ver of the code like putting
EDIT: Nevermind, I found it on the latest post
is fine.
where and how to I download this script I keep selecting the code and clicking "save page as" but it gives me the whole web page. Do i need to copy and paste this into a note++ file
@Fangzarie It looks as if the code got messed up when the forum software changed.
If you are unable to take the code as is (i.e. one huge long line) and make it usable, I suggest you start a thread in RGSS3 Script Requests, give a link to the opening post here and ask if anyone could re-format it for you.
@Fangzarie It looks as if the code got messed up when the forum software changed.
If you are unable to take the code as is (i.e. one huge long line) and make it usable, I suggest you start a thread in RGSS3 Script Requests, give a link to the opening post here and ask if anyone could re-format it for you.
Ah yeah it looks like that's what I'll probably end up doing, especially since the dev doesn't seem to be looking at this particular thread any longer. Thanks for the heads up. I'll try that maybe if I can't find an alternative.
Look 9 posts up above this one. The code was fixed.
Look 9 posts up above this one. The code was fixed.
Ok call me stupid but, I saw that. I also asked how do I copy it down. My question was do I place it in a note++ document?

I am by no means a computer wiz and I don't know how to turn text into a .js file. So I'm kinda stupid in now knowing how to copy it down.
@Fangzarie This is a script for VXAce. You cannot use it in MV, as it's written in a completely different language. (MV uses Javascript, VXAce uses Ruby). I suggest you open a thread in "Plugin Requests" to see if there's anything alike for MV.
@Fangzarie This is a script for VXAce. You cannot use it in MV, as it's written in a completely different language. (MV uses Javascript, VXAce uses Ruby). I suggest you open a thread in "Plugin Requests" to see if there's anything alike for MV.
oh, I thought all the scripts were compatible across versions! Thank you for clearing up that confusion.
Hey, can you help?

#==============================================================================
# ■ Meow Face Rogue Chase System
#------------------------------------------------------------------------------
# Allow event to move only when the player is moving, Chase Mode, Hide Mode etc
#==============================================================================
# How to Use:
# [1] Paste this script below Material and above Main
# [2] Add <enemy> tag in the event's name
# [3] Change the event's movement type to Approach
# [4] Config the script to your likings at the configuration area
# [5] Turn the Switch on for rogue like move, off for normal move in game
# [6] Chase mode is now controlled by a switch as well
#==============================================================================
module MF_RogueMove
#DO NOT REMOVE!
#==============================================================================
# START OF CONFIGURATION
#==============================================================================
SW_ROGUE = 1
#Switch number for turning the rogue move on/off (0 to turn it off)
SW_CHASE = 2
#Switch number for turning the chase mode on/off (0 to turn it off)
DISTANCE = 5
#Distance for chase activation (1-10, 10 is about 640x640 pixels in screen size)
HIDE_OPACITY = 128
#Opacity of the enemy when player is not in range (0-255)
BALLOON = 1
# Pop-up Balloon type (1-10, 0 to turn it Off)
CHASE_SPEED = 4
# Enemy Speed when chasing the player (0-6)
CHASE_FREQUENCY = 6
# Enemy Move Frequency when chasing the player (0-6)
DEFAULT_SPEED = 4
# Enemy Move Speed when not chasing the player (0-6)
DEFAULT_FREQUENCY = 3
# Enemy Move Frequency when not chasing the player (0-6)
#==============================================================================
# END OF CONFIGURATION
# Edit anything pass this line at your own risk!
#==============================================================================
end
#DO NOT REMOVE!
#==============================================================================
class Game_Event < Game_Character
#--------------------------------------------------------------------------
# ◎ Alias Move Type: Move Toward Player
#--------------------------------------------------------------------------
alias meowface_mttp move_type_toward_player def move_type_toward_player if @event.name.include?('<enemy>') && distance_from_player <= MF_RogueMove:😀ISTANCE move_toward_player else meowface_mttp end end
#--------------------------------------------------------------------------
# ◎ Alias update movement
#--------------------------------------------------------------------------
alias meowface_stop update_stop def update_stop if $game_switches[MF_RogueMove::SW_ROGUE] && @event.name.include?('<enemy>') super return update_self_movement if $game_player.moving? else meowface_stop end end
#--------------------------------------------------------------------------
# ○ New method: Get the Distance between Event and Player
#--------------------------------------------------------------------------
def distance_from_player distance_x_from($game_player.x).abs + distance_y_from($game_player.y).ab end
#--------------------------------------------------------------------------
# ○ New method: Start Chasing the Player
#--------------------------------------------------------------------------
def chase_player if distance_from_player <= MF_RogueMove:😀ISTANCE self.balloon_id = MF_RogueMove::BALLOON @opacity = 255 @move_speed = MF_RogueMove::CHASE_SPEED @move_frequency = MF_RogueMove::CHASE_FREQUENCY else @opacity = MF_RogueMove::HIDE_OPACITY @move_speed = MF_RogueMove:😀EFAULT_SPEED @move_frequency = MF_RogueMove:😀EFAULT_FREQUENCY end end
#--------------------------------------------------------------------------
# ◎ Alias Update Method
#--------------------------------------------------------------------------
alias meowface_rg_update update def update if @event.name.include?('<enemy>') && !$game_map.interpreter.running? chase_player if $game_switches[MF_RogueMove::SW_CHASE] end meowface_rg_update end end
I tried to fix the script because of how it was lined up, was it supposed to be on 1 line?
It's not working,will it work if I paste it as is?I feel like you guys have coding experience so you were able to separate it but I wasn't.
I tried to fix the script because of how it was lined up, was it supposed to be on 1 line?
It's not working,will it work if I paste it as is?I feel like you guys have coding experience so you were able to separate it but I wasn't.
The code is already fixed in the post #27
https://forums.rpgmakerweb.com/inde...mode-surprise-attack.44421/page-2#post-554200

Original thread: https://forums.rpgmakerweb.com/threads/rogue-like-movement-chase-mode-surprise-attack.44421/