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

Need trigger help on a Day/Night passive ability

Status
Not open for further replies.
Level 10
Joined
Sep 3, 2009
Messages
458
Greeting's everyone I'm neku99 and I apparently need your help again. Here's the ability:

Stealth(actually I'm thinking of another name)

At day time:

Stealth - [Day]

Gives a 15% chance to evade an attack.

At night time:

Stealth - [Night]

Gives a 30% chance to evade an attack and appear transparent.

And then here's the trigger:

  • Stealth
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in HeroGroup and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Stealth (Neutral Hostile) for (Picked unit)) Not equal to (!=) 0
            • Then - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Multiple ConditionsOr - Any (Conditions) are true
                    • Conditions
                      • (In-game time of day) Greater than or equal to (>=) 6.00
                      • (In-game time of day) Less than (<) 18.00
                • Then - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                  • Unit - Set level of Stealth (Neutral Hostile) for (Picked unit) to 1
                • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Multiple ConditionsOr - Any (Conditions) are true
                        • Conditions
                          • (In-game time of day) Less than (<) 6.00
                          • (In-game time of day) Greater than or equal to (>=) 18.00
                    • Then - Actions
                      • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 5.00% transparency
                      • Unit - Set level of Stealth (Neutral Hostile) for (Picked unit) to 2
                    • Else - Actions
            • Else - Actions


I don't know what I'm doing wrong here. It should work, but it ain't doing what it's supposed to do. Can someone please help me. Help is highly appreciated.

+Rep too~ ^_^
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
firstly,you should change your event,

you should not have any event that repeats more than 1 second of game (accept if its very short any easy like game texts)


better use this event,

  • Events
    • Game - The in-game time of day becomes Equal to 12.00
and i think your hero group is wrong,you should set the hero group every time when you want to use the trigger

variables just store things,so your hero group does not include new heroes if it is not set again
 
Level 20
Joined
Feb 24, 2009
Messages
2,999
Try this:

  • Melee Initialization
    • Events
      • Game - The in-game time of day becomes Equal to 5.59
      • Game - The in-game time of day becomes Equal to 23.59
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (In-game time of day) Less than 23.59
        • Then - Actions
          • Unit Group - Remove all units from HeroGroup
          • Unit Group - Add DesiredUnit to HeroGroup
          • Unit Group - Pick every unit in HeroGroup and do (Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency)
          • Unit Group - Pick every unit in HeroGroup and do (Unit - Set level of Stealth for (Picked unit) to 1)
        • Else - 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 23.59
        • Then - Actions
          • Unit Group - Remove all units from HeroGroup
          • Unit Group - Add DesiredUnit to HeroGroup
          • Unit Group - Pick every unit in HeroGroup and do (Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 5.00% transparency)
          • Unit Group - Pick every unit in HeroGroup and do (Unit - Set level of Stealth for (Picked unit) to 2)
        • Else - Actions
          • -------- Does Nothing --------
Note the above leaks a bit, so if it's for a multiplayer map you might want to fix that. If not, I doubt you'll notice any performance issues...

Oh and make sure you have actually given said unit the ability, 'Set Level' only works if they already have it (doesn't matter what level) - but it won't 'add it'.
 
Level 10
Joined
Sep 3, 2009
Messages
458
firstly,you should change your event,

you should not have any event that repeats more than 1 second of game (accept if its very short any easy like game texts)


better use this event,

  • Events
    • Game - The in-game time of day becomes Equal to 12.00
and i think your hero group is wrong,you should set the hero group every time when you want to use the trigger

variables just store things,so your hero group does not include new heroes if it is not set again

Well I did what you told me but it didn't work, you gave me an idea. I tried it didn't work. Then I found this tutorial on day/night passives and I'm gonna try that. Thanks anyway, particularly on the giving me an idea. ^.^

+rep


Edit : Oh and I already set the unit in the HeroGroup var. It will add units once you have picked a hero.

Edit: Oh Grey Nightmare I'll try you trigger apparently you just ninjad me. sort of haha

Stand by~ lol

EDIT:

Well I came out with this from your trigger and it seems very same but it's not working? Did you try it out?

  • Stealth
    • Events
      • Game - The in-game time of day becomes Equal to 5.59
      • Game - The in-game time of day becomes Equal to 23.59
    • Conditions
    • Actions
      • Unit Group - Pick every unit in HeroGroup and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of (Picked unit)) Not equal to (!=) 0
            • Then - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (In-game time of day) Less than (<) 23.59
                • Then - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                  • Unit - Set level of Stealth (Neutral Hostile) for (Picked unit) to 1
                • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (In-game time of day) Greater than or equal to (>=) 23.59
                • Then - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
                  • Unit - Set level of Stealth (Neutral Hostile) for (Picked unit) to 2
                • Else - Actions
            • Else - Actions
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Day
    • Events
      • Game - The in-game time of day becomes Equal to 6.00 // when the day comes
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (HeroGroup) 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 <UnitType>
              • (Level of Stealth for (Picked unit)) Equal to 2
            • Then - Actions
              • Unit - Set level of Stealth for (Picked unit) to 1
              • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
            • Else - Actions
  • Night
    • Events
      • Game - The in-game time of day becomes Equal to 18.00 // when the night comes
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (HeroGroup) 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 <UnitType>
              • (Level of Stealth for (Picked unit)) Equal to 1
            • Then - Actions
              • Unit - Set level of Stealth for (Picked unit) to 2
              • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
            • Else - Actions
 
Status
Not open for further replies.
Top