In the last Living Town article, I was building the moving parts of his routine. Now its time to tie it into the time system of the clock.
All of this will be accomplished with a single parallel processing event using a whole bunch of conditional branches.
The first thing to remember, is that the clock system does NOT store our variables the same way it displays them. The clock system runs 4 blocks of 6 “hours” rather than 2 of 12. So we need to translate our times into the times it uses:
- 6am: Minute: 0, Hour: 0, Time of Day: 1
- 7am: Minute: 0, Hour: 1, Time of Day: 1
- 12pm: Minute: 0, Hour 0, Time of Day: 2
- 12:30pm: Minute: 30, Hour 0, Time of Day: 2
- 7pm: Minute: 0, Hour 1, Time of Day: 3
- 8pm: Minute: 0, Hour 2, Time of Day: 3
- 10pm: Minute: 0, Hour 4, Time of Day: 3
With nesting, its best to start with the things that change the least, then work down to things that change the most. So we will first build 3 conditional branches for the Times of Day. Since it happens in sequence, I’m not going to put them in the else portion, just put them back to back.
After that, build the conditional branches for the hours needed inside those, and the minutes inside those. You can also put a wait 60 frames at the end, as this only needs to be checked once every second (as that is how often the minute changes).
When you are done, with that, the conditional branch should look something like this:
Now all that is left in the event is to put in some changing of variables to tell Arglebar what to do at these times, and change it to parallel process.
So the question now: Does it all work. Time to test! This should take about half an hour of following him around and making sure he gets to the right places at the right times. So get yourself some lunch or something to eat while you shadow him. I’m going to make a sandwich.
Ok, now let’s see what he does!
… And I had had a period in a script instead of a >. Good job me. Let’s fix that first. And, NOW let’s see what he does!
… And I had accidentally turned the stools to impassable. Good job me. Let’s fix that. And, NOW let’s see what he does!
… And I had somehow put a unnecessary return in every script call. Good job me. Let’s fix that. And, NOW let’s see what he does!
… And I had used regular script calls instead of move route script calls like I was supposed to. Good job me. Let’s fix that. And, NOW let’s see what he does!
… And I had made the set move routes target the player instead of the Arglebar. Good job me. Let’s fix that. And, NOW let’s see what he does!
… And I had forgot that events do weird things when you try to move them on top of each other. Good job me. Let’s fix that. And, NOW let’s see what he does!
… And I had somehow ended up with the vegetable fields as impassable. Good job me. Let’s fix that. And, NOW let’s see what he does!
… It works. I don’t even. I don’t have words. I will go cry now.
Ok, now that the cry is out of the way, there is one issue, it bugs out if you are standing in the way when it tries to make a move route. I’ll have to look into that one, but for the moment… it all works. We have him set in a routine!
What would be your next step? Do you have any ideas of how this could have been done more efficiency? Join us in the comments section below.
Current Build: Download Here