• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Time Of Day Clock

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
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.
 
Level 12
Joined
Oct 16, 2010
Messages
680
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
 
Level 7
Joined
Feb 28, 2014
Messages
185
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.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
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.
 
Level 7
Joined
Feb 28, 2014
Messages
185
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.
Top