akaneko

Veteran
Veteran
Joined
Jun 28, 2021
Messages
33
Reaction score
11
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
260
Reaction score
380
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

Veteran
Veteran
Joined
Jun 28, 2021
Messages
33
Reaction score
11
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
260
Reaction score
380
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
37,978
Reaction score
10,545
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
45,509
Reaction score
16,405
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

Veteran
Veteran
Joined
Jun 28, 2021
Messages
33
Reaction score
11
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
45,509
Reaction score
16,405
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

Veteran
Veteran
Joined
Jun 28, 2021
Messages
33
Reaction score
11
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
45,509
Reaction score
16,405
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

Veteran
Veteran
Joined
Jun 28, 2021
Messages
33
Reaction score
11
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 Posts

Latest Profile Posts

I've got good news and bad news. The good news is, there aren't any bad news to report. The bad news is, there aren't any good news to report.

Or as others say, yesterday was uneventful.


I am curious that can you "understand/get the point" about what does this place do generally?
(ARPG game)
If anyone knows any C# programmers, please send them my way.
Chilling at night in a tavern.
ChillingAtTavern.png

After 'multiple breakdowns', it's finally over. 10/10 will do this again.
Ever notice that villains can reform and become better people, but heroes can only ever die... or live long enough to see themselves become villains?

Isn't that interesting?

Forum statistics

Threads
129,845
Messages
1,205,663
Members
171,006
Latest member
Joylearning
Top