kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
572
Reaction score
238
First Language
English
Primarily Uses
RMXP
TouchNewMapEvent VX

by Kyonides Arkanthes

Introduction

Did you ever want that the engine would autorun events right after being touched by the player or another event?
Especially once it finishes transferring the player to a new map...

Now you can do that! Just copy and past the following snippet on your script editor!

Ruby:
# * TouchNewMapEvent VX
#   Scripter : Kyonides Arkanthes
#   2022-09-29

# * Plug & Play Script * #

# This scriptlet allows you to run an event after being transferred to another
# map. It will run even if the trigger were the Player Touch or Event Touch one.

# * Aliased Method: Game_Event#initialize

class Game_Player
  attr_reader :new_x, :new_y
end

class Game_Event
  alias :kyon_touch_new_map_event_init :initialize
  def initialize(map_id, event)
    kyon_touch_new_map_event_init(map_id, event)
    check_shared_location
  end

  def touch_trigger?() [1, 2].include?(@trigger) end
  def player_new_x?() $game_player.new_x == @x end
  def player_new_y?() $game_player.new_y == @y end

  def check_shared_location
    start if touch_trigger? and player_new_x? and player_new_y?
  end
end

Honestly, there are other ways to trigger events without using scripts. Yet, you can still use my scriptlet to make it possible by setting its trigger as Player Touch or Event Touch.

Terms & Conditions

Free as in beer and as in speech.
Please include my nickname in your game credits.
 

Latest Threads

Latest Profile Posts

working on an A/V sync system for my game! was NOT expecting the first roadblock to be accessing a variable from a public class!! Computers are so finicky sometimes :kaosigh:
For the first real time since my game's inception I found myself actually having fun playing around with my party's skills while testing out some battles! So much so, that I actually forgot what I was doing for a minute and had to force myself to move on to the next thing! :guffaw:

That's got to be a good sign considering it only has place holder animations, enemy skills, troop comps, etc. right now. Feels good!
Bex
Finally upgraded to RMMZ.
ScreenShot_11_28_2022_7_52_34.png
FINALLY, I figured out how to get the "tail" to appear IN the window and not directly below it lol. now it looks like it's part of the window and not hanging from the bottom of it.
Twitch! Stream is about to go live with some Dark Souls 2! Feel free to drop by!

Forum statistics

Threads
126,925
Messages
1,182,403
Members
166,757
Latest member
helenbish
Top