Is there a way to prevent Below Player events that trigger on Player Touch from being activated with the action button from an adjacent square?

Dreigonix

Villager
Member
Joined
Sep 28, 2021
Messages
23
Reaction score
5
First Language
English
Primarily Uses
RMMV
As it is now, it's possible for certain triggers to be activated when the player is in a square they're not supposed to be in, which screws up the game.
 

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
1,367
Reaction score
970
First Language
Javascript
Primarily Uses
RMMZ
As it is now, it's possible for certain triggers to be activated when the player is in a square they're not supposed to be in, which screws up the game.

Hmm... I can't replicate what your talking about, for me player touch & below only events only activate when the player steps on them.. which is how it should be

...for me pressing the action button doesn't do anything on the square or on adjacent squares

Can you share screenshots or video?
 

Dreigonix

Villager
Member
Joined
Sep 28, 2021
Messages
23
Reaction score
5
First Language
English
Primarily Uses
RMMV
Hmm... I can't replicate what your talking about, for me player touch & below only events only activate when the player steps on them.. which is how it should be

...for me pressing the action button doesn't do anything on the square or on adjacent squares

Can you share screenshots or video?
1674969581275.pngThis is where it's supposed to take place. The invisible trigger is right where I'm standing. But:
1674969634823.pngI just activated it from a square away.
1674969677175.png
This is what it looks like in the editor...
1674969708799.png
And this is the event itself.
 

asuran20

Veteran
Veteran
Joined
Dec 22, 2022
Messages
59
Reaction score
46
First Language
Portuguese
Primarily Uses
RMMZ
View attachment 251809This is where it's supposed to take place. The invisible trigger is right where I'm standing. But:
View attachment 251810I just activated it from a square away.
View attachment 251811
This is what it looks like in the editor...
View attachment 251812
And this is the event itself.
I don't see anything wrong with the events themselves. Maybe your tileset is the problem? See if the tile you are using is marked as a "counter" in the database. This would explain why you can activate it with the action button.

If that isn't the problem, try setting it to "event touch" if it doesn't work, then maybe some other event is interfering with this one and changing its location.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,909
Reaction score
732
First Language
German
Primarily Uses
RMMZ
What is on Eventpage 2?
Highest Eventpage Number fulfilling its Page Conditions is getting used as active Eventpage.
So i guess the wrong Eventpage is maybe active and got the wrong settings?
 
Last edited:

ScytherZ

Villager
Member
Joined
Feb 24, 2020
Messages
13
Reaction score
2
First Language
Turkish
Primarily Uses
RMMV
Ekran görüntüsü 2023-01-29 113854.png
you can try to change this.
1674981740076.png

hope I have understood
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,909
Reaction score
732
First Language
German
Primarily Uses
RMMZ
Ok no Page Condition on Page 2, that means Page 1 will never run once in your Game.
But Page 2 will always be the one used in case the Event is somehow triggered.

Please Post pictures of the whole Eventpage, i wanted to see if Page 2 is on "Same as Characters".
That would explain why it triggers from the tile next to it and you would just need to change it to "below characters"
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
884
Reaction score
425
First Language
English
Primarily Uses
RMXP
Warning!

I don't need the following plugin to make it work normally.
Check any nearby events that might be triggering the event at the wrong moment.

I'm not used to depend on eventing to solve issues so I came up with this little fix for your issue.
Please read the instructions to learn about the script calls so you can use them in a conditional branch as a script condition.

JavaScript:
//=============================
// KTouch4SameXY.js
//=============================
/*:
 * @plugindesc Check if current event's coordinates are the same as the player's.
 * @author Kyonides Arkanthes
 * @help Date: 2023-01-29
 * This plugin prevents the Player Touch trigger from executing if the player
 * is still 1 tile away from a given event.
 *
 * Script Calls:
 *
 * this.SameXYCoords()
 * this.NotSameXYCoords()
 */
//=============================

Game_Interpreter.prototype.SameXYCoords = function() {
  let eventID = this.eventId();
  let event = $gameMap.event(eventID);
  return event.x == $gamePlayer.x && event.y == $gamePlayer.y;
};

Game_Interpreter.prototype.NotSameXYCoords = function() {
  return !this.SameXYCoords();
};
 
Last edited:

Dreigonix

Villager
Member
Joined
Sep 28, 2021
Messages
23
Reaction score
5
First Language
English
Primarily Uses
RMMV
Warning!

I don't need the following plugin to make it work normally.
Check any nearby events that might be triggering the event at the wrong moment.

I'm not used to depend on eventing to solve issues so I came up with this little fix for your issue.
Please read the instructions to learn about the script calls so you can use them in a conditional branch as a script condition.

JavaScript:
//=============================
// KTouch4SameXY.js
//=============================
/*:
 * @plugindesc Check if current event's coordinates are the same as the player's.
 * @author Kyonides Arkanthes
 * @help Date: 2023-01-29
 * This plugin prevents the Player Touch trigger from executing if the player
 * is still 1 tile away from a given event.
 *
 * Script Calls:
 *
 * this.SameXYCoords()
 * this.NotSameXYCoords()
 */
//=============================

Game_Interpreter.prototype.SameXYCoords = function() {
  let eventID = this.eventId();
  let event = $gameMap.event(eventID);
  return event.x == $gamePlayer.x && event.y == $gamePlayer.y;
};

Game_Interpreter.prototype.NotSameXYCoords = function() {
  return !this.SameXYCoords();
};
It works! Thanks! Now to run through every step-on event in the game and add this... but it'll be worth it. ^__^;
 

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