DayNightEvent v1.0B

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: MorAltorik
DAY NIGHT EVENT
IMPORT GUIDE :
1. Enable "Tick the Automatically create unknown variables ..." located at File>Preference>General
2. Copy the Day Event and Night Event units in the object editor
3. Copy the DayNightEvent folder in the trigger editor
4. Configure the Config trigger
SYSTEM INFORMATION :
Provides a boolean and two events that can be used to detect whether the game-time is currently Day or Night.
VariableResult
IsDay (Boolean)Returns TRUE on Daytime and FALSE on Nighttime
DayNightEvent == 1.00 (Real)A real variable that triggers during Daytime
DayNightEvent == 2.00 (Real)A real variable that triggers during Nighttime
MEDIA SHOWCASE :
CHANGELOG :
Version 1.0B: Changed method
Version 1.0: Released

CREDIT :
Antares - Discussion for method selection
Nestharus - DayNightEvent vJass version (v1.0)
azlier, J4L - Original Implementation vJass (v1.0)
Ricola3D - Classification of Systems Thread
Contents

DayNightEvent (Map)

Reviews
Antares
Works as intended. Useful for triggering events at dawn and nightfall. You could also add a midnight event. Simple
This seems unnecessarily complicated 🧐.
  • Trigger - Add to DNEEvent <gen> the event (Game - The in-game time of day becomes Greater than or equal to 6.00)
  • Trigger - Add to DNEEvent <gen> the event (Game - The in-game time of day becomes Greater than or equal to 18.00)
?

Moonstones, I guess?
 
Last edited:
This seems unnecessarily complicated 🧐.
  • Trigger - Add to DNEEvent <gen> the event (Game - The in-game time of day becomes Greater than or equal to 6.00)
  • Trigger - Add to DNEEvent <gen> the event (Game - The in-game time of day becomes Greater than or equal to 18.00)
?
What if the time was altered to 01:00 during daytime (between 06:00 and 18:00) for example? (The event won't trigger since both events are not met)
What if spells like Moonstone intervene with the game-time? (On daytime, same case as above)

On the other hand, I would agree it looks complicated, but it is a good way found by J4L (according to azlier's thread [Snippet] DayNightEvent) for effective detection against shenanigans such as moonstone. Busterkomo argued it makes sense to just detect the moonstone use, but there's a lot of other potential shenanigans depending on what the end user doing with their map, which is tricky to address if we relies on the in-game time.

EDIT:
Not sure why I didn't quote this one.
Moonstones, I guess?
Yes. That and any shenanigans that might somehow user thought as 'brilliant' (say, reverse day and night cycle for example)
 
Last edited:
I am quite convinced you can account for moonstones and other shenagigans with a few more lines of logic.

-Detect if the game time becomes greater than 18 or less than 6 for it to become night. Turn off the trigger when it's already night.
-Detect if the game time becomes greater than 6 or less than 18 for it to become day. Turn off the trigger when it's already day.
 
I am quite convinced you can account for moonstones and other shenagigans with a few more lines of logic.

-Detect if the game time becomes greater than 18 or less than 6 for it to become night. Turn off the trigger when it's already night.
-Detect if the game time becomes greater than 6 or less than 18 for it to become day. Turn off the trigger when it's already day.
Of course adding more lines can work, but since I have seen both azlier and Nestharus implemented this beforehand and I think they also had a reason why this instead of playing with game time.

However, if this is not an approvable approach, I'd rather not enforce my view on the matter and go ahead with whatever decision made for the resources :)
 
The resource you linked to is 14 years old. Maybe some natives were not available back then, I don't know. It was also graveyarded, albeit not for the reasons we're discussing here.

If you can come up with a situation where checking the daytime doesn't work, I'll approve it, but as far as I know, all methods to create an artificial night involve changing the daytime.
 
The resource you linked to is 14 years old. Maybe some natives were not available back then, I don't know. It was also graveyarded, albeit not for the reasons we're discussing here.

If you can come up with a situation where checking the daytime doesn't work, I'll approve it, but as far as I know, all methods to create an artificial night involve changing the daytime.
The native in-game native already existed since back in 2010, so it is not a new native. I have tested tried to run your approach and it seems to handle most cases well, at least ones I can come up with. I will concede.
 
Top