Save-Point
Barrier Switch Not Working - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: General Support (https://www.save-point.org/forum-18.html)
+--- Thread: Barrier Switch Not Working (/thread-5562.html)



Barrier Switch Not Working - Dr. Ermine - 08-14-2015

So in my current project, I have a barrier in front of an archway that I do not want to vanish until you are done talking to the introductory NPC. Then I want it to vanish and the character is free to walk through the arch way.
My issue is, with the code I have currently, the moment the character enters the room, the barrier vanishes, never to return. There is no barrier, the talking to the NPC does nothing.
Here is my code, currently...

NPC's Code

Barrier's Code Pg.1
Barrier's Code Pg.2


RE: Barrier Switch Not Working - DerVVulfman - 08-14-2015

It is a little known fact that map events in RPGMaker XP do not always automatically refresh upon command if the action asking the event to refresh is being performed by ANOTHER event.

In other words, if you asked ONE event to refresh, it will. If you ask ONE Event to do something, the other event may not immediately refresh. This isn't always the case, but a sometimes factor (including here). Smaller codes... no issues.

There IS a way to solve this (actually a few, but I'm not gonna talk rewriting the switches section now):

Add the following 'script call' right after you turn your switch on:
$game_map.need_refresh = true
This will force the game map to refresh, and re-check every visible event.


RE: Barrier Switch Not Working - Dr. Ermine - 08-18-2015

(08-14-2015, 04:21 AM)DerVVulfman Wrote: It is a little known fact that map events in RPGMaker XP do not always automatically refresh upon command if the action asking the event to refresh is being performed by ANOTHER event.

In other words, if you asked ONE event to refresh, it will.  If you ask ONE Event to do something, the other event may not immediately refresh.  This isn't always the case, but a sometimes factor (including here).  Smaller codes... no issues.

There IS a way to solve this  (actually a few, but I'm not gonna talk rewriting the switches section now):

Add the following 'script call' right after you turn your switch on:
 $game_map.need_refresh = true
This will force the game map to refresh, and re-check every visible event.

It's still vanishing. Do I put that script after every switch, or just the door lock switch? Sweat


RE: Barrier Switch Not Working - DerVVulfman - 08-19-2015

Oh, I am sorry. I thought you had an issue where your barrier did NOT vanish. So what's happening is that your switch is being triggered when you enter the map, or was already triggered prior to entering.

Inquiries:
You're showing a self-switch activated page for your dialog. The first page... is it an auto-run or parallel process event. And if so, did you check to see if the code for the barrier switch (0009: Door Lock) may be there?

Maybe you are accidentally using Switch 0009 elsewhere in the game or in some custom script (it happens), and it is being turned on automatically. Have you tried using a different switch for your door lock?