The problem is, I want the player to interact with the NPC. To do so needs to be action button, not parallel.
Ahh, yes, you're right. I hadn't thought about that! This really depends on how complex your conditions are, though. It would be easy to just have different pages of the NPC event active depending on the time - but you are also checking for the player's position and whatnot, which could complicate it.
Unless the NPC can function without the need of parallel, then I didn't know this AND could resolve the issue I am having.
This could potentially be done within the NPC event's movement route (set to Custom), but this
would require some scripting in order to check conditions. Movement routes are amazing because, if you can figure out how to write the script(s) that you need, you can make an event do probably anything as if it was a parallel event page - while still being interactable, because it doesn't use the
actual event page. But yeah, you would need to know how to script it appropriately.
If you ever want to try that, feel free to send me a message and I could maybe help you work some of it out
🙂 If you told me what you wanted to do in the movement route, then if I know (or can figure out) how to script it, I could help you with what to type in the script field to make it happen.
Otherwise, what you've got going on now will probably work just fine.
Wow. I was able to figure it out. Talk about overthinking it way too much. Provide the screens on what I did.
Oh my goodness, yes, this is so much easier to understand at a glance than what you had before. All these things
can theoretically all be checked on one page. But whatever was going wrong, it most likely had to do with the specific setup you had. Separating them out like this undoubtedly removes whatever the issue in your structure was.
The only thing I see now that I would caution could potentially cause a bug in the future is having two separate events trying to move "Mother" at the same time. Both events trigger when hr >= 6, so if the conditions in the "NPC Check" event's conditional branches ever happen to be true at the moment that hr becomes >= 6, then both events will try to move "Mother" at the same time. This is because there is nothing to stop the "NPC Schedule" event from still making her walk at the same time that "NPC Check" is changing her location. You could fix this by turning on a switch in "NPC Check", just before it moves her, and then add a condition to the "NPC Schedule" that this switch must be off in order for
it to move her. Then turn the switch off again, right after "NPC Check" moves her, to allow "NPC Schedule" to return to normal functionality - without conflict.
Self Switches some point may need to be replaced. For right now, I'm using them to try and save on Switch use. But tested this out twice and haven't had any issues since.
This is what Yanfly's Self Switches & Variables plugin would be useful for
🙂 Although I think it costs money, but it's one of the absolute most useful plugins I've ever purchased - it's indispensable to most of my more complex systems, of just this sort of thing. It would let you create as many self switches as you want for an event, without cluttering up your master list of Game Switches. All you'd need is one master Game Switch for each type of self switch (e.g. A, B, C, D, E, F, G, etc.), and then that one master switch can be re-used for different events that each keep track of their own separate values.
Or even better, you could just use a self variable, and instead of having separate self switches A/B/C/D/etc. to switch to different pages, you could just use a single variable that ticks its value up or down to switch pages. So instead of turning on self switch A (and having to remember to turn it and all the others off when the day restarts its cycle at midnight), you would just change the self variable to = 1. Then instead of turning on self switch B, you would just change the same self variable to = 2, and so on.
You can still do the above (use a variable instead of many switches) without the plugin, but you'd just need to dedicate a Game Variable to each NPC to track their individual progress in their schedule. So whether you buy the plugin or not, I still highly recommend doing it this way, as it will allow you to switch between more than 4 event pages, while taking up way fewer Game Variables than it would if you were using Game Switches.