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,738
Reaction score
8,516
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 Profile Posts

Just released a new trailer for Manafinder! It's the TGS trailer! :D I'm very happy with the result!
sooo... im gonna go ahead and release all my game ideas on android as Beta. Everyone will be nice right? cause its Beta... right?...

AABS traps and heals (detail is below the YTB desc)
 I may actually have something I can put into the Boss Battle Build Bout by the time it’s due. It won’t be anything spectacular (or even great (and maybe not even good (I have no idea how to do combat (yay for nested parentheses)))), but I might have a submission none the less.
Today's my first login since Jan 2020. Time sure flies. Sorry to everyone's messages i missed.

Forum statistics

Threads
115,411
Messages
1,089,658
Members
150,150
Latest member
Moss-eater
Top