Day and Night Check

Juno**

Member
Reaction score
6
Hey guys, I am creating passive skill that boosts the attack speed, movement speed and damage of the hero when it's night (similar to Balanar's Hunter in the Night skill in DOTA for those who know) My problem here is checking if it's day or if it is night.

Here is my check which is failing utterly:
Trigger:
  • Events
    • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Skills_UnitGroup_EntireMap and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Serpent god
              • (Level of Nocturnal Hunter for (Picked unit)) Greater than 0
              • ((Picked unit) has buff Nocturnal Hunter ) Equal to True
              • (In-game time of day) Greater than 6.00
              • (In-game time of day) Less than 18.00
            • Then - Actions
              • (Insert Actions That remove the buff here)
            • Else - Actions


Trigger:
  • Events
    • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Skills_UnitGroup_EntireMap and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Serpent god
              • (Level of Nocturnal Hunter for (Picked unit)) Greater than 0
              • ((Picked unit) has buff Nocturnal Hunter ) Equal to False
              • (In-game time of day) Greater than or equal to 18.00
              • (In-game time of day) Less than or equal to 6.00
            • Then - Actions
              • (Insert Actions that Give the Bonuses to the Serpent god)
            • Else - Actions


I wanted it to check every second because, you know, players might learn it in the middle of the night and Game - The in-game time of day becomes Equal to 18.00 is not the event to be used here.... Could you guys suggest any Day night checks for this skill???
 

Solu9

You can change this now in User CP.
Reaction score
216
Have you tried

Trigger:
  • Untitled Trigger 001
Trigger:
  • <s>Events</s>
    • <s>Conditions</s>
    • <s>(In-game time of day) Greater than or equal to 10.00</s>
    • <s>Actions</s>


It is a "real" condition

Edit:
In case you are wondering what to set the number to. I believe it is based on the amount of seconds in an in-game day which you can change under the gameplay constants.
 

thorhunter

You can change this now in User CP.
Reaction score
32
You can use 'Time of Day' event to add abilities to units and 'Hero learns' ability event to register all cases. But what I would do is make the ability require some dummy unit in upgrades and each 18.00 and 6.00 time of day create and remove this unit from each player.
 

Imp Midna

Active Member
Reaction score
52
Personal guess: gametime is a value between 0-24 and can not possibly be over 18 and below 6 at the same time for that reason, so the second trigger that applys the skill will mostlikely never fire. Might try putting an OR-Condition into it.

If you decide to use game time event, just make the trigger that lets the players set the game time run this trigger manually, it will have the same effect and save few recources. Just write that somewhere so you dont forget about it when making the change day time spell.
 

Juno**

Member
Reaction score
6
So, real problem here was that I forgot to put the OR-Condition to the check.. I have also made it so that every time the hero learns the skill, it updates the skill's buff by replacing it with another... Thanks for the help guys!

EDIT:
Just a bit of a question... When using the item ability that changes time (the night elf item, it turns the indicator purple in color) will it be possible to detect if the item is under effect even if the hero isn't using one? like when there is another hero that changes day into night.. will it be possible to detect?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top