Author Topic: Switchs  (Read 1391 times)

0 Members and 1 Guest are viewing this topic.

michael95

  • Tier 3
  • *
  • Posts: 70
  • Current Mood: happy happy
Switchs
« on: May 17, 2011, 01:41:15 PM »
I want this event






Display after this event





Problem is, that first event dysplays before and after complete second event.

Sarkilas

  • *
  • Tier 6
  • **
  • Posts: 429
  • Gender: Male
  • That guy
  • Current Mood: creative creative
Re: Switchs
« Reply #1 on: May 17, 2011, 01:44:59 PM »
Your problem is that the first page of the after funeral event sets the After Funeral (5) switch to ON instantly. Remove the switch control in the first page of the first displayed event in the thread, then set the trigger to Action Button so it doesn't create an interpreter instance.

That should do the trick for you. As you've set it up now, it will instantly set the switch on in the first page of the first event every single time the map loads for the first time.

/Sark

Need scripting help? Toss me a PM and I'll see what I can do.
Also able to help with anything RMXP related. Please do not hesitate to ask.

Ruben

  • ~True Remembrance~
  • Mod-Suspect
  • Tier 7
  • *
  • Posts: 2115
  • Gender: Male
  • :)
  • Current Mood: happy happy
Re: Switchs
« Reply #2 on: May 17, 2011, 05:47:21 PM »
To elaborate a bit more: The RPG Maker always looks at the last page of an event first.

One example: An event has two event pages.

Page 1: No condition
Page 2: Condition = Switch 01

First, the RPG Maker goes to page 2 and checks whether Switch 01 is true (true = on) or not. If it is true, page 2 becomes the active event page. If not, the RPG Maker goes to page 1. Since page 1 has no condition, it will always be the active page if page 2 is not.

Another example:

Page 1: No condition
Page 2: Condition = Switch 01
Page 3: No condition

Page 3 is checked first. It has no conditions, so it will become the active page. It does not matter if Switch 01 is activated. Since page 3 is behind page 2, it has a higher priority.

Because you activated Switch 0005 on each event page again: It suffices completely to activate a Switch once. It won't switch back again by itself.

And one advice for you: Use Self-Switches. Self-Switches are only valid for the event that uses them. So basically every event can have up to five Self-Switches (A, B, C, D, and E). The big advantage of Self-Switchs is that they don't have to be named. They are much faster to use and it is easier to keep everything organized that way. It took some time for me to discover that feature and it helped (and still helps) me a lot.

One example: A treasure chest.
Page 1: Graphic of a closed chest. Once the Action Button is pressed, the chest opens via "Set Move Route", a message pops up that you got an item, the item is added to your inventory and Self-Switch A is activated.
Page 2: Condition = Self-Switch A. No event code. Event graphic = open chest.
That way you won't have to create a new Switch for each treasure chest. Other events will not care that Self-Switch A is now activated because it is only this treasure chest's Self-Switch A. Each event has its own Self-Switches A-E.

By the way, I find it great that you are so interested in the RPG Maker and that you don't hesitate to ask your questions here.
« Last Edit: May 17, 2011, 05:50:26 PM by Squall »

michael95

  • Tier 3
  • *
  • Posts: 70
  • Current Mood: happy happy
Re: Switchs
« Reply #3 on: May 18, 2011, 11:10:51 AM »
When is switch After funeral no activeted I want display this:



And when is activated:






Sarkilas

  • *
  • Tier 6
  • **
  • Posts: 429
  • Gender: Male
  • That guy
  • Current Mood: creative creative
Re: Switchs
« Reply #4 on: May 18, 2011, 11:14:40 AM »
If you had read what Squall wrote in detail, you wouldn't be asking this question. As he wrote, RPG Maker prioritizes the latter pages (so if the conditions on page 5 is met, it will disregard all other pages in your event). And since your event's page 5 has no conditions, it will always be the page that is active. If you put page 1 after page 5 (making page 5 into page 4 and page 1 into page 5), it would do as you want it to.

Read Squall's post again. It explains everything you need to know about switches (except RPG Maker XP does not have a self switch E :P).

Also note that you can move your door in a single page instead of using autoruns and switches by doing the following move route:
Set Move Route: This Event
Turn Left
Wait 4 Frames
Turn Right
Wait 4 Frames
Turn Up

Saves you all those pages, self switches and autorun effects.

Good luck.
« Last Edit: May 18, 2011, 11:20:39 AM by Sarkilas »

Need scripting help? Toss me a PM and I'll see what I can do.
Also able to help with anything RMXP related. Please do not hesitate to ask.