Time Of Day Clock

Status
Not open for further replies.
You cannot access the system of a computer wih raw WC3.
You can however set the day duration to a full 24h (86400 seconds) day.
You can make a player be able to set the time of the day with triggers and so you can simulate the Time of Real Day.

You have to give a player the right to change the day and I assume that that is not exacly how you wanted it. I think you want to restrict people to play at a certain time to achieve something.
 
shown in-game time

peace of cake.
  • Events
    • Time - Every 1 sec of game Time
  • Conditions
  • Actions
    • Set TimeCounterInteger = TimeCounterInteger + 1
you can now display this with a timerdialog

In case if you doesen't refered to REAL time BUT the day time.
then you can still do the same if you know what is the day-time speed
you can set it via trigger
if the speed is like 10min for a total day (for e.g.)
then 10min=24h(ingame)=1440min(ingame)
then 1min=144min(ingame)=8640sec(ingame)
then 1sec=144sec(ingame)
changes
  • Set DayTimeCounter=DayTimeCounter+144
display with timer dialog

for the second version I think only h and min should be displayed . U can separate variables for the display mechanic instead of using one
  • Set DayTimeCounterM = DayTimeCounterM + 2
  • Set DayTimeCounterS = DayTimeCounterS + 24
  • If -
    • Conditions
      • Condition DayTimeCounterS Greater then 59
    • Then - Actions
      • Set DayTimeCounterS = DayTimeCounterS - 60
      • Set DayTimeCounterM = DayTimeCounterM +1
Same for hour
if DayTimeCounterM>59 then
Set DayTimeCounterM = DayTimeCounterM - 60
Set DayTimeCounterH = DayTimeCounterH +1
 
peace of cake.
  • Events
    • Time - Every 1 sec of game Time
  • Conditions
  • Actions
    • Set TimeCounterInteger = TimeCounterInteger + 1
you can now display this with a timerdialog

In case if you doesen't refered to REAL time BUT the day time.
then you can still do the same if you know what is the day-time speed
you can set it via trigger
if the speed is like 10min for a total day (for e.g.)
then 10min=24h(ingame)=1440min(ingame)
then 1min=144min(ingame)=8640sec(ingame)
then 1sec=144sec(ingame)
changes
  • Set DayTimeCounter=DayTimeCounter+144
display with timer dialog

I'm know how to done it ,thanks .But what I need is show the time at "Time of day " .Like hero line defense .
 
Why not pick every player in map and
(If/Then/Else)
If player food used equal to 59

Then,
Add 1 to lumber
Set player food used to 0

Else,
Add 1 to food used

Why don't like this?

That would remove lumber as well from the usable resources, so it is not viable.
 
Go to the terrain editor then go Advanced -> Gameplay Constants. Way down at the bottom you see Time - Real seconds per day time. Set it to 86400.
I think that the game always starts at 00:00 but if that is not true, then make a trigger for map initialization or add an action to an exising map initialization trigger "Game - Set time of day 0.00".

That should do the trick.
 
Go to the terrain editor then go Advanced -> Gameplay Constants. Way down at the bottom you see Time - Real seconds per day time. Set it to 86400.
I think that the game always starts at 00:00 but if that is not true, then make a trigger for map initialization or add an action to an exising map initialization trigger "Game - Set time of day 0.00".

That should do the trick.

That's right , but the time can only contain 00:00 until 24:00 how i extend it ?

The way you give is in Hour and minute , i needed is Minute and second . BTW , i have done it in minute and second! Thanks for your helped .:D
 
Last edited:
Status
Not open for further replies.
Back
Top