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

[Solved] Day/Night passive skill

Status
Not open for further replies.
Hello Hive I want to make a passive skill for a basic unit and I want this skill to work only during night.
Captură ecran (918).jpg
Captură ecran (919).jpg
Captură ecran (920).jpg
This trigger only works for units that are trained before 10. If I train a bandit and the time is 10:11 that unit will have the passive to lev 1, any solution?
Thx +rep
 
Level 8
Joined
Feb 17, 2018
Messages
114
so if I understand everything right:

your level-setting trigger triggers precisely when the clock hits a certain value. When the unit is trained at 10:11 there is not event that's like "time of the day becomes 10:11" or such. So I think you would require something like this in trigger #1:
before adding to group, once unit is trained make a codition-action to check time of the day, set the required level for an ability for the just trained unit, then add to a the group.
 
so if I understand everything right:

your level-setting trigger triggers precisely when the clock hits a certain value. When the unit is trained at 10:11 there is not event that's like "time of the day becomes 10:11" or such. So I think you would require something like this in trigger #1:
before adding to group, once unit is trained make a codition-action to check time of the day, set the required level for an ability for the just trained unit, then add to a the group.
  • DayNightLearn
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Level of ..War Drums for (Trained unit)) Equal to 1
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (In-game time of day) Greater than or equal to 10.00
        • Then - Actions
          • Unit Group - Add (Trained unit) to DayNightGroup
        • Else - Actions
Like this?
 
Level 8
Joined
Feb 17, 2018
Messages
114
I think like this:
  • DayNightLearn
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Bandit
    • Actions
      • -------- checks if it is night time --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (In-game time of day) Greater than or equal to 10.00
          • (In-game time of day) Less than or equal to 12.00
        • Then - Actions
          • Unit - Set level of War Drums for (Trained unit) to 2
        • Else - Actions
      • Unit Group - Add (Targeted unit) to DayNightGroup
aslo I think game uses 24 hour format, so if you look for 10 pm you should use 22.00 instead
 
Last edited:
I think like this:
  • DayNightLearn
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Bandit
    • Actions
      • -------- checks if it is night time --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (In-game time of day) Greater than or equal to 10.00
          • (In-game time of day) Less than or equal to 12.00
        • Then - Actions
          • Unit - Set level of War Drums for (Trained unit) to 2
        • Else - Actions
      • Unit Group - Add (Targeted unit) to DayNightGroup
aslo Ithink game uses 24 hour format, so if you look for 10 pm you should use 22.00 instead
No, is still not working.
Is there no solution? Pls
 
Last edited:
The first question, is your dusk and dawn (start the day and start night) time still 6 and 18?

The first trigger is okay as is. As for the second and third, it's kinda hard for my head to warp, since my definition of the night would be 18-24 and 0-6 if we use the default configuration. I'd go for an event that runs per 0.1-0.2 seconds and then do a time checking instead of relying on the wonky time of day event. If you rely on the events and go with the default:

1. Night: event when time >= 18:00, event when time <= 6:00 (this event already excludes all day bound times, so no conditions needed)
2. Day: event when time >= 6:00, condition when time <= 18:00

If your definition of Night is 22:00 (10:00 night) to 24:00/0:00 (midnight), I'd define as following:
1. Night: event when time >= 22:00
2. Day: event when time >= 0:00, condition when time <= 22:00

It just mostly depends on how you define the daytime and nighttime since the parameters adjust along that line.
 
The first question, is your dusk and dawn (start the day and start night) time still 6 and 18?

The first trigger is okay as is. As for the second and third, it's kinda hard for my head to warp, since my definition of the night would be 18-24 and 0-6 if we use the default configuration. I'd go for an event that runs per 0.1-0.2 seconds and then do a time checking instead of relying on the wonky time of day event. If you rely on the events and go with the default:

1. Night: event when time >= 18:00, event when time <= 6:00 (this event already excludes all day bound times, so no conditions needed)
2. Day: event when time >= 6:00, condition when time <= 18:00

If your definition of Night is 22:00 (10:00 night) to 24:00/0:00 (midnight), I'd define as following:
1. Night: event when time >= 22:00
2. Day: event when time >= 0:00, condition when time <= 22:00

It just mostly depends on how you define the daytime and nighttime since the parameters adjust along that line.
The reason why i set the time to 10 and 12 is because is easy for me to test the skill if is working or not . If is set to 18 and 6 i will need to wait every time 5 min to test the skill.
The problem with this trigger is that the skill will remain lev 1 if you train bandits during night. If you have 10 bandits trained before 18 they will get the buff but if you train units during 18:10-5:59 they will not get the buff.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,586
Are you sure you did it correctly?

This should be (Trained unit) not (Targeted unit):
  • Unit Group - Add (Targeted unit) to DayNightGroup
When a Bandit is trained you add it to the unit group. Then you check if it it's nighttime and adjust the level of the ability to 2 if that's the case. Then whenever it becomes day pick through each unit in the unit group and set their ability to level 1. Then whenever it becomes night pick through each unit in the unit group and set their ability to level 2. When a Bandit dies, remove it from the Unit Group.
 
Are you sure you did it correctly?

This should be (Trained unit) not (Targeted unit):
  • Unit Group - Add (Targeted unit) to DayNightGroup
When a Bandit is trained you add it to the unit group. Then you check if it it's nighttime and adjust the level of the ability to 2 if that's the case. Then whenever it becomes day pick through each unit in the unit group and set their ability to level 1. Then whenever it becomes night pick through each unit in the unit group and set their ability to level 2. When a Bandit dies, remove it from the Unit Group.

  • [/HEADING]
  • DayNightLearn
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Bandit
    • Actions
      • -------- checks if it is night time --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (In-game time of day) Greater than or equal to 10.00
          • (In-game time of day) Less than 12.00
        • Then - Actions
          • Unit - Set level of ..War Drums for (Picked unit) to 2
        • Else - Actions
      • Unit Group - Add (Trained unit) to DayNightGroup
  • [HEADING=2]

  • Day
    • Events
      • Game - The in-game time of day becomes Greater than or equal to 10.00
      • Game - The in-game time of day becomes Less than 12.00
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DayNightGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (In-game time of day) Greater than or equal to 10.00
            • Then - Actions
              • Unit - Set level of ..War Drums for (Picked unit) to 2
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from DayNightGroup
            • Else - Actions
  • Night
    • Events
      • Game - The in-game time of day becomes Greater than or equal to 12.00
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DayNightGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (In-game time of day) Greater than or equal to 12.00
            • Then - Actions
              • Unit - Set level of ..War Drums for (Picked unit) to 1
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from DayNightGroup
            • Else - Actions
Yes and is not working
 
Level 5
Joined
Aug 20, 2015
Messages
133
why bother with that
unit.gif
Unit - A unit Finishes training a unit ??


use event - Unit enters the map

then check for your ability, if its level more than 0
and also check what time is it now

then do needed actions - like set lvl of your ability or other stuff

and then u just need two triggers with dawn and dusk events to change your ability
 
why bother with that
unit.gif
Unit - A unit Finishes training a unit ??


use event - Unit enters the map

then check for your ability, if its level more than 0
and also check what time is it now

then do needed actions - like set lvl of your ability or other stuff

and then u just need two triggers with dawn and dusk events to change your ability
I tried that too, but I will try again
Update: yes thx so much is working fine now +rep
 
Last edited:
Here's the trigger if someone wants to do a skill similar to mine.
  • DayNightLearn
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Bandit
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (In-game time of day) Greater than or equal to 18.00
              • (In-game time of day) Less than 6.00
        • Then - Actions
          • Unit - Set level of Nightfighter for (Triggering unit) to 2
          • Unit Group - Add (Triggering unit) to DayNightGroup
        • Else - Actions
          • Unit Group - Add (Triggering unit) to DayNightGroup
  • Night Time
    • Events
      • Game - The in-game time of day becomes Equal to 18.00
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DayNightGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • Unit - Set level of Nightfighter for (Picked unit) to 2
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from DayNightGroup
            • Else - Actions
  • Day Time
    • Events
      • Game - The in-game time of day becomes Greater than or equal to 6.00
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DayNightGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • Unit - Set level of Nightfighter for (Picked unit) to 1
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from DayNightGroup
            • Else - Actions
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,586
If Bandits can only be created through training then I recommend using the Finishes training Event. This is more efficient than Enters map.

Your issue was this Event Response in the DayNightLearn trigger:
  • Unit - Set level of ..War Drums for (Picked unit) to 2
It should be (Trained unit).
 
Status
Not open for further replies.
Top