• 🏆 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!

help, how do i turn on day/night using triggers

Status
Not open for further replies.
Level 9
Joined
Apr 7, 2010
Messages
480
i have replaced the time indicator to a blank model, i also have edited to stop the day/night cycle, also set the day speed to 0.00% of the default speed.

but i want to add a trigger that has its own timer, for example if the timer expired then its day or if it reaches a certain number its morning then the number resets, then the next certain number it reaches would be night.

i just want to prevent the players to know when its going to be day or night.

--> i also tried to remove only the time indicator, didn't work, if the players move his/her mouse to where the time indicator should be, then a tooltip appears telling the time.

so how would i do these in triggers?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
  • Trigger
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Time = (Time + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Time mod 15) Equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Day Equal to True
            • Then - Actions
              • // Do your actions here for when the night begins
              • Set Day = False
            • Else - Actions
              • // And here should be your Day-actions
              • Set Day = True
        • Else - Actions
You need to change "(Time mod 15) Equal to 0" to "(Time mod [DAY NIGHT CYCLE TIME])" (in seconds).
If day/night last 3 minutes, then you put "180" there.
 
Level 9
Joined
Apr 7, 2010
Messages
480
how many minutes does the original warcraft have for day and night?

i don't know the effects of day/night of warcraft other than unit's vision decreases when night. i've search the game category in triggers, nothing showed up that allows the game to set automatically at night or day, but..

--> i have tried this one, set the time of day to 18.00 (for night)
set the time of day to 6.00 (for day)

if i do these, does the day/night effect works?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Nope. Modulo kind of does that for you :D

To give you an idea of how modulo works:

100 Mod 50 will return "0", because 100 can be divided by 50.
100 Mod 75 will return "25", because the nearest number 100 can be divided by is 25 away (either 50 or 100).
100 Mod 99 will return "1", as 100 cannot be divided by 99, but 100 itself can (1 away from 99).
100 Mod 1 will return "0", as 100 can be divided by 1 (all numbers can).


If you ever want to check whether a number is even or odd, do [Number] Modulo 2.
If the number is even, the result will be 0, else the result will be 1.
 
Level 9
Joined
Apr 7, 2010
Messages
480
so if both day and night last 240 seconds, i should put (Time mod 240) Equal to 0

is this correct?

  • Trigger
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Time = (Time + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Time mod 240) Equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Day Equal to True
            • Then - Actions
              • Game - Set the time of day to 18.00
              • Set Day = False
            • Else - Actions
              • Game - Set the time of day to 6.00
              • Set Day = True
        • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top