KTouchNewMapEvent MV
#1
KTouchNewMapEvent MV

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!


Code:
//==================================
// * KTouchNewMapEventMV.js
//==================================
/*:
* @plugindesc This plugin will be triggered if any given event's coordinates
* match the player's and its trigger is either a Player or Event Touch.
* @author Kyonides Arkanthes
* @help Date: 2023-01-29
*
*/

const KTouchNewMap_event_setupPage = Game_Event.prototype.setupPage;

Game_Player.prototype.newMapX = function() {
  return this._newX;
}

Game_Player.prototype.newMapY = function() {
  return this._newY;
}

Game_Event.prototype.setupPage = function() {
  KTouchNewMap_event_setupPage.call(this);
  this.checkEventTriggerNewMapTouch();
};

Game_Event.prototype.checkEventTriggerNewMapTouch = function() {
  if (this._trigger == 1 || this._trigger == 2) {
    if ($gamePlayer.newMapX() == this.x && $gamePlayer.newMapY() == this.y) {
      this.start();
    }
  }
};

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.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Messages In This Thread
KTouchNewMapEvent MV - by kyonides - 09-01-2024, 10:39 PM



Users browsing this thread: 1 Guest(s)