Linking Events(not the traditional method)

Keiro

Dis weeb
Member
Joined
Mar 27, 2018
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
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.
 

Shiro-chan

Friendly Neighbourhood Neppy Maid
Veteran
Joined
Aug 7, 2018
Messages
151
Reaction score
42
First Language
German
Primarily Uses
RMVXA
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.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
Why is that not advisable?
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.
 

Keiro

Dis weeb
Member
Joined
Mar 27, 2018
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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.
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
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.
Self switches are called that way just because their effect is limited to one event, instead of a global "standard" switch.
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.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,660
Reaction score
563
First Language
English
Primarily Uses
RMVXA
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,847
Messages
1,016,972
Members
137,561
Latest member
JaCrispy85
Top