• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Need Info] Trigger help: Day/Night cycle

Status
Not open for further replies.
Level 4
Joined
Jun 30, 2014
Messages
72
Does the day/night cycle require me to set timers? That seems silly, since the game appears to have a natural day/night cycle that can be turned on.

Does the Time of Day work like WC3, as in 00:00:00 is midnight, 06:00:00 is daybreak, 12:00:00 is noon, and 18:00:00 is nightfall?

I've noticed that the Editor can make custom events, I tried making one that triggers upon reaching a certain time of day (like WC3: Event - Time of Day), but I seem to be doing it wrong.

What I really need to know is "what am I doing wrong?"

Here are the screenshots:
Custom Event:
CustEventScreenshot.PNG


Init Trigger: (This will get revised when I properly organize the triggers)
InitTriggerScreenshot.PNG


Daybreak:
DayTriggerScreenshot.PNG


Nightfall:
NightTrigger Screenshot.PNG


I can't see a reason for the basic idea not working. My version of it clearly needs work.
Will reply to posts by updating this post, "EDIT:mad:YourUsername"

@Dr Super Good: I haven't seen anything that changes the number of hours in a day (it works as a 24-HR clock), just changing how many seconds are in one 24-HR period.The day/night cycle isn't changing the lighting the way you say it should. That's part of my problem. Also, could you put your advice about custom events in non-programming terms (that I can understand)? Or post an example of how do to it?
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,199
Does the Time of Day work like WC3, as in 00:00:00 is midnight, 06:00:00 is daybreak, 12:00:00 is noon, and 18:00:00 is nightfall?
You can set how many hours per day, and at what state the lightning is.

I've noticed that the Editor can make custom events, I tried making one that triggers upon reaching a certain time of day (like WC3: Event - Time of Day), but I seem to be doing it wrong.

What I really need to know is "what am I doing wrong?"
You seem to be doing nothing. Like in WC3, events correspond to function calls against the underlying trigger. Unless you do something to that trigger then logically nothing will happen.

The process of creating a custom event is to use the custom event native on the trigger with a unique message identifier for that type of event in the form of a string (eg the name of the event). You then use the event broadcast native given the same unique string when you want the event to fire. You can even pass event specific content using local data table and promoting those values before issuing the broadcast event call.

That said I doubt this functionality is of any use to what you are doing.

Once you start the appropriate day/night lighting model it should automatically cycle through it. You can synchronize this with game time so that periodic events correspond to regular time intervals.
 
Status
Not open for further replies.
Top