Player Touch event not triggering when player is transferred

BookishNerDan

Veteran
Veteran
Joined
Dec 22, 2022
Messages
34
Reaction score
5
First Language
English
Primarily Uses
RMMV
I'm am sorry if this is a really noob question.

I have an event that transfers a player to a tile on a new map that has a Player Touch event on it. Right now the event is just a text box with one line of dialogue in it, nothing else. But when the player transfers there it doesn't trigger. I have to manually walk the player off the tile then back to it before it will trigger.

How do I get an event to trigger when a player transfers to that tile?

I searched the forums and reddit and steam and some of the advice says to just have the player transfer to a tile that doesn't have the event on it, but that won't work for me since I have a character opening a door > transferring to a new map > then being surprised by something right away when they make the transfer (which is just a simple text box at the moment).

I also tried doing this on the same map thinking it was something to do with changing maps but it's the same issue, the event won't trigger.

Thanks, everyone!
 

SGHarlekin

Orc Jester
Veteran
Joined
Jun 29, 2020
Messages
958
Reaction score
1,079
First Language
German
Primarily Uses
RMMV
You don't need the event to run on player touch. Just make it autorun. It'll run as soon as the player loads on the map, no matter where it is.
(Just don't forget to use a self switch and a second event page that has the self switch as condition and is blank at the end to avoid it running on a loop.)
 

BookishNerDan

Veteran
Veteran
Joined
Dec 22, 2022
Messages
34
Reaction score
5
First Language
English
Primarily Uses
RMMV
That does solve it, though is there a way to do this without using the autorun (and then a self switch)?

I was simply debugging a map when I came across this issue and didn't think to go into all the details of what I need that event to do since I (incorrectly) assumed it wasn't important. Sorry about that, that was totally my fault.

My full idea is that when the player enters the room there might be a treasure there, or a random battle, or a few other events that might happen. I say might because it's random if the player is standing on that tile. But if a player transfers onto the tile and nothing happens than they'll assume that tile has nothing going on when, in fact, they'd have to go back to it to check again. I was hoping to prevent that.

Again, sorry for me not being clear, that was my mistake.
 

ScytherZ

Villager
Member
Joined
Feb 24, 2020
Messages
13
Reaction score
2
First Language
Turkish
Primarily Uses
RMMV
I think I did your wish.resim_2023-01-29_111545183.pngresim_2023-01-29_111603218.png
Top left event is empty. You shouldn't care about
resim_2023-01-29_111720967.png
 

SGHarlekin

Orc Jester
Veteran
Joined
Jun 29, 2020
Messages
958
Reaction score
1,079
First Language
German
Primarily Uses
RMMV
You can not have an event run on touch when you transfer the player directly onto it. If you have a situation where the player can play through the map multiple times, you can just use "erase event" at the end. It will then reset if the player enters the map again.

As you can see above, you can use variables to make random things happen within an event.

Hope that helps.
 
  • Like
Reactions: Bex

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
7,256
Reaction score
2,874
First Language
Dutch
Primarily Uses
RMMV
transfer and event touch dont work directly (unless a plugin handles that.)
you can however set a parallel after transfer that is triggered if you want
to battle directly or set a enemy in front that walks to it to start a battle.

there are serveral works around how you can start a battle, but I dont
think to do an erase event if you go inside which will always be triggered
upon entering. (which can be really annoying).
 
  • Like
Reactions: Bex

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,909
Reaction score
732
First Language
German
Primarily Uses
RMMZ
Here is a Workaround Idea...

The Scriptcall List got a Codeline to Activate Eventpages like if the Player touched it or pressed a Button.


A Parallel Event that runs one time everytime you enter the map, it checks if a Event is on the Maptile the Player is standing on, if yes the Codeline will activate the specific Event Id.
eventtrigger_samplehelp49665554.png
 

BookishNerDan

Veteran
Veteran
Joined
Dec 22, 2022
Messages
34
Reaction score
5
First Language
English
Primarily Uses
RMMV
Here is a Workaround Idea...

The Scriptcall List got a Codeline to Activate Eventpages like if the Player touched it or pressed a Button.


A Parallel Event that runs one time everytime you enter the map, it checks if a Event is on the Maptile the Player is standing on, if yes the Codeline will activate the specific Event Id.
View attachment 251843

Thank you, that worked perfectly!
 

BookishNerDan

Veteran
Veteran
Joined
Dec 22, 2022
Messages
34
Reaction score
5
First Language
English
Primarily Uses
RMMV
Here is a Workaround Idea...

The Scriptcall List got a Codeline to Activate Eventpages like if the Player touched it or pressed a Button.


A Parallel Event that runs one time everytime you enter the map, it checks if a Event is on the Maptile the Player is standing on, if yes the Codeline will activate the specific Event Id.
View attachment 251843

I discovered something weird about this just now, however.

I'm running a common event that if the player presses the SHIFT key it displays some text (right now it just returns a variable). But for some reason the game no longer recognizes that the SHIFT key is being pressed. When I delete your solution however, everything works fine.

Why would your solution cause the game to stop recognizing that the SHIFT key is being pressed? I tried changing which key is pressed but that didn't change anything.
 

BookishNerDan

Veteran
Veteran
Joined
Dec 22, 2022
Messages
34
Reaction score
5
First Language
English
Primarily Uses
RMMV
EDIT - I figured it out, I was transferring the player to the wrong tile thus the script never erased itself.
 
  • Like
Reactions: Bex

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
884
Reaction score
425
First Language
English
Primarily Uses
RMXP
Just in case, you can use my plugin to do it automatically without caring about conditions other than Player Touch or Event Touch.

JavaScript:
//==================================
// * 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();
    }
  }
};
 

Latest Threads

Latest Posts

Latest Profile Posts

My mom showed up yesterday and I wanted to proudly show off my comic con web page. So of course, it no longer existed. I guess when the 4 day event was over they removed it.
Feeling like a creative Pattato this morning...
Calibrating the timing of dialogue is deffo my new least favorite thing.
I died aged 27 to cancer. Then I was reborn in a South-American state. I retained all memories and skill and had a goal from my previous life I needed to finish, but now I was just a 1-year-old girl capable of only smiling at others.

Dreams like this one make me glad I'm able to wake up from them at will.
Found a critical bug the other day with the time system that would have caused none of the NPCs to spawn. Since I use dev mode to test time-based stuff, I didn't catch this for way too long!

Forum statistics

Threads
129,979
Messages
1,206,686
Members
171,205
Latest member
CuriousMonkeyX
Top