Okay. So I've done this before, however the project I was working on got screwed by windows and I lost everything. There's this one scene I'm trying to recreate where you have to fight these two guards and there are two events(ImperialGuard1 and ImperialGuard2). I've been making it so whenever you defeat an enemy their corpse lays on the ground. I can't remember for the life of me(been trying for 3 days now) how to make it so that when you defeat one guard to make the other also selfswitchA. I remember it involves a switch(imperialguardblock) but can't figure out how to make it work.
Linking Events(not the traditional method)
● ARCHIVED · READ-ONLY
-
-
You can use switches instead of self switches - that's the usual way. Just have page 2 of both events conditioned by the same switch, and make both events turn on the same switch.
Or you can change one event's self switch from the other event. Let's say your map id is 12 and your events are 8 and 9. On event 8, when you turn on self switch A, add the following script call: $game_self_switches[[12,9,'A']] = true to turn on self switch A for event 9. Then, of course, on event 9 you'll do the same thing, but use [12,8,'A'] as the self switch key. -
set a variable to 0, and upon each battle victory add 1 to it.
check for >0 to validate any guard defeated from the other guard's own logic.
upon triggering the final sequence, remove the events, and reset the variable.
it's not advisable to manually change self switches outside from the own event. -
set a variable to 0, and upon each battle victory add 1 to it.
check for >0 to validate any guard defeated from the other guard's own logic.
upon triggering the final sequence, remove the events, and reset the variable.
it's not advisable to manually change self switches outside from the own event.
Why is that not advisable? There are a couple scripts for just that and they work fine. It's certainly better than wasting a bunch of switches or variables if all one wants is change one particular event or a couple for a few scenes etc. -
because they are *self* switches?Why is that not advisable?
meant to be used internally?
of course there can be scripts to manage that.... that doesn't mean it's the correct way of doing it. -
Or you can change one event's self switch from the other event. Let's say your map id is 12 and your events are 8 and 9. On event 8, when you turn on self switch A, add the following script call: $game_self_switches[[12,9,'A']] = true to turn on self switch A for event 9. Then, of course, on event 9 you'll do the same thing, but use [12,8,'A'] as the self switch key.
Thank you, this works perfect! It's not how I remember doing this before, but I think this method is far superior. Thank you. -
Self switches are called that way just because their effect is limited to one event, instead of a global "standard" switch.because they are *self* switches?
meant to be used internally?
of course there can be scripts to manage that.... that doesn't mean it's the correct way of doing it.
There's no need for a global switch or variable if you're only dealing with a local setting, used on a single map.
On the contrary, a standard switch is overkill. -
Self switches can be controlled from other events as well and should cause no problems.
I have not experienced any and I use the self switch script command in lots of locations. -
Global switches are named, and can be accessed via the standard event commands. Therefore they are easier to use.
Self switches are local to the event and aren't named. There are no standard event commands to check or alter one event's self switch from another event. For that purpose, you have to use a script call, so they are harder to use, and are more risky - there's more of a chance you'll get something wrong, and you have to remember what each one is used for on each event.
It's not that you shouldn't do it, it's that the engine is designed so that that shouldn't be necessary. However, it's a way of affecting a small number of events rather than just one, without using up those precious global switches. I use the technique in my game. Just be aware of the extra risk in doing it this way.
As an aside, in Ace, MV, and (I think) VX, you can do it this way and it works (though the syntax is obviously different for MV with javascript). In XP it didn't. XP didn't include a map refresh when you change switches, variables or self switches via script, so the events wouldn't be refreshed, but the newer engines do.