As used in...
Summary
A guide on how to make an easily-customizable AM-PM clock in your scenarios. In the examples used in this guide, 1 minute game time = 1 second real time. You can easily change this, however.
Requirements
A thorough understanding of Quest Vars - if you do not know what Quest Vars are I suggest you read this guide.
NO custom triggers, mods, or utilities required!
Notice
This guide is an improved version of a clock system I read about in Keron Cyst's Clock Trigger Guide. I changed it from a military clock into an AM-PM clock, and wrote it out in a guide (Keron's version was a scenario version).
Other credits
Navigation
|
|
|
Recap: Trigger 1
This trigger increases the value of Min2 (the second minute digit) every second. So every second that goes by in real-life, a minute goes by in the game. You can change this by customizing the timer value (if you want a game minute to be less than one real second, you can always change it to a Timer MS, simply increase the regular timer to make a game minute more than one real second).
|
|
|
|
Recap: Trigger 2
This trigger increases the value of Min1 (the first minute digit) by one and reduces the value of Min2 (the second minute digit) whenever Min 2 reaches zero. So instead of having a clock that says 6:031PM we have a clock that says 6:31PM. So now that we have are minute digits set up, let's take a look at the hours.
|
|
|
|
Recap: Trigger 3
So whenever the first minute digit reaches 6 (meaning 60 minutes total, equal to one hour), we reset the first minute digit to 0 by subtracting 6 (meaning both minute digits are now 0, since we just got that 6 through Trigger_2, which reset the second digit in the minutes place to 0) and add 1 to the hour place. But what happens when our hours reach 13? We don’t want this to be a military clock, right?
|
|
|
|
Recap: Trigger 4
This means that when the hours reach 13 (which would make it 13:00, which is only displayed on military clocks), it automatically goes back to 1:00 (not 0!). Also, Trigger_4 increases M by 1. We will make the clock AM when M=1 and make the clock PM when M=2. However, we don't want to have to make conditions for when M=3,4,5,6,etc. So, in our next trigger we will reduce M to a value of 1 whenever it is increased to a value of 3.
|
|
|
Recap: Trigger 5
So, whenever M reaches 3, it goes back down to 1, allowing the AM-PM part of your clock system to work accurately forever (or as long as it takes for your computer to overheat/freeze/crash/get a trojan/etc). However, we now have to get your beatiful timekeeping creation to be displayed in your scenario. Since AoM can't save letters as QV Values, we will have to create two display triggers: one for when the time in your scenario is AM, another for when the time in your scenario is PM.
|
|
|
|
Recap: Trigger 6
Make sure you copied that code for FakeCounter correctly or your clock won't display properly! Also, the Timer condition is very important. Without it, you're in for quite a big lagstorm. Now, onto PM.
|
|
|
|
Recap: Trigger 7
Good job! We're on the home stretch now, only one trigger left! Right now, if you playtest your map, your clock will not show up. That's because M=0, and your clock will only display if M=1 (AM) or if M=2 (PM). And if you add a QV Set to make M equal to 1, yoru clock will start out at 0:00 AM. So, we need to add a starting time. The format of your clock when setting the time or using the time in conditions is: (Hour)Min1)(Min2) (M) , Hour being the hour, Min1 being the first digit in the minutes place, Min2 being the second digit in the minutes place, and M being AM/PM. So, let's make your eigth and final trigger needed to set up your clock system!
|
|
|
|
|
|
Recap: Trigger 8
And there’s our starting time! So, are you now farmiliar with how this system works? Good. Just use these Quest Vars with various values in conditions to make events happen at certain times. What kind of events, you ask? Why, the possibilities are endless! A day to night cycle? People leaving town at night? A shop that is only open from 10AM-11AM? 10,000 gold if you stand on a hill at midnight? Be creative!
Screenshot
[This message has been edited by TartarianCerberus (edited 07-10-2008 @ 06:20 PM).]