I want to create a pub, where there's different people on different days of the week.
I have a day of the week system based on switches and a different switch for every day of the week.
I can't just put "Friday" in the NPC appearing conditions, as I want it to appear on several week days.
Here's what I've done:
- I created a "Friday" parallel event in the pub
- the event turns on switches responsible for a bunch of NPCs I want to appear on Friday.
- the NPCs have the requirement of their switch being on to appear.
...and it doesn't work, even though I can find no logical reason why!
ensure all of your switches are set before entering the pub; events are setup at the time of scene creation, and if their conditions are not met when the scene is created they will not appear unless you perform a manual refresh on the scene (bad practice); set your switches within the transfer event on the previous map leading into the pub so that each event's individual conditions will be satisfied at the time of scene creation.
No, that's not right. Changing a switch will cause all events to re-evaluate their conditions. You can have an event that's conditioned by switch 1, enter the map, the event won't be there, turn on switch 1, and the event will appear.
Please show us your parallel event that turns on the switches, and one of your events that relies on that switch.
Other things to check ...
- are you certain the switches are actually getting turned on? At what point do they get turned off? Any chance they're being turned off straight away? If it's Friday and you're on the map, go into the debug window (F9) and confirm that it IS Friday according to your variable/switch, and that the other switches are on.
- any chance you have a second page on the events that has no sprite and no conditions, or its conditions are being met? In that case, the higher-numbered, blank event page will be active.
why is it that you are using sooo many switches? i do not find it overly surprising that you are running into conditional problems when you have so many switches to keep track of; i do not understand why you cannot have seven individual switches (one representing each day of the week) and use those single conditions for events which are to appear on that day.
As I already said, dbchest: "I can't just put "Friday" in the NPC appearing conditions, as I want it to appear on several week days."
If I use the "Friday" condition, the dialogue that's in there will only appear on Friday. If I want it to appear on Friday, Wednesday and Sunday, I need to make 3 exact copies of the same page with different condition. Any change in them will be a pain not to mention keeping track of the dialogue continuity when I want the dialogue to be broken into 5+ parts.
And I don't think I have any problems keeping track of my switches. I mean... Show me on the screenshots where I lost track of any.
If you have an NPC you want to appear on 3 days, just give the event 3 pages, each one conditioned by the switch for that day. If they do the same thing on each of those days, you can either set up the event commands for one day, then copy/paste them to the other days, or just create a single common event with no trigger, and then on each event page do a Call Common Event command - that way if you want to change something, you just need to change it in one spot.
The Call Common Event is not that bad of an idea... but it will get super messy. I am planning on having 10-15 NPCs there. Each one with 5 different dialogues. That's 50-75 common events sitting there somewhere. Having them pinned and sorted per NPC event is much easier to manage.
And still, why is my approach not working? I mean, it really seems it should!
your approach is bad and shaz said what i was thinking; it is the logical approach. this system only requires a single switch for each day of the week. anything in excess is poor practice at hand. good luck.
I appreciate your feedback, but just saying "it's bad" doesn't really help me a lot. Sure, it might be unorthodox. Sure, there might be some "easier" ways to do that, but can you actually tell me why my approach is failing?
the more events and the more switches, the more chance of something going wrong.
You said the day switches are being turned on, but what about the other switches from your parallel process event? Those events set to parallel process that turn on other switches should also self erase afterwards, otherwise they're just going to keep running and looping the entire time you're on the map. Put in a few of those, and hello lag! Just one more issue with using parallel process events.
who knows? you never showed us where Thursday is activated so we do not know if it actually is ON or OFF. we cannot see pages 6, 7, 8, and 9 of your transfer event. we do not have the whole picture. it is hard to help someone figure out solutions to messy approaches; the better solution is to alter the approach to an approved method.
also, when using parallel processes, consider utilizing self switches to update their page so they do not continue performing the same code after it has already accomplished its purpose; the better choice here is an autorun which self-destructs.
re-read my post - I misread yours and gave you a not-very-useful answer. I edited it, but you'd already read and replied in the meantime.
I got it working according to your idea. Just so you know, it took:
- a plugin to call events, not just common events (my quirk, yes)
- an additional variable
- an additional event to call based on this variable
- 8 layers of nested conditional branches based on an additional variable and additional switch to implement 5 dialogues for the blacksmith - I have no idea how I'll be able to make sense of those in a week 🙂
But it works... for 1 NPC. Will need to redo all the rest. Still, thanks. It works 🙂
Just my two cents, but wouldn't it be more practical to use a single variable to keep track of the day of the week? e.g. variable x being set to 1 would be monday, 2 would be tuesday and so on. This saves you from having a boatload of switches to keep track of.
Yeah, probably 🙂 But these switches came together with a plugin that I am using for time management, so I am just sticking with it.
You could also see if there's a plugin that allows you to add extra conditions to your page, so you could do Monday OR Wednesday OR Saturday. That means you'd only need one event page per NPC and would not need to use common events or duplicate event commands between pages.
Thanks Shaz. The OR option would actually be very useful. Will look for a plugin like that. Regarding how complicated it is, it's just how I want the dialogue to work:
IF dialogue exhausted:
"I have nothing more to tell you"
ELSE - IF talked today:
"let's talk another time"
ELSE - IF dialogue conditions met:
IF dialogue_variable=0
Dialogue 1
ELSE - IF dialogue_variable=1
Dialogue 2
ELSE - IF dialogue_variable=2
Dialogue 3
ELSE - IF dialogue_variable=3
Dialogue 4
ELSE - IF dialogue_variable=4
Dialogue 5
8 IFs 🙂 I don't see any other way to do it within one event page.
I'm just not making a standard 1 NPC - 1 line game, unfortunately 🙂