Trouble Understanding "Self Switch" And Conditions

PazcezVanae

Warper
Member
Joined
Apr 27, 2015
Messages
3
Reaction score
0
First Language
English
Primarily Uses
I'm really baffled. I'm trying to make a part of the game where you go into an inn, into a room, sleep in the bed, then when you leave the room instead of going back to the inn's first design, you end up in the second design. I was told to use self switches and conditional branches, and for some it worked but for others it didn't. I want to restart the events and make them work, but I have no idea how because apparently there's something about the event pages and how they're ordered or what not.

Here are the events and if you see the problems please let me know I'm kinda mad at it now.



 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
A self switch is only usable for that event.

E.g. if you turn on Self Switch A in Event 3, it will only work for Event 3. Hence the checkboxes on the pages. This is used so you don't have to waste space with your global switches.

Go in the map editor -> event mode -> right click on the map and then hover over quick event creation and make a treasure chest. It should give you an idea on one of the ways to use it.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
I suggest you work through the tutorials first to get a feel for the events - you can follow the link in my signature to the more important ones.

However, one thing is already clear from your screenshots: you need to learn how to use conditions on event pages.

Only one event page can be processed, and if no condition is set that is the page with the highest number.

In your event ID 001, the first page can never be processed because the second one takes priority, and in the second page the conditional branch can never be true because you have no command there that sets self-switch A for event 001 (which is a different switch than the self-switch A for Event 003 that you're setting in that event.

Regular switches are counting for the entire project - self-switches are counting only for that event itself - that's where the name comes from.
 

PazcezVanae

Warper
Member
Joined
Apr 27, 2015
Messages
3
Reaction score
0
First Language
English
Primarily Uses
I suggest you work through the tutorials first to get a feel for the events - you can follow the link in my signature to the more important ones.

However, one thing is already clear from your screenshots: you need to learn how to use conditions on event pages.

Only one event page can be processed, and if no condition is set that is the page with the highest number.

In your event ID 001, the first page can never be processed because the second one takes priority, and in the second page the conditional branch can never be true because you have no command there that sets self-switch A for event 001 (which is a different switch than the self-switch A for Event 003 that you're setting in that event.

Regular switches are counting for the entire project - self-switches are counting only for that event itself - that's where the name comes from.
Wait, so if I use just a regular switch that could potentially solve my problem? As long as I only use one page for an event?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
You really don't need a global switch for this.  It is much better that you learn how to do this properly now, rather than fudge your way through, because you will be using switches and self switches constantly.  Unless you understand fully what you're doing, you could end up in an awful mess.

I strongly recommend that you follow Andar's advice and go through some of the tutorials that you can find if you click on the link in his signature.  Spending a bit of time on it now will save you a lot of time and grief in the future.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
I'm going to second ksjp17 here. I tried global switches when I started out as I had no idea how to use the self switches, and it was a disaster. Had to start my project over after 4 days due to the mess I had at that point (and this was during the IGMC, so that was 4 days I didn't have).

So yes, work through the tutorials. Short version though is each event has switches A, B, C and D which you can turn on and off, and those switches are ONLY for that event.
 

sock

Veteran
Veteran
Joined
Aug 9, 2013
Messages
53
Reaction score
4
First Language
English
Primarily Uses
N/A
A solution to your problem. And maybe some helpful tips.

Firstly, conditional branches don't work like that.

   If you want the conditional branch to work for what your asking it to do. You would include the following in and underneath where it says conditional branch in blue. So like this.

Conditional branch = A selfswitch on.

> Transfer player. (In here)

>

Else
>

End branch

   Like you have done in your third picture. That is right. Although on the whole. Its wrong. Because the way you have set it up in the first picture. Firstly conditional branches don't connect up with other conditional branches from other events. To me it seems like you think they might.  From what I can see.

How conditional branches work (Note: don't get alarmed just keep reading and don't assume anything until you get to the end)

   Basically, a conditional branch is used if you want something to happen if something else has already happened (triggered) before it. If you look again at your first picture the first thing that happens in the code is the first thing that is read. So your code is currently running like this.

   It see's the conditional branch, it will check to see if any of those requirements have been met first. At this stage you have asked it to check for Self switch A being turned on. Now, because that hasn't actually happened yet and ill explain why later, nothing will happen there, and it will then say to itself "Their is no reason for to go through that branch". Now where you have written in Self Switch A, you must understand that for the conditional branch to work self switch A has to of already be turned on before it can be read by the conditional branch. But because you haven't. It is going to skip that and continue to 'else'. Now because you haven't put anything in the 'else' section either. Then it has nothing to do but to continue through the code. And then that's when it will show you the text and options, and then either by choosing yes it will transfer you to the other location. And then trigger the self switch. But!

Something you need to learn about self switches.

   They only work for the event they are in. That's why they are called Self Switches. Every event you make can only have 4 self switches. A B C and D. They only work within their own event. That's very important to understand. Take a moment to notice the left pane of the event window specifically where it says self switch. That's is where you get self switches to work.

   If you check that. It will ask you which self switch you want the event to recognise as being ON. But, this is why one event, can have multiple pages (and I can see you have figured out to make a new page that's good.) If you make the first page have whatever self switch you want to turn ON. Lets say Self switch A. Then in the next page (page 2) you have to check the box in the left pane of the window so it says 'when self switch A is ON' That means, when you character activates the event, and it triggers the self switch ON. The next time your character activates the event in the way you have it set up, it will start from page 2 and ignore everything page 1 has. Because you have the self switch redirect the event to page 2 but as long as the selfswitch check box is checked and the switch is set to the corresponding letter. For example a simple event using a self switch will look like this. Notice the different page numbers.

Page 1

>Text: Do you want some tea?

>Show choices: Yes or No

>When - Yes

>Text: you drink some tea.

>Turn self switch A: ON

>When - No

>You refuse the tea.
>
>

Page 2 (This will have the checked box Selfswitch A = On) So it recognises there is a change.

>Text:Do you want some more tea?
>Show choices: Yes or Shove it up your nose
>When - Yes
>You drink some more tea

>When - No

>You tell them where they can shove their tea.

>

>

   You can then add more self switches afterwards but remember you only have 4 for each event. (A B C and D) Also, they don't need to go after text that can go anywhere you like, after wait commands, movements, sound effects. You also shouldn't really be using them with conditional branches like you have tried, the self switch are kind of like their own conditional branch as in they run themselves. However, they can be applied to conditionals branches if you know what your doing but that would be for some more advanced learning, and you still have plenty more to learn before you get to that stage.

So that's why I have included this

The solution to your problem! (Which doesn't use either self switches or conditional branches)
 

   Firstly, who ever told you to use conditional branches doesn't know what they are talking about. Yes it can be done, but only if you want to make things hard for yourself. In fact, what your trying to do, doesn't actually need self switches and your actually pretty much half way there already, by the way you have your event set up in the first picture. I included the info about conditional branches and self switches for your own benefit.

   Now before I continue I want to make sure you understand this one point very clearly! Most of the time people will not set up your events for you. But today your lucky, I've had a rough one myself and all I've wanted is someone to simply spell out my own problems for me, because I cant help myself. So I am going to tell you how to do this event, but only because I'm in a weird place and I've had no sleep. But seriously though don't expect people to always be making your events for you. You have to learn to be more intuitive and willing to learn. Its the only way you will get better at VXAce and how will start to have more fun with it as it gets more rewarding.

So here's how I would set up your event if it were me.

   Lets have a look at your first picture. The event with the I.D 003 (You can see this in the top left corner of the events window). Its very important to know the number of your events, especially later down the track when you will be using triggers and movement commands.

   So firstly, delete the conditional branch and the erase event command. (If you just delete the conditional branch it will delete the erase event with it)

   Leave the text and options as is. Leave the fadeout screen, that's a nice touch. Delete the Self switch A. Your not going to need it.

And then leave the transfer player and especially leave the fade back in. It's going to be needed other wise your screen will stay black. So it should all look like this

>Text: Go to sleep?

>Show choices: Yes or No

>When Yes

>Fadeout screen

>Transfer player (Make sure this takes you to the new location and different inn)

>Fadein Screen

And Voila!

   That's it. That should take you to the new inn layout, and depending on how you've created your inn to look, will help created the illusion that it is the same but different. Or whatever it is your going for. To make yourself go back. Make a completely new event in the inn you've just been transferred to which is exactly the same as this one, but make sure the transfer event has a different location. You can see how if they both had the same location then that would be silly right?  So yeah, make sure it takes you back or, to where ever you want it too on the new event.

If your still lost feel free to ask me again in PM. Although I might take a day or two to respond. I'm in dire need of sleep.
 
Last edited by a moderator:

PazcezVanae

Warper
Member
Joined
Apr 27, 2015
Messages
3
Reaction score
0
First Language
English
Primarily Uses
Umm.... I figured it out guys. I'll show you how I did it.

I appreciate your replies but I really didn't need so much help haha. I'm pretty good with figuring out this stuff; with zero knowledge of the program before hand no less :p

Here's what I did:









My problem was I was using conditional branches wrong, they needed to be "OFF" not "ON" when checking. That way it could erase itself if it was off and not check if the switch was on. Also, the events needed to be refreshed by exiting the maps, so I made a "purgatory" map that would allow them to do so while the player still ends up back in the room.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top