On-Map Enemy Encounter System(Finished!)

Discussion in 'RMVX Ace Tutorials' started by Adon, Jan 29, 2013.

    Tags:
  1. Adon

    Adon ADONKADONK Veteran

    Messages:
    93
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    Enemy Encounter System
    Written By Adon237
    Much Thanks to HK!

      Hello, everyone! I am sure some of you have been hunting for a decent On-Map encounter system, or nearly anything that isn't the random encounters. I don't blame you! Nowadays, random encounters are quite annoying, and really harm the exploration aspect of some games, particularly RPG Maker games, that I have played.
     
      Here for you I have details for an encounter system that can meet the following:
    • Is easy to use
    • Allows for different types of encounters
    • Is easy to expand
    • Respawns encounter events
    Once again, if you do credit anyone for this in your game (that is if you are cool enough to credit), let it be Hanzo Kimura for building the guts of this system. This is literally backwards compatible with RPG Maker VX, so if you are still holding on to VX and have happened to stumble upon this tutorial, you can follow the same steps to get this working!
     
    PART 1:
     
      • Go to the Common Events Tab
     
      • Go to a new common event.
     
      • Name it something similar to ***MONSTER DEFEAT*** There are no triggers.
     
      • In the common event, simply put a SHOW ANIMATION command, which will serve as the animation that plays on the enemy event when it dies. It should be targetted on "This Event".
     
      • Then add a Wait 90 Frames.
     
      • Optional: Add an "After Battle Cleanup Event", to turn off any switches or other stuff you had activated in the battle.
    You need nothing more here, do not worry.
     
    PART 2:
      • In another common event, name it ***RESPAWN FOES***, There are no triggers.
      • In a Set Move Route command, do the following:
     
    This Event (Skip)
    $> Change Opacity: 0
    $> Wait: 1 Frame(s)
    $> Change Opacity: 55
    $> Wait: 1 Frame(s)
    $> Change Opacity: 155
    $> Wait: 1 Frame(s)
    $> Change Opacity: 255
     
     • Then do a Self Switch command turning Self Switch A OFF.
     
    Part 3:
     
     • In your next and final common event, name it ***ESCAPED BATTLE***. There are no triggers.
     
     • Next you must choose a variable you will use as your "Gold Lost" variable. This will be used to calculate how much gold you loose for escaping. Remember, if you do not want this, it is very easy to just clear this common event. (Though it is recommended that you keep the actual event in the same slot, just in case you add something else.)
     
     • In a Control Variable command, set the "Gold Lost" variable to the party's gold amount.
     
     • In a another Control Variable command, multiply the "Gold Lost" variable by the number of party members in your party.
     
     • In a final control variable command, divide the "Gold Lost" variable by 24.
     
     • In a Change Gold command, subtract the gold amount by the "Gold Lost" variable.
     
     • In a message command, type in "You lost \v[Gold Lost Var ID] gold for escaping!".
    If your "Gold Lost" variable has an ID of 1, you type in \v[1]. If it has an ID of 187, you type in \v[187].
     • Next, In a Set Move Route command, do the following:
     
    This Event (Skip)
    $> Change Speed: 5
    $> Move away from Player
    $> Move away from Player
    $> Chage Speed: 3
    Comment: Above: Makes the enemy 'bounce' back two tiles away from the player, so you don't immediately re-encounter them upon escaping. Just add more "Move away from Player" commands if you want the enemy to move back further.
     • In another Set Move Route command, do the following:
     
    Player(Skip, Wait)
    $>SE: "Blow1", 100, 100
    $> Walking Animation OFF
    $> 1 Step Backward
    $> Walking Animation ON
     Comment: Above: The SE play is optional, it is just an escape sound effect of any kind. The player also moves one step back for good measure.
     
    Part 4:
    • Now, the last part, the actual encounter! Now that you have created all of the CEs that the encounter event will use, you can start creating your own encounters!
     
    • I provide TWO tutorials on how to create TWO different types of encounters, Passive and Aggressive encounters.
    [​IMG]
    In Spoiler: The bottom two graphics are the flames I used for Aggressive and Passive encounters respectively.

    Tutorial: Passive Encounter
    • Passive encounters are calm encounters that wander the map, not bothering you. Your presence doesn't disturb them, and they won't get violent unless you try to mess with them (aka pressing X/Enter on them.).
     
    • First, create an event on a map. Find a suitable graphic. I myself used a blue flame to represent these. You can check off whatever options are needed for your graphic, those aren't crucial to the process.
     
    • Set the priority to Same as Characters. You don't want them below or above you unless you are really creative and have devised some pretty cool encounter.  Triggers are an important detail that distinguishes some encounters from each other. Since this encounter is passive, set the trigger to Action Button. This will activate them only when the player tries to interact with them.
     
    • In Autonomous Movement, set the type to Random, the speed to x2 Slower, and Frequency to Lowest.
     
    • Next, in the event's first page, do a Control Variables command, choose a variable to be your Encounter Variable. I will refer to that variable as Variable X from this point forward.
     
    • Under Operation, make sure it is at Set. Under Operand, set that to Random, 1 ~ 100. That will be used to randomly determine which monster troop you will encounter.
     
    • Now, put a Play SE command. This should be like a surprised noise, but really it can be whatever you want.
     
    • Next, do a Show Balloon Icon: This event, Exclamation, Wait command. (If using VX, then put a Wait Command for 35 frames) The player has to have some way of telling what is happening, so what is better than a noise and a balloon icon?
     
    • Now, create a Conditional Branch. Make sure it is set to Variable, the specific variable Variable X, make it less than or equal to, and then choose constant. Set the constant to 50. Then, check the box that says "Set handling when conditions do not apply" or something like that. You will probably do this like 3 more times, so come back here to refer to it when needed.
     
    • Inside the Conditional Branch, but in a Battle Processing command. Choose direct designation, and the monster troop you want to be encountered. Check the "Can Escape" option.
     
    • In the Battle Processing command's Win condition, first put a Call Common Event command, and call the MONSTER DEFEAT common event that you set up earlier.
     
    • After that, Turn that event's Self Switch A to ON.
     
    • In the Escape condition, just call the ESCAPED BATTLE common event you set up.
     
    • In the ELSE part of the Conditional Branch, make another Conditional branch with the same settings we had in the last one, except the constant which will be set to 70 this time. Repeat the steps above after the creation of the conditional branch, with a different monster troop.
     
    • Repeat the above bullet point twice, except you set the constant to 90, and then 100. Once you have 4 conditional branches, you stop. 
     
    • Create a new page in the event. Do not set a graphic. On the page condition, set it to SELF SWITCH A, ON. The options, priority, and autonomous movement are irrelevant to this page. Set the trigger to Parallel Process.
     
    • On the new page, Create two Wait commands, setting each to 999 frames. That seems obnoxious, but it is really appropriate. If you want them to respawn faster, I suggest removing one of the waits. You don't want them to automatically respawn, do you?
     
    • Finally, add a Call Common Event command, the RESPAWN FOES common event.
     
     
    At last, you have crafted a On-Map encounters system, and a passive encounter! Try it out! Remember that you will have to change the troops that are encountered when needed, but that is it! Then you copy-paste them in the locations you want on the map. Good job!
     

     Tutorial: Aggressive Encounter
    • Not much is different as far as event code goes in these than the Passive encounters.
    Copy paste your Passive encounter event and open it up. (This will save time.)
    • Change the graphic to something suitable. (I used a red flame)
    • In Autonomous Movement, set the type to Custom. Then click the "Move Route..." button. 
    • Depending on what you want, you could either have Move at Random, Move toward player, or just Move toward player. Choose one.
    • Set the Speed to x2 Faster, and Frequency to Higher(4).
    • Finally, set the Trigger to Event Touch.
    • These encounters will move towards you, and when they touch you an encounter will start.
    • You can use a script like Yanfly's Event Chase Player to make it more authentic. Just simply put @change_range = 5 or something in the Custom movement along with how you want them to move when they haven't detected the player.
     
    Here is a screenie of how passive encounters look like:
     
     
    [​IMG]
    Stalker Encounters Mini-Tutorial
    Stalker encounters are fairly easy to do.

    1. Copy a passive encounter event.
    2. Above the rest of the event code, add in a comment "<Move_With_Player>" (without the quotation marks)
    3. Set the Trigger to Event Touch.
    4. Add in the following script by BigEd: (below the materials section, it shouldn't cause much incompatibility with other scripts)

    Code:
    #==============================================================================# ** Game_Player#------------------------------------------------------------------------------# This class handles the player. It includes event starting determinants and# map scrolling functions. The instance of this class is referenced by# $game_player.#==============================================================================class Game_Player < Game_Character#--------------------------------------------------------------------------# * Alias Listing#--------------------------------------------------------------------------alias tds_event_move_with_player_game_player_increase_steps increase_steps#--------------------------------------------------------------------------# * Increase Steps#--------------------------------------------------------------------------def increase_steps(*args, &block)# Run Original Methodtds_event_move_with_player_game_player_increase_steps(*args, &block)# If Normal Walkif normal_walk?# Move Events that move with the player$game_map.events.values.select {|e| e.moving_with_player?}.each {|e| e.move_with_player}endendend#==============================================================================# ** Game_Event#------------------------------------------------------------------------------# This class handles events. Functions include event page switching via# condition determinants and running parallel process events. Used within the# Game_Map class.#==============================================================================class Game_Event < Game_Character#--------------------------------------------------------------------------# * Alias Listing#--------------------------------------------------------------------------alias tds_event_move_with_player_game_event_update_self_movement update_self_movementalias tds_event_move_with_player_game_event_clear_page_settings clear_page_settingsalias tds_event_move_with_player_game_event_setup_page_settings setup_page_settings#--------------------------------------------------------------------------# * Determine if Event should move along with player#--------------------------------------------------------------------------def moving_with_player? ; @move_with_player end#--------------------------------------------------------------------------# * Update During Autonomous Movement#--------------------------------------------------------------------------def update_self_movement(*args, &block)# Update Move With Player Movement if Moving with Playerreturn update_move_with_player_movement if moving_with_player?# Run Original Methodtds_event_move_with_player_game_event_update_self_movement(*args, &block)end#--------------------------------------------------------------------------# * Update Move With Player Movement#--------------------------------------------------------------------------def update_move_with_player_movement# Return if Moving orreturn if moving? or @move_with_player_steps <= 0# Decrease Move With Player Steps Counter@move_with_player_steps -= 1# If Move with Player Steps is 0 or lessif @move_with_player_steps <= 0# Set Move With Player Step Wait & Original Step Wait values@move_with_player_step_wait = @original_move_with_player_step_waitend# If Flag to match player speed is trueif @move_with_player_match_speed# Set Move Speed@move_speed = @move_with_player_speed# Adjust Move Speed by Match Offset@move_speed += @move_with_player_match_speed_offsetend# Move in the same direction as the player if mimicking movementreturn move_straight(@move_with_player_direction) if @move_with_player_mimic# Move in the Opposite Direction as the player if Reverse Mimic flag is truereturn move_straight(reverse_dir(@move_with_player_direction)) if @move_with_player_reverse_mimic# Move Type Casecase @move_typewhen 1; move_type_randomwhen 2; move_type_toward_playerwhen 3# Update Move Routeupdate_routine_move# Update Move Route if at Last Command (Prevents stop)update_routine_move if @move_route.list[@move_route_index].code == 0endend#--------------------------------------------------------------------------# * Update During Autonomous Movement#--------------------------------------------------------------------------def move_with_player# Return if Move With Player Step Wait is more than 0return @move_with_player_step_wait -= 1 if @move_with_player_step_wait > 0# Return if moving or Have Steps Remainingreturn if moving? or @move_with_player_steps > 0# Set Move With Player Steps@move_with_player_steps = @original_move_with_player_steps# Set Move with player Direction@move_with_player_direction = $game_player.direction# Set Move With Player Speed@move_with_player_speed = $game_player.real_move_speedend#--------------------------------------------------------------------------# * Clear Event Page Settings#--------------------------------------------------------------------------def clear_page_settings(*args, &block)# Run Original Methodtds_event_move_with_player_game_event_clear_page_settings(*args, &block)# Clear Move With Player Page Settingsclear_move_with_player_page_settingsend#--------------------------------------------------------------------------# * Clear Event Page Move with Player Settings#--------------------------------------------------------------------------def clear_move_with_player_page_settings# Move with Player Flag@move_with_player = false# # Move With Player Speed Match Flag & Offset@move_with_player_match_speed = false ; @move_with_player_match_speed_offset = 0# Move With Player Mimic Flags@move_with_player_mimic = false ; @move_with_player_reverse_mimic = false# Move With Player Step & Original Step values@move_with_player_steps = @original_move_with_player_steps = 0# Move With Player Step Wait & Original Step Wait values@move_with_player_step_wait = @original_move_with_player_step_wait = 0end#--------------------------------------------------------------------------# * Set Up Event Page Settings#--------------------------------------------------------------------------def setup_page_settings(*args, &block)# Run Original Methodtds_event_move_with_player_game_event_setup_page_settings(*args, &block)# Setup Page Move With Player Settingssetup_page_move_with_player_settingsend#--------------------------------------------------------------------------# * Set Up Event Page Move With Player Settings#--------------------------------------------------------------------------def setup_page_move_with_player_settings# Clear Move With Player Page Settingsclear_move_with_player_page_settings# Get All Page Comment Textcomment_text = @list.select {|c| [108, 408].include? (c.code)}.collect {|c| c.parameters}.join# Return if Comment Text is emptyreturn if comment_text.empty?# Set Move With Player Flag to true if Text Flag exist@move_with_player = true if comment_text =~ /<Move_With_Player>/i# Match Comment Text for Amount of Move Stepscomment_text[/<Move_With_Player_Steps: (\d+)>/i]@original_move_with_player_steps = $1.nil? ? 1 : $1.to_i# Set Move With Player Match Speed Flag to true if Text Flag exists@move_with_player_match_speed = true if comment_text =~ /<Match_Player_Speed>/i# Match Comment Text for Match Speed Offsetcomment_text[/<Match_Player_Speed_Offset: (-?\d+)>/i]@move_with_player_match_speed_offset = $1.nil? ? 0 : $1.to_i# Set Move with Player Mimic Flag to true if Text Flag exist@move_with_player_mimic = true if comment_text =~ /<Mimic_Player_Move>/i# Set Move with Player Reverse Mimic Flag to true if Text Flag exist@move_with_player_reverse_mimic = true if comment_text =~ /<Reverse_Mimic_Player_Move>/i# Match Comment Text for Step Wait Valuescomment_text[/<Player_Move_Step_Wait: (\d+)>/i]@move_with_player_step_wait = @original_move_with_player_step_wait = $1.nil? ? 0 : $1.to_iendend
    Voila! You are done!
    Please note that there are other functions of that script that can be utilized by comment calls.
    (Also please let me know if the script is improperly credited)


    Other Potential Encounter Types:
     
    • Stalking encounter (they make a move towards you every time you move)(think lufia)
    • Evasive encounter (they run away from player, may have rare encounter)
    • Curious encounter (a mix of passive and aggressive. they follow you, but you  have to press X to battle)
    • Aerial encounter (encounters that fly above the players head, experimental)
     
    If you want a tutorial on how to do any of those, just ask! I have them in my game and am willing to share!
     
    Last edited by a moderator: Jul 28, 2013
    #1
  2. StarkinGyra

    StarkinGyra Adventurer Member

    Messages:
    219
    Likes Received:
    9
    Location:
    Portland, OR
    First Language:
    English
    Oh sweet, I am going to have to try this out. I have been dreading random encounters and it has stalled me moving forward on my game. Thanks. :rock-left:   :guffaw:   :rock-right:
     
    #2
  3. Adon

    Adon ADONKADONK Veteran

    Messages:
    93
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    nevermind, it's finished
     
    Last edited by a moderator: Jun 12, 2013
    #3
  4. StarkinGyra

    StarkinGyra Adventurer Member

    Messages:
    219
    Likes Received:
    9
    Location:
    Portland, OR
    First Language:
    English
    They normally dont remove posts. I can wait until it is finished to try it out. How long do you think it will be?
     
    #4
  5. Soma

    Soma Princess' Guard Veteran

    Messages:
    195
    Likes Received:
    37
    Location:
    Country of Vranas
    First Language:
    Chopnese
    Will you be putting up the rest of the tutorial soon, Adon?  BD
     
    #5
  6. Adon

    Adon ADONKADONK Veteran

    Messages:
    93
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    Okay everyone, I finished it! It only took me about half an hour! (too bad i finished it like 6 months later)
     
    #6
  7. Aceri

    Aceri Author Veteran

    Messages:
    431
    Likes Received:
    79
    Location:
    Bullhead City, Arizona
    First Language:
    English
    I don't mean to rain on your parade as I haven't really read this all the way through, just your description on what it does and step one, but can't you do the same thing more simply by making a monster graphic event on the map, adding a battle processing event inside that, then have it erase the event once the battle is finished?
     
    #7
  8. Adon

    Adon ADONKADONK Veteran

    Messages:
    93
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    Most definitely! This is just putting some of the important events on a more global scale so you can make edits on how things work without having to modify every map event. This eliminates some of the hassle when you change things, so if you were to modify the common events, you wouldn't have to mess with every encounter that you have made. There are plenty of different methods of doing this, and if you have a way you find better, more practical, or e-peen boosting, then go ahead!

    Glad you found a different way though.
     
    #8
  9. Aceri

    Aceri Author Veteran

    Messages:
    431
    Likes Received:
    79
    Location:
    Bullhead City, Arizona
    First Language:
    English
    I'm sorry if I came off as elitist or rude in my previous post, as that was not my intention. After re-reading what I said I guess, "Don't mean to rain on your parade" could have been worded differently, and for that I apologize, and I am in no way trying to belittle your work, I was just curious what made your on-map event system different than say the conventional means.

    Once again, I apologize for any offenses I may have given you as they were not my intention, just a really poorly worded post. (Thanks, medicine! haha.)
     
    #9
  10. Adon

    Adon ADONKADONK Veteran

    Messages:
    93
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    what?

    no i am not offended, i am being literal when i say there are plenty of alternate methods of doing something just like this, and some are more ambitious than others

    anyway, is anyone having any problems with this?
     
    #10
  11. Redweaver

    Redweaver Veteran Veteran

    Messages:
    117
    Likes Received:
    41
    First Language:
    English
    OMG!  I'm so glad I stumbled across this.  Its exactly the sort of thing I've been trying to figure out.  What I came up with was much, much more complicated and had the downside of using an unbelievable number of variables...every encounter used two unique one for the x and y coordinates.

    Clean.  Elegant.  Brilliant.

    I do video tutorials, and I'm currently working on a series where I'm making a complete game.  With your permission, I'd very much like to include this in my next video.  I'll give credit and include a link to this thread.

    Thank you.
     
    #11
  12. Adon

    Adon ADONKADONK Veteran

    Messages:
    93
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    Hey!

    I am glad you like it, and yes, it is pretty simple!

    Sure thing, you can include it in your video, I will be happy to watch it!
     
    #12
  13. Redweaver

    Redweaver Veteran Veteran

    Messages:
    117
    Likes Received:
    41
    First Language:
    English
    The thread for my tutorial town series if you hadn't found it yet.

    http://forums.rpgmakerweb.com/index.php?/topic/13920-tutorial-town/

    I'll be recording the next episode sometime in the next couple days so it will be ready for Friday release.  That'll be the one where I implement this...I was holding off til I heard from you.  Thanks!

    I also made a video explaining the method I was using before.  It works, and may still have it's uses (I tweaked it to make a save point...and I think I could use it to make a kids-playing-Tag minigame), but was a bit unruly.
     
    Last edited by a moderator: Jun 25, 2013
    #13
  14. WolfGan

    WolfGan Warper Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    English
    Can  you tell me how to make stalkers???

    Thanks in adv :)
     
    #14
  15. Adon

    Adon ADONKADONK Veteran

    Messages:
    93
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    Stalker Encounters Mini-Tutorial

    Stalker encounters are fairly easy to do.

    1. Copy a passive encounter event.

    2. Above the rest of the event code, add in a comment "<Move_With_Player>" (without the quotation marks)

    3. Set the Trigger  to Event Touch.

    4. Add in the following script by BigEd: (below the materials section, it shouldn't cause much incompatibility with other scripts)

    #==============================================================================# ** Game_Player#------------------------------------------------------------------------------# This class handles the player. It includes event starting determinants and# map scrolling functions. The instance of this class is referenced by# $game_player.#==============================================================================class Game_Player < Game_Character#--------------------------------------------------------------------------# * Alias Listing#--------------------------------------------------------------------------alias tds_event_move_with_player_game_player_increase_steps increase_steps#--------------------------------------------------------------------------# * Increase Steps#--------------------------------------------------------------------------def increase_steps(*args, &block)# Run Original Methodtds_event_move_with_player_game_player_increase_steps(*args, &block)# If Normal Walkif normal_walk?# Move Events that move with the player$game_map.events.values.select {|e| e.moving_with_player?}.each {|e| e.move_with_player}endendend#==============================================================================# ** Game_Event#------------------------------------------------------------------------------# This class handles events. Functions include event page switching via# condition determinants and running parallel process events. Used within the# Game_Map class.#==============================================================================class Game_Event < Game_Character#--------------------------------------------------------------------------# * Alias Listing#--------------------------------------------------------------------------alias tds_event_move_with_player_game_event_update_self_movement update_self_movementalias tds_event_move_with_player_game_event_clear_page_settings clear_page_settingsalias tds_event_move_with_player_game_event_setup_page_settings setup_page_settings#--------------------------------------------------------------------------# * Determine if Event should move along with player#--------------------------------------------------------------------------def moving_with_player? ; @move_with_player end#--------------------------------------------------------------------------# * Update During Autonomous Movement#--------------------------------------------------------------------------def update_self_movement(*args, &block)# Update Move With Player Movement if Moving with Playerreturn update_move_with_player_movement if moving_with_player?# Run Original Methodtds_event_move_with_player_game_event_update_self_movement(*args, &block)end#--------------------------------------------------------------------------# * Update Move With Player Movement#--------------------------------------------------------------------------def update_move_with_player_movement# Return if Moving orreturn if moving? or @move_with_player_steps <= 0# Decrease Move With Player Steps Counter@move_with_player_steps -= 1# If Move with Player Steps is 0 or lessif @move_with_player_steps <= 0# Set Move With Player Step Wait & Original Step Wait values@move_with_player_step_wait = @original_move_with_player_step_waitend# If Flag to match player speed is trueif @move_with_player_match_speed# Set Move Speed@move_speed = @move_with_player_speed# Adjust Move Speed by Match Offset@move_speed += @move_with_player_match_speed_offsetend# Move in the same direction as the player if mimicking movementreturn move_straight(@move_with_player_direction) if @move_with_player_mimic# Move in the Opposite Direction as the player if Reverse Mimic flag is truereturn move_straight(reverse_dir(@move_with_player_direction)) if @move_with_player_reverse_mimic# Move Type Casecase @move_typewhen 1; move_type_randomwhen 2; move_type_toward_playerwhen 3# Update Move Routeupdate_routine_move# Update Move Route if at Last Command (Prevents stop)update_routine_move if @move_route.list[@move_route_index].code == 0endend#--------------------------------------------------------------------------# * Update During Autonomous Movement#--------------------------------------------------------------------------def move_with_player# Return if Move With Player Step Wait is more than 0return @move_with_player_step_wait -= 1 if @move_with_player_step_wait > 0# Return if moving or Have Steps Remainingreturn if moving? or @move_with_player_steps > 0# Set Move With Player Steps@move_with_player_steps = @original_move_with_player_steps# Set Move with player Direction@move_with_player_direction = $game_player.direction# Set Move With Player Speed@move_with_player_speed = $game_player.real_move_speedend#--------------------------------------------------------------------------# * Clear Event Page Settings#--------------------------------------------------------------------------def clear_page_settings(*args, &block)# Run Original Methodtds_event_move_with_player_game_event_clear_page_settings(*args, &block)# Clear Move With Player Page Settingsclear_move_with_player_page_settingsend#--------------------------------------------------------------------------# * Clear Event Page Move with Player Settings#--------------------------------------------------------------------------def clear_move_with_player_page_settings# Move with Player Flag@move_with_player = false# # Move With Player Speed Match Flag & Offset@move_with_player_match_speed = false ; @move_with_player_match_speed_offset = 0# Move With Player Mimic Flags@move_with_player_mimic = false ; @move_with_player_reverse_mimic = false# Move With Player Step & Original Step values@move_with_player_steps = @original_move_with_player_steps = 0# Move With Player Step Wait & Original Step Wait values@move_with_player_step_wait = @original_move_with_player_step_wait = 0end#--------------------------------------------------------------------------# * Set Up Event Page Settings#--------------------------------------------------------------------------def setup_page_settings(*args, &block)# Run Original Methodtds_event_move_with_player_game_event_setup_page_settings(*args, &block)# Setup Page Move With Player Settingssetup_page_move_with_player_settingsend#--------------------------------------------------------------------------# * Set Up Event Page Move With Player Settings#--------------------------------------------------------------------------def setup_page_move_with_player_settings# Clear Move With Player Page Settingsclear_move_with_player_page_settings# Get All Page Comment Textcomment_text = @list.select {|c| [108, 408].include? (c.code)}.collect {|c| c.parameters}.join# Return if Comment Text is emptyreturn if comment_text.empty?# Set Move With Player Flag to true if Text Flag exist@move_with_player = true if comment_text =~ /<Move_With_Player>/i# Match Comment Text for Amount of Move Stepscomment_text[/<Move_With_Player_Steps: (\d+)>/i]@original_move_with_player_steps = $1.nil? ? 1 : $1.to_i# Set Move With Player Match Speed Flag to true if Text Flag exists@move_with_player_match_speed = true if comment_text =~ /<Match_Player_Speed>/i# Match Comment Text for Match Speed Offsetcomment_text[/<Match_Player_Speed_Offset: (-?\d+)>/i]@move_with_player_match_speed_offset = $1.nil? ? 0 : $1.to_i# Set Move with Player Mimic Flag to true if Text Flag exist@move_with_player_mimic = true if comment_text =~ /<Mimic_Player_Move>/i# Set Move with Player Reverse Mimic Flag to true if Text Flag exist@move_with_player_reverse_mimic = true if comment_text =~ /<Reverse_Mimic_Player_Move>/i# Match Comment Text for Step Wait Valuescomment_text[/<Player_Move_Step_Wait: (\d+)>/i]@move_with_player_step_wait = @original_move_with_player_step_wait = $1.nil? ? 0 : $1.to_iendend 
    Voila! You are done!

    Please note that there are other functions of that script that can be utilized by comment calls.

    (Also please let me know if the script is improperly credited)
     
    #15
    WolfGan likes this.
  16. PrinnyLink

    PrinnyLink The prinny Member

    Messages:
    18
    Likes Received:
    2
    Location:
    Hannover
    First Language:
    English
    This, is  great  i will use thing in my mini game  and ill make sure to  cerdit you in the  credits  ;D this perfect i was  need some thing to work with for my game ,  so many  thanks to you and your great work,
     
    Last edited by a moderator: Nov 28, 2013
    #16
  17. ShinGamix

    ShinGamix DS Style 4Ever! Veteran

    Messages:
    3,906
    Likes Received:
    437
    Location:
    Alien Ship
    First Language:
    April Fools
    Primarily Uses:
    N/A
    I was working on rebuilding the HK Encounter System for my game and was thinking of using proximity events script to do it but I am glad I found this!!!

    Hanzo's stuff was always the best.

    *I wish there was a demo with this.
     
    Last edited by a moderator: Nov 30, 2013
    #17
  18. drgnkpr313

    drgnkpr313 Warper Member

    Messages:
    3
    Likes Received:
    1
    Hey, is there any way to make the monster re spawn after you leave the area and come back of that happens before the respawn time? like i want to have the respawn time exist for if the player is still on that map, but if i leave and come back before the time repawn time is up, override that and respawn anyway?
     
    #18
  19. Saltwater Croc

    Saltwater Croc Voice Actor/Frelance Composer Veteran

    Messages:
    4,851
    Likes Received:
    1,400
    Location:
    My Imagination
    First Language:
    Hylian
    Primarily Uses:
    RMVXA
    Dude.  This is so friggin' awesome. You rock. Thanks!
     
    Last edited by a moderator: Mar 30, 2014
    #19
    Adon likes this.
  20. Adon

    Adon ADONKADONK Veteran

    Messages:
    93
    Likes Received:
    14
    Location:
    Michigan
    First Language:
    English
    No problem! Glad you got whatever was wrong fixed up.
     
    #20

Share This Page