Save-Point
KTouchNewMapEvent XP - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: KTouchNewMapEvent XP (/thread-8577.html)



KTouchNewMapEvent XP - kyonides - 09-29-2022

KTouchNewMapEvent XP

by Kyonides


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!


XP Version

Code:
# * KTouchNewMapEvent 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

Notes

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.


RE: TouchNewMapEvent XP + VX + ACE - zlsl - 10-19-2022

I always appreciate you! This is a very handy script. > <
I gave it a low rating because of a miss-click... (I’m terribly sorry...)


RE: KTouchNewMapEvent - kyonides - 01-30-2023

KTouchNewMapEvent Has a New Child! Baby

Yes people, now we also count on a port to MV! Shocked
This brings the total count of scripts to 3 scripts and 1 plugin! Grinning
I've also included a download link on the main post.

@zlsl Who said you couldn't change the rating at any given moment? Thinking