akaneko

Villager
Member
Joined
Jun 28, 2021
Messages
26
Reaction score
10
First Language
vietnamese
Primarily Uses
RMMV
I want to temporarily disable event triggering, is there a way to do that?
For example the character turns into a ghost, goes everywhere but doesn't event triggering
 
Last edited:

coucassi

Veteran
Veteran
Joined
Sep 23, 2019
Messages
188
Reaction score
289
First Language
German
Primarily Uses
RMMV
In general you can just use a switch as a condition for any event and turn it on and off as you wish. It's a very basic thing, so if this is not what you were talking about, we'd need some more information^^
 

akaneko

Villager
Member
Joined
Jun 28, 2021
Messages
26
Reaction score
10
First Language
vietnamese
Primarily Uses
RMMV
In general you can just use a switch as a condition for any event and turn it on and off as you wish. It's a very basic thing, so if this is not what you were talking about, we'd need some more information^^
I know that way, but it means change all event condition
 

coucassi

Veteran
Veteran
Joined
Sep 23, 2019
Messages
188
Reaction score
289
First Language
German
Primarily Uses
RMMV
Ah okay, the edit does a bit of clarification.
It depends on how the event is triggered: If it's by player touch you can just set your player on through, to not make it trigger. I assume that's what you did in the first place to make them able to go through walls and stuff?

For parallel or automatic events, I don't know of another way than using a switch on every single one of them. Maybe not as a condition for the event pages with the event commands, but on an additional blank page above them, that does nothing and only activates when the ghost switch is turnend on. You'd need to do that for every event individually though.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,307
Reaction score
8,750
First Language
German
Primarily Uses
RMMV
you need to give more info about what exactly you want to do.

unfortunately all possible ways to handle this have their own disadvantages, and we can't guess what would be best for your situation without more info.

for example you can use set move route on player to turn through on for the player - that will disable all contact triggers but also all passability checks and a bit more. It might be what you seem to want, but how does the player turn back without triggering another event?

and so on for other possible solutions and their disadvantages...
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,144
Reaction score
15,535
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Requests. Thank you.



Easiest way I can think of is to get a plugin that allows you to set a switch on when in this "mode", and use that switch to skip all the checkEventTriggerHere, checkEventTriggerThere, and triggerAction functions in Game_Player. I don't have time to write it for you now, but I might be able to later, if nobody else jumps in first.
 

akaneko

Villager
Member
Joined
Jun 28, 2021
Messages
26
Reaction score
10
First Language
vietnamese
Primarily Uses
RMMV
[move]Plugin Requests[/move]

Easiest way I can think of is to get a plugin that allows you to set a switch on when in this "mode", and use that switch to skip all the checkEventTriggerHere, checkEventTriggerThere, and triggerAction functions in Game_Player. I don't have time to write it for you now, but I might be able to later, if nobody else jumps in first.
Thank you, I tried changing the file rpg_objects but it didn't work
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,144
Reaction score
15,535
First Language
English
Primarily Uses
RMMV
If you don't show us what you did, we can't tell you what you did wrong (if anything). Also not a good idea to change those files directly - better to create a plugin. Unlikely to happen now with MV (unless you're using an older version), but if you ever update the editor and update your project to use the latest version of files, you'd lose all your changes.

edit: try this - save as Shaz_MV_DisableEventTrigger.js add to your project and set a switch number (and don't forget to give it a name so you don't accidentally use it for something else)

Code:
//=============================================================================
// Disable Event Trigger
// Shaz_MV_DisableEventTrigger.js
//=============================================================================

/*:
 * @plugindesc Allows a switch to be used to disable interaction between player and events
 * Shaz_MV_DisableEventTrigger.js
 * @author Shaz
 *
 * @help
 *
 * This plugin runs under RPG Maker MV
 *
 * @param Event Disable Switch
 * @desc The switch to turn on when event triggers are to be disabled
 * Default: 0 (don't disable)
 * @default 0
 *
 */

var disableEventSwitch = Number(PluginManager.parameters('Shaz_MV_DisableEventTrigger')['Event Disable Switch'] || 0);

(function() {

    var DET_GameEvent_checkEventTriggerTouch = Game_Event.prototype.checkEventTriggerTouch;
    Game_Event.prototype.checkEventTriggerTouch = function(x, y) {
        if (disableEventSwitch != 0 && $gameSwitches.value(disableEventSwitch)) { 
            return;
        };
        DET_GameEvent_checkEventTriggerTouch.call(this, x, y);
    };

    Game_Player.prototype.canStartLocalEvents = function() {
        if (disableEventSwitch != 0 && $gameSwitches.value(disableEventSwitch)) { 
            return false 
        };
        return !this.isInAirship();
    };

})();


I gave it a switch and turned the switch on, and events with Player Touch, Event Touch and Action Button triggers stopped triggering, but parallel process events continued to run. Then I turned the switch off and they all worked again.

I assume you are not using an event the player has to interact with to tell it to stop disabling the triggers.
 
Last edited:

akaneko

Villager
Member
Joined
Jun 28, 2021
Messages
26
Reaction score
10
First Language
vietnamese
Primarily Uses
RMMV
If you don't show us what you did, we can't tell you what you did wrong (if anything). Also not a good idea to change those files directly - better to create a plugin. Unlikely to happen now with MV (unless you're using an older version), but if you ever update the editor and update your project to use the latest version of files, you'd lose all your changes.
I changed it back like this and turn on the switch 25



Game_Player.prototype.checkEventTriggerHere = function(triggers) {
if (this.canStartLocalEvents()&&!$gameSwitches.value(25)) {
this.startMapEvent(this.x, this.y, triggers, false);
}
};

Game_Player.prototype.checkEventTriggerThere = function(triggers) {
if (this.canStartLocalEvents()) {
var direction = this.direction();
var x1 = this.x;
var y1 = this.y;
var x2 = $gameMap.roundXWithDirection(x1, direction);
var y2 = $gameMap.roundYWithDirection(y1, direction);
this.startMapEvent(x2, y2, triggers, true);
if (!$gameMap.isAnyEventStarting() && $gameMap.isCounter(x2, y2)&&!$gameSwitches.value(25)) {
var x3 = $gameMap.roundXWithDirection(x2, direction);
var y3 = $gameMap.roundYWithDirection(y2, direction);
this.startMapEvent(x3, y3, triggers, true);
}
}
};

Game_Player.prototype.triggerAction = function() {
if (this.canMove()) {
if (this.triggerButtonAction()&&!$gameSwitches.value(25)) {
return true;
}
if (this.triggerTouchAction()&&!$gameSwitches.value(25)) {
return true;
}
}
return false;
};
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,144
Reaction score
15,535
First Language
English
Primarily Uses
RMMV
ah - I edited my post while you posted. Try what I have above.

I realised I could just update canStartLocalEvents as that's called by those other functions. I also had to change Game_Event so it would not trigger Event Touch events.
 

akaneko

Villager
Member
Joined
Jun 28, 2021
Messages
26
Reaction score
10
First Language
vietnamese
Primarily Uses
RMMV
If you don't show us what you did, we can't tell you what you did wrong (if anything). Also not a good idea to change those files directly - better to create a plugin. Unlikely to happen now with MV (unless you're using an older version), but if you ever update the editor and update your project to use the latest version of files, you'd lose all your changes.

edit: try this - save as Shaz_MV_DisableEventTrigger.js add to your project and set a switch number (and don't forget to give it a name so you don't accidentally use it for something else)

Code:
//=============================================================================
// Disable Event Trigger
// Shaz_MV_DisableEventTrigger.js
//=============================================================================

/*:
 * @plugindesc Allows a switch to be used to disable interaction between player and events
 * Shaz_MV_DisableEventTrigger.js
 * @author Shaz
 *
 * @help
 *
 * This plugin runs under RPG Maker MV
 *
 * @param Event Disable Switch
 * @desc The switch to turn on when event triggers are to be disabled
 * Default: 0 (don't disable)
 * @default 0
 *
 */

var disableEventSwitch = Number(PluginManager.parameters('Shaz_MV_DisableEventTrigger')['Event Disable Switch'] || 0);

(function() {

    var DET_GameEvent_checkEventTriggerTouch = Game_Event.prototype.checkEventTriggerTouch;
    Game_Event.prototype.checkEventTriggerTouch = function(x, y) {
        if (disableEventSwitch != 0 && $gameSwitches.value(disableEventSwitch)) {
            return;
        };
        DET_GameEvent_checkEventTriggerTouch.call(this, x, y);
    };

    Game_Player.prototype.canStartLocalEvents = function() {
        if (disableEventSwitch != 0 && $gameSwitches.value(disableEventSwitch)) {
            return false
        };
        return !this.isInAirship();
    };

})();


I gave it a switch and turned the switch on, and events with Player Touch, Event Touch and Action Button triggers stopped triggering, but parallel process events continued to run. Then I turned the switch off and they all worked again.

I assume you are not using an event the player has to interact with to tell it to stop disabling the triggers.
Thank you very much, love you
 

Latest Threads

Latest Profile Posts

I'm just so close to replacing LUK with a different stat, maybe DEX but we'll see.
Slapped together a title screen and working on some dungeon clutter + portraits for Dubhghaill and Einar. Usual CW for minor body horror wrt Einar
QVLJIgD.png

OaPcYUy.png

r55FiUJ.png

EIgO94y.png
cT1V4nb.png
>studying for months for an exam
>does exam
>waits 3 months for the results to come out
>me trying to login, incorrect password
>I get recovery password
>me trying to login, incorrect password

What the heck. As a son of a Karen, I'm going to file a few complaints.
Apparently Amazon Prime users get free Genshin Impact stuff like primogems and whatnot every month, but I'm not sure I ever want to fall into the abyss of F2P ever again.

Forum statistics

Threads
117,149
Messages
1,104,968
Members
153,229
Latest member
jimproringtones
Top