You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Guide: The ULTIMATE Scenario Clock System
posted 23 December 2007 10:58 AM EDT (US)   


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


Mephilles for the Trigger Templates.
The Purple People Eaterfor the awesome banners!


Navigation




Trigger 1- The Second Digit in the Minutes Place 6:31 PM

Triggers
Trigger_1







Condition
Timer1


Effect
QV ModifyVar Name Min2
Operator +
Value 1


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).


Trigger 2- The First Digit in the Minutes Place 6:31 PM

Triggers
Trigger_2







Condition
QV CheckVar Name Min2
Operator =
Value 10


Effect
QV ModifyVar Name Min2
Operator -
Value 10

Effect
QV ModifyVar Name Min1
Operator +
Value 1


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.


Trigger 3- The Hours Place 6:31 PM

Triggers
Trigger_3







Condition
QV CheckVar Name Min2
Operator =
Value 10


Effect
QV ModifyVar Name Min2
Operator -
Value 10

Effect
QV ModifyVar Name Min1
Operator +
Value 1


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?


Trigger 4- Changing 13:00 to 1:00 Automatically 1:00 PM

Triggers
Trigger_4







Condition
QV CheckVar Name Hour
Operator =
Value 13


Effect
QV ModifyVar Name Hour
Operator -
Value 12

Effect
QV ModifyVar Name M
Operator +
Value 1


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.


Trigger 5- Changing M from 3 to 1 Automatically 6:31 PM

Triggers
Trigger_5







Condition
QV CheckVar Name M
Operator =
Value 3


Effect
QV SetVar Name M
Value 1


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.


Trigger 6- Displaying your clock in AM 6:31 AM

Triggers
Trigger_6







Condition
QV CheckVar Name M
Operator =
Value 1


Condition
Timer 1


Effect
FakeCounter Set Text"+(1*trQuestVarGet("Hour"))+": "+(1*trQuestVarGet("Min2"))+""+(1*trQuestVarGet("Min1"))+" AM


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.


Trigger 7- Displaying your clock in PM 6:31 PM

Triggers
Trigger_7







Condition
QV CheckVar Name M
Operator =
Value 2


Condition
Timer 1


Effect
FakeCounter Set Text"+(1*trQuestVarGet("Hour"))+": "+(1*trQuestVarGet("Min2"))+""+(1*trQuestVarGet("Min1"))+" 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!


Trigger 8- Giving your clock a starting time 6:31 PM

Triggers
Trigger_7







Condition
Always 


Effect
QV SetVar Name Hour
Value Whatever you want!


Effect
QV SetVar Name Min1
Value Whatever you want!


Effect
QV SetVar Name Min2
Value Whatever you want!


Effect
QV SetVar Name M
Value 1 or 2 (1=AM, 2=PM)


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


[JPEG, (283.96 KB)]




By TartarianCerberus
WebsiteEmailProfile


Cerberus- The three headed guard dog who guards the entrance to Hades; son of Typhon.

[This message has been edited by TartarianCerberus (edited 07-10-2008 @ 06:20 PM).]

Replies:
posted 23 December 2007 11:43 AM EDT (US)     1 / 9  
This guide should be put on the website's guides page.

MEPH
[Insert amazingly witty signature here.]

Me and Yeebaagooon's scenarios | Download The Corruptor
posted 23 December 2007 11:43 AM EDT (US)     2 / 9  
You are getting good with these banners . Good guide, and I usually use counter add timer but make it start at 0 and go up to whatever I want.

@ Mephiles

I have asked Papaya and he has fowarded it to Zen, this happened a whileago, so when he approves I can add the recent guides .

______________________________________ Yeebaagooon ______________________________________
____________________ AoMH Seraph ____________________
"You can't trust yeebaagooon to lead a rebelion, He would send everyone to steal mirrors so he could bask in his own brilliance." - Out Reach
"Yeebaagooon had never seen a more handsome man in all his life. He couldn't control himself, He needed to act. Gripping the mirror in his strong arms he kissed the figure before him..." - Out Reach
AoMH: Unfinished Scenarios|Singleplayer: Codename Ripto|Multiplayer: Minigames Z|CSC 7
Ex Seraphs Dictator, Spore Heaven Seraph

[This message has been edited by Yeebaagooon (edited 12-23-2007 @ 11:44 AM).]

posted 23 December 2007 01:39 PM EDT (US)     3 / 9  
Excellent!!! I also use a time system in my RPG. However, I just use one QV, which represents all times. So QV 930 would for example represent 03:30 PM. (or 15:30 as we say in Sweden)

But this new clock system of yours is by far the best!

By the way... In my scenario I use overlay text to show the current time but it refuse to show if it's AM or PM.
Is it because...

"+(1*trQuestVarGet("Hour2"))+""+(1*trQuestVarGet("Hour1"))+": "+(1*trQuestVarGet("Min2"))+""+(1*trQuestVarGet("Min1"))+" AM

...is to much text?

New member of Tsunami Studios

The Relic of Water (4.3) | The Relic of Darkness (4.6)
Quam-diu prudentiam habeis, victoria non procul est!

Geniet
posted 23 December 2007 01:45 PM EDT (US)     4 / 9  
What does Hour2 represent? I'm not sure why it wouldn't work in overlay, fakecounter works the best.

Banners are all PPE's doing...

Cerberus- The three headed guard dog who guards the entrance to Hades; son of Typhon.

[This message has been edited by TartarianCerberus (edited 12-23-2007 @ 01:47 PM).]

posted 23 December 2007 01:56 PM EDT (US)     5 / 9  
hour2 represents 04:30 (does it look weird to you?)

Well, it maybe works better with a fake counter, but my intention is not to show the clock all the time. Only when you select the "Statue of Time". So it would look better with overlay text.
Perhaps I should change to a permanent clock though.

(sorry for using two accounts, but I forgot that I was logged in with "geniet" :P)

[This message has been edited by Lupus (edited 12-23-2007 @ 01:58 PM).]

posted 01 January 2008 11:29 AM EDT (US)     6 / 9  
w00p, newsied

Cerberus- The three headed guard dog who guards the entrance to Hades; son of Typhon.
posted 01 January 2008 12:19 PM EDT (US)     7 / 9  
Great guide. I might try to use this one day



Sweet baby maizes!
posted 02 January 2008 03:10 AM EDT (US)     8 / 9  
What’s that, you say? There’s a 0 in the hours place! Oh noes! Whatever shall we do! Make a starting time, perhaps?


Trigger_8:
Active, Run Immediately
Conditions:
Always
Effects:
QV Set
Var Name: Hour
Value: (Whatever you want!)
QV Set
Var Name: Min2
Value: (Whatever you want!)
QV Set
Var Name: Min1
Value: (Whatever you want!)
QV Set
Var Name: M
Value: (Whatever you want!)
Just curious, but was this the only thing you added onto my guide?
posted 02 January 2008 04:24 PM EDT (US)     9 / 9  
No, you had a military clock. This uses an Am-PM clock. Also, your guide was only demonstrated in a scenario and this guide is written out.

Cerberus- The three headed guard dog who guards the entrance to Hades; son of Typhon.
Age of Mythology Heaven » Forums » Scenario Design » Guide: The ULTIMATE Scenario Clock System
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Mythology Heaven | HeavenGames