Is there a script/way to turn off a specific SelfSwitch [D] in the entire game?

MipHire

Warper
Member
Joined
Aug 4, 2021
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMZ
So i know that there are scrpits that do that. Its not like i tried to search for it on the internet. But i am a BIG BIG DUMB.

And even something easy like this $gameSelfSwitches.setValue([mapId, eventID, 'A'], true) Is to Complex for me.

All i want is to be able to turn off Self-Switch D on all "Events" across all the "Maps" at once.\

Essentially i want to re-spawn enemies Dark Souls Style after "Praying" at the bonfire.

Thanks for help in advance.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,676
Reaction score
8,490
First Language
German
Primarily Uses
RMMV
you need to do a loop to switch off every single switch 'D', there is no shortcut for this as each command can only handle a single switch.
and then you have the problem that different maps have a different number of events, so some of those switches from a loop will not exist.


It can be done this way, but I think it will be better if you do it by events, although that has oother problems.

you'll need one general switch for each map.
for each event you want to respawn, you'll add a new highest page conditioned to that specific switch. That page needs to be on parallel process and needs to reset the event itself, followed by a wait(2).
and then you add a new event to the map on parallel process with a wait(2) as first command, a switch off of the map switch as second and erase event as a third command.
at the bonfire you simply turn ON the general switch for all maps that you want to reset.

when you next enter that map the switch is still on, forcing all events to go to their reset page and reset, while the new map event does nothing due to the wait.
next frame all the events are reset and the new event turns off the reset-switch for this map, preventing a repeat of the resets - that is why you need one switch per map, or the switch would only affect the first map it is used on.
 

MipHire

Warper
Member
Joined
Aug 4, 2021
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Thank u, altho, I found a batter version. topic Closed ;)
I would turn on a self switch instead of using erase event. Create a new page conditioned by that self switch.

Then create another new page AFTER that, conditioned by a switch - use the same switch for EVERY enemy, if you want them ALL to respawn at the same time. This page should be set to Parallel Process, and the only event command should be to turn the self switch off again.

Have an event on the campfire, or wherever you "rest" that simply turns that switch on, waits 60 frames, then turns the switch off again.

So when you trigger that event, the switch gets turned on, all enemy events that previously had been defeated and their self switch turned on will activate and turn the self switch off, and when you turn the main switch off, they'll go back to their original pages with the enemy sprite moving towards the player.

Or you could simply have your campfire event run a loop that goes through the enemy event ids, and uses the Outer Self Switch plugin from the JP team to turn those self switches off again, which means you don't need the global switch or the extra event page on all of them.



you need to do a loop to switch off every single switch 'D', there is no shortcut for this as each command can only handle a single switch.
and then you have the problem that different maps have a different number of events, so some of those switches from a loop will not exist.


It can be done this way, but I think it will be better if you do it by events, although that has oother problems.

you'll need one general switch for each map.
for each event you want to respawn, you'll add a new highest page conditioned to that specific switch. That page needs to be on parallel process and needs to reset the event itself, followed by a wait(2).
and then you add a new event to the map on parallel process with a wait(2) as first command, a switch off of the map switch as second and erase event as a third command.
at the bonfire you simply turn ON the general switch for all maps that you want to reset.

when you next enter that map the switch is still on, forcing all events to go to their reset page and reset, while the new map event does nothing due to the wait.
next frame all the events are reset and the new event turns off the reset-switch for this map, preventing a repeat of the resets - that is why you need one switch per map, or the switch would only affect the first map it is used on.
 

HarlekinLehl

Veteran
Veteran
Joined
Jun 29, 2020
Messages
209
Reaction score
97
First Language
German
Primarily Uses
RMMV
Sorry, wanted to edit. Must have accidentally made a new post.
 

Latest Threads

Latest Posts

Latest Profile Posts

One day, I'll not have this lingering cough and we'll have another make a game stream.
A music I create while practicing E Major scale. :D
Too bad the Boss Battle Build Bout isn't also for VXAce.
I might not participate in the Boss Battle contest after all... I have more important things to do, like Wishful Wanda. And of course the Dark Deception spinoff I plan to pitch, Demon Slayer.

Forum statistics

Threads
115,177
Messages
1,087,870
Members
149,744
Latest member
ThePyroMan8
Top