Script for changing event trigger

I have an event where I want the trigger to temporarily change without using a self switch, so that movement pathing won't get screwed up.
Does anybody know how to do this? I'm very foreign to scripting in general, but I assume that a script would be needed since there's no event command to do this (that I know of).
example:
you have 3 event (id) on map
you want to make id:1 self switch turn ON using script?

can you give the case you want to make
What I want to do is change an event's trigger from "event touch" to "action button" after the event is activated. I want to do this without using a self switch.
this event.. if I leave the map and return.. the event is still work? like before (need action to run the action) or the event still work as before?
Give us more detail case on your problem.. Example
* MC find strange statue
* when he touch.. the statue is alive and tried to hug MC
* MC run outside the room
* when enter again.. MC found, the statue ....(still alive? or on the last place?)
What I want to do is change an event's trigger from "event touch" to "action button" after the event is activated. I want to do this without using a self switch.
via a script, you can use
Code:
$gameMap.event(x)._trigger = y
to do that without activating a different page.
x is the id of the event on the map and y is a number representing the trigger type as they appear in the editor's dropdown starting from 0.
please explain again and with more details what you actually want the player to do - not how you want to enable it.

because your descriptions are not only incomplete but partially wrong - from the limited context you gave I believe you don't want the autonomous movement to reset as it would do with a page change and actually care neither about the self-switch nor the page change.

but there are some more quirks to autonomous movement, and depending on what that event stands for you might have to use a different approachg.
via a script, you can use
Code:
$gameMap.event(x)._trigger = y
to do that without activating a different page.
x is the id of the event on the map and y is a number representing the trigger type as they appear in the editor's dropdown starting from 0.
Thanks, Robro! This works perfectly.

Original thread: https://forums.rpgmakerweb.com/threads/script-for-changing-event-trigger.168597/