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

[Spell] Trigger not recognizing in-game time for Moonstone ability

Status
Not open for further replies.
Level 12
Joined
May 16, 2020
Messages
660
Hi guys,

I have 2 triggers which are supposed to recognize time changes, and for >6:00 am and >18:00 pm change the level of some abilities to 5.

For the natural daycycle these triggers work. However, if I change the game-time via Moonstone (to 00:00), the triggers fail to recognize the time as "midnight" (you will see two "kill" commands in the trigger - I added those just to test what happens. Via moonstone ability the Footman still lives)

Can anyone please point out what I'm doing wrong?

  • Day Comes
    • Events
      • Game - The in-game time of day becomes Greater than or equal to 6.00
    • Conditions
    • Actions
      • Unit - Set level of Crippling Fear (Active) for CripplingFear_Learner to 5
      • Unit - Set level of Hunter in the Night (Active) for HunterInTheNight_Learner to 5
      • Unit - Kill Peasant 0009 <gen>
  • Night Falls
    • Events
      • Game - The in-game time of day becomes Greater than 18.00
    • Conditions
    • Actions
      • Unit - Set level of Crippling Fear (Active) for CripplingFear_Learner to (Level of Crippling Fear for CripplingFear_Learner)
      • Unit - Set level of Hunter in the Night (Active) for HunterInTheNight_Learner to (Level of Hunter in the Night for HunterInTheNight_Learner)
      • Unit - Kill Footman 0006 <gen>
This trigger gives more context on the above variables, but it's not part of the trigger:
  • Hunter in the Night Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Hunter in the Night
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Learned skill level) Equal to 1
        • Then - Actions
          • Set VariableSet HunterInTheNight_Learner = (Triggering unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Day Comes <gen> is on) Equal to False
                  • (Night Falls <gen> is on) Equal to False
            • Then - Actions
              • Trigger - Turn on Day Comes <gen>
              • Trigger - Turn on Night Falls <gen>
            • Else - Actions
          • Unit - Add Hunter in the Night (Active) to HunterInTheNight_Learner
          • 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 18.00
                  • (In-game time of day) Less than 6.00
            • Then - Actions
              • Unit - Set level of Hunter in the Night (Active) for HunterInTheNight_Learner to (Level of Hunter in the Night for HunterInTheNight_Learner)
            • Else - Actions
              • Unit - Set level of Hunter in the Night (Active) for HunterInTheNight_Learner to 5
        • Else - 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 18.00
                  • (In-game time of day) Less than 6.00
            • Then - Actions
              • Unit - Set level of Hunter in the Night (Active) for HunterInTheNight_Learner to (Level of Hunter in the Night for HunterInTheNight_Learner)
            • Else - Actions
              • Unit - Set level of Hunter in the Night (Active) for HunterInTheNight_Learner to 5
 
Level 12
Joined
May 16, 2020
Messages
660
Just add the event "Unit begins the effect of an ability" and condition "Abilty being cast equal to Moonstone" and create another one that remove the changes when the moonstone ends.

Thanks for the answer! I thought about this, but ideally I'd like to really make it dependent on time, not ability being cast. Reason being that maybe other heroes can change the time as well, and if so, the current trigger would bug out. If possible it's just a lot more elegant...
 
Level 24
Joined
Jun 26, 2020
Messages
1,853
Thanks for the answer! I thought about this, but ideally I'd like to really make it dependent on time, not ability being cast. Reason being that maybe other heroes can change the time as well, and if so, the current trigger would bug out. If possible it's just a lot more elegant...

Ok, but just make the trigger of the end only works if the spell ends, you can do:

  • Spell
    • Events
      • Unit - A unit begins the effect of an ability
    • Conditions
      • Ability being cast equal to Moon Stone
    • Actions
      • Set Remaing_time equal to Time_of_effect
      • -------- Add your buffs --------
      • Trigger - Turn on Confirmer
  • Confirmer
    • Events
      • Time - Every 1.00 seconds
    • Conditions
    • Actions
      • Set Remaing_time equal to Remaing_time - 1
      • If (All conditions are true) then do (Then actions) else do (Else actions)
        • Conditions If:
          • Remaing_time equal to 0
        • Actions Then:
          • -------- Remove your buffs --------
          • Trigger - Turn off This trigger
        • Actions Else:
 
Last edited:
Status
Not open for further replies.
Top