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
34,357
Reaction score
8,771
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
238
Reaction score
131
First Language
German
Primarily Uses
RMMV
Sorry, wanted to edit. Must have accidentally made a new post.
 

Latest Threads

Latest Posts

Latest Profile Posts

Here's a medical question for ya: Why do I start lightly coughing after I drink coffee?
Well, someone "reviewed" my game. Didn't credit me anywhere in the video and spent 2 minutes insulting it. Going to ignore that and move on.
To cut down on map lag, I've been researching how to implement a lighting layer as a single map overlay instead of a bunch of individual lights. Hopefully I'll have a screenshot soon!
Imagine having a game broken up into a whole bunch of chapters? Like Chapter 11 should be about the party members going bankrupt.
Over 1/4th of the calendars are already out :eek: Have you already put something to a good use?

Forum statistics

Threads
117,263
Messages
1,105,937
Members
153,436
Latest member
TotalNoobAtRpgmaker
Top