kyonides

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

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 XP
#   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_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_temp.player_new_x == @x end
  def player_new_y?() $game_temp.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 Posts

Latest Profile Posts

KDS
Hey guys! Iam currently updating my free digital art shop , let me know if you need anything done :) https://forums.rpgmakerweb.com/index.php?threads/kds-free-open-digital-art-shop.17097/
Hello! I’d like to ask where is a good place to start logging about my game dev progress as production of my game goes forth
In one of our campus classrooms was a bag full of stuff people forgot there... my bag. That I forgot there xD
You know your room is too tiny for how much stuff you have when it gives you literal insomnia. I just cleared a bunch of stuff out and man it feels good!
1670381555475.png
Meet the Kernel. You encounter him in cyberspace. He's important!

Forum statistics

Threads
127,098
Messages
1,183,961
Members
167,026
Latest member
silverbell
Top