Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Making Event turn back to Page One via switch when not in map?

:dead:
I have been trying to figure out how to do this for a while now and I really feel like the smiley above...

Okay, this isn't that simple but I'll try to explain in the simplest way possible.


I have a town which consists of 5 maps, they're linked together to make one big town.
The town has a load of events inside the maps which disappear using the Self Switch A when walking over them.

When you come out of the town the self switch As tunn off and the event is switched back to page one of the event (which the event was before you walked over it).

I do this by a normal switch in the teleport event back out of the town called BACK which switches all the events with self switch A on in the map you're in back to the original page one (no switch A).

So in these events:
Page one is the original page when entering the town with Player Touch: Switch A on in the Event Commands.
Page two is activated when Switch A is turned on from Player Touch in Page One. Nothing is in the Event Commands.
Page three is the switch back event and is activated when the BACK switch is activated from the teleport switch back out of town. It's only workable when Self Switch A is on in the event (when it has been walked over) and when BACK is on obviously. This works by Parralel Process so it can work in conjunction with the teleport event.

The problem is, is say for instance you're in map 2 of 5 in the town and you've already switched an amount of Self Switch As in the events in map 1, 2, 3 & 4. You come out of the town from map 2, BACK does it's thing and the events change back, but they only change back in map 2, where you were last because that's where you've come from and the other maps aren't recognisable of the event switch. You go back in and the events haven't changed in the other maps (1, 3 & 4).

If you don't completely understand what I mean I could maybe post a demo. It's not that hard to figure out what I mean though, I've tried my best to explain it in the best way possible.

So if anyone here knows how to make an event change back to page one from page 3 via a switch when you're not in the map please let me know.

EDIT: I had a solution for this by merging the maps together to make one big map instead but I get serious lag. I can't use the anti-lag script because the events which you walk over move and need to keep moving away from you. If they move out of the screen they stop until you walk next to them in the screen again... no good :(

also I'd rather do it with an amount of maps now, it would take some time to merge the maps together again :dead:
 
SephirothSpawn":1idnh2ut said:
I didn't understand. Care to post a demo and tell me what I need to do in this demo, what it will do, and what it should do.

Okay I'll post a demo soon tonight or tomorrow (I'm off to work in a minute). I've edited the description to make it easier to understand, please read it and try to picture out what I'm trying to describe, it's not that hard.
 
To understand what's happening first you have to understand the difference between a local switch and a global switch(the switches we are used to).

Local switches are strictly limited to the event. You can't turn off another event's local switch from anywhere in the game but that event. Make sense? That is why you can't give local switches unique names, because you can literally have 100 events in your map all with their own set of local switch a's that don't effect each other. So then you might be asking, well then why use local switches or where can i use them? The simple answer is, use local swiches on events you know that you most likely won't be accessing again. I.E, cutscene event, npc's, and pretty much any events that are going to be relatively static throughout your game.

Normal switches however are the ones we most commonly use in our games as they are the dynamic switches in the game. These switches can effect anything you would like in the game. Best example, you just defeated a major boss in the game, and now you want all your town's people to say something different when you walk back in town. These are the switches you want to use.

For your example, you are trying to turn off all of your even'ts local switches from another map or event, which isn't possible. You have to think of local switches as private, like a girl's thought's for example. She is the only one who knows what she is thinking, and is the only one who has the ability to tell you or not tell you what shes thinking. Local switches are private within an event. Can't stress that enough.
 
There are a couple things you can try:

  • Try turning the Back switch on when you enter the map instead of when you leave it.
  • Change Page 3 of the events to Autorun.

I'm not exactly sure what the problem is, but if you do those two things, it should work.  I think that, by having it activate when leaving and having it parallel, it doesn't have enough time to shut off the self switches before the transfer.  I may be wrong, but that's my best guess.
 

Zeriab

Sponsor

It sounds like you really only need 1 page of functionality and afterwards needs them to disappear until you reenter the map.
If this is correct then the solution is actually simple. Delete page two and three. Instead of turning switch A on you use the Erase Event command. (Remember to make a back-up ^^)

As for using an antilag script. I know there scripts which allows you to tag special events which should be able to move outside of the visible screen area. You can at least do it in mine. (link)

*hugs*
- Zeriab
 
dario8676":2l2k22h7 said:
To understand what's happening first you have to understand the difference between a local switch and a global switch(the switches we are used to).

Local switches are strictly limited to the event. You can't turn off another event's local switch from anywhere in the game but that event. Make sense? That is why you can't give local switches unique names, because you can literally have 100 events in your map all with their own set of local switch a's that don't effect each other. So then you might be asking, well then why use local switches or where can i use them? The simple answer is, use local swiches on events you know that you most likely won't be accessing again. I.E, cutscene event, npc's, and pretty much any events that are going to be relatively static throughout your game.

Normal switches however are the ones we most commonly use in our games as they are the dynamic switches in the game. These switches can effect anything you would like in the game. Best example, you just defeated a major boss in the game, and now you want all your town's people to say something different when you walk back in town. These are the switches you want to use.

For your example, you are trying to turn off all of your even'ts local switches from another map or event, which isn't possible. You have to think of local switches as private, like a girl's thought's for example. She is the only one who knows what she is thinking, and is the only one who has the ability to tell you or not tell you what shes thinking. Local switches are private within an event. Can't stress that enough.

Okay thank you everyone for the helpful posts so far, I've just read this post and I will read the others and reply in a second.

To dario8676: I'm fully aware of how Switches and Self Switches work but thanks for the info. What I'm trying to do is make an event which has been switched with it's Self Switch A to go back to the Page One. I know Self Switches can't switch back in another map but maybe there's a way to get the Page back to Page One without reswitching the Self Switch. Maybe I could reset the events in the teleport which moves player from map to map, then self switch the teleport so it only teleports...?  (hmmm..., just had a thought with using labels maybe? i.e. Go to label when entering the map??, I'm gonna try in a second)

To Zeriab: Do the events come back then this way? I thought using this would make the events go for good.. I will try it in a second too. This would be great if this did work, I never realised.

To Guardian1239: I already have the BACK switch on when I enter also, but because I'm not entering all 5 maps it won't work, I only enter 1 map so it only changes the events in that map but not the others because I'm not in the other maps. And if I add BACK switch on when finally entering all the maps then it won't remember the amount of events which had been switched over if you enter the map again, and I need it to remember which ones are walked over until you go out of the town.

So all it is that you didn't get in my explanation was that the other map's switched events are still going to be the same aren't they because you can't switch BACK them because you're not in the map to switch them back? If you see what I mean?
 

Zeriab

Sponsor

If you erase an event it will be gone forever while you stay on the same map.
If you go to another map and come back all erased events will be present again.
If you right-click on the Erase Event command you get: Temporarily erases running events. Used only on the map screen.

The typical support about them have been problems with the events not going for good. It's nice with a new angle even though the problem is essentially the same.

*hugs*
- Zeriab
 
And if you want it to record how many times they've been stepped on, you can use a variable.  Just use:

Code:
Control Variables: [0001: Count] += 1
Erase Event

with anything else you need in there.
 
Guardian1239":2z5hdnzl said:
And if you want it to record how many times they've been stepped on, you can use a variable.  Just use:

Code:
Control Variables: [0001: Count] += 1
Erase Event

with anything else you need in there.

Haha I'm using the 'Change Gold +1' instead (which is a fuction I don't need for my game). It seemed easier at the time, I didn't know much about variables when I started making my game.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top