Can I controls events such as NPCs with this script according to time?
Example, at 8:00 AM Joe is on one map but at 12:00 PM he's at another, or the store doesn't open until 9 AM and closes at 10 PM.
You can use conditional branches with script calls like:
GameTime.hour? > 8 && GameTime.hour? < 12
Would have that one only working when the time is between 8am and 12pm.
With that you could set up parallel events to activate events based on the time, or if you combine it with scripts that give you more options for event page conditions (like my Event Page Conditions script) can set them up directly.
Popped in to say, your script is awesome! I am finding a lot of cool uses for it (like, having clocks and calendars that work in-game.)
I have a question though...
I would really like for my towns to have a different timelapse rate than my world map. (60 for towns, 15 for world map.)
I tried changing it thought the script command with a parallel process in my towns, but to no avail. Am I missing something, or is there another way to achieve the same effect?
The script uses the TIMELAPSE constant so you cannot change it in-game unless you modify to script so that it will use a modifiable variable instead of the constant...
What he said! If you replace all instances of TIMELAPSE to $timelapse and then you can just
$timelapse = whatever
better use $game_variables[] whatever, so that the game will natively save the variable's value upon save/load... 🙂
Ooh that's a grand idea! In fact, that's what we're going with. Updated the script so it keeps timelapse in a game variable that you can edit as you please.
Wow! So many solutions *and* an updated script? You guys rock!
While I'm at it...I'm going to be putting a fatigue/exhaustion system in the game. The new two character states (fatigue progresses into exhaustion) would be based off of how long the party has been "awake". When they rest using a tent, or at an inn, it will remove those states. Now, I haven't really put too much thought into how to make this possible, only going so far as to have the Inn and Tents remove the state. So, is there a way for me to reference the game time and then set, say, 12 hours 'til fatigue and 24 to exhaustion from when the party awoke?
I was also thinking the time they awake would also be dynamic. Something like 8 hours after they go to sleep, they'd wake up. (Even though waking up at a set time would be easier, it would lead to scenarios where a player could have 10 minutes of sleep and be fully rested...)
EDIT:
Whoops, nearly forgot! Vlue, what name should I credit you by? I currently have Daimonious, but should I be putting Vlue? (Or perhaps, a secret THIRD option...?)
If ever presented with a secret third option, always say yes. But really, either is fine. Vlue's the screen name I go by and Daimonious Tails be the business name~
If you set a variable after you remove the state to the current hour.. like...
Game Variable > Script: GameTime.hour?
You can then run a whatever event to check how long it's been with script option under conditional branch like:
GameTime.hour? >= $game_variables[whatevernumber] + 12
etc. etc.
And you can jump forward in time with the set command (why set changes and change sets I don't know). For example:
GameTime.set("addhour", 8)
jumps time forward by 8 hours
Vlue it is then! (It's shorter, therefore it wins!)
Now on to the topic at hand...thank you, thank you, THANK you!
I had no idea to actually change the value you had to type "set" after GameTime. Drove me insane, it did.
The solution to my first problem seems like it would work, but it seems like it would only work after an initial, third, trigger. But I could work with that. Just put an event that gets the ball rolling when I want to, well, get the ball rolling.
An interesting problem has arisen, however.
The game will stop processing the timer when it strikes midnight (00:00). My game by default starts at 11:00 and gets the first timer (fatigue) to hit at 23:00. But then, the exhaust timer never activates. At first I thought it was a problem with my eventing, but then I had this hunch and I changed the script to be "GameTime.hour? >= $game_variables[whatevernumber] + 3" so both timers would run out before midnight. Sure enough, they both ran out and activated said status effects.
Any thoughts on how to tackle this new, daunting foe?
Right, only 24 hours in a day... conditional branch that lowers the variable by 24 if its above 24
Naw naw, you set the variables to GameTime.hour? + 12, then run that conditional branch, then do the regular check of just
GameTime.hour? > $game_variables[id]
at the top of each event
Just because i had this problem:
6 < 23
Let's say, you want to do something between 20 and 6 o'clock. Then, you have to create a conditional branch from 20-23 and in it's else condition, you have to create a 2nd conditional branch from 0-6 o'clock.
I know, this is just logical, but maybe there's someone with a similar problem 😉
Eureka! It works! After multiple tests with different times, it STILL works! Thank you for your help with this!
It's funny, when I first was messing with this I established the fatigue variable's value in the rest event proper, but I moved it in the fatigue event itself when I was screwing around. Can't believe I forgot to move it back...
I'm going to implement a variable and actor check into these strings so I can have an actor have a custom message about how tired they feel. When I finish that, I'll upload some pics of my completed event pages, so others can easily reference them. (I could even see people using such an idea for other things besides a fatigue system as well!)
How would i go about making an event happen on a certain date? Like, on monday, of august, in 1956. Something happens.
I know how to test for the certain times, but how would i test for the day/month/year?
Just several concurrent cond. branches. For Monday, August, 1956:
GameTime.day_week? == 1 && GameTime.month == 8 && GameTime.year == 1956
Thank you, just wasn't too sure whether i would use numbers, or write out the actual day.