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

[Trigger] turn on off collision of unit by it buff on or off

Status
Not open for further replies.
Level 3
Joined
Mar 15, 2015
Messages
53
im very dumb at trigger and i need some help, i don't know why it's didn't work, and anyone can help me fix it thanks a lot :D
  • Walkthrough
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Walkthrough
    • Actions
      • Set WT_unit = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (WT_unit has buff Walkthrough ) Equal to True
        • Then - Actions
          • Unit - Turn collision for WT_unit On
        • Else - Actions
          • Do nothing
  • Walkthrough 2
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
      • (WT_unit has buff Walkthrough ) Equal to False
    • Actions
      • Unit - Turn collision for WT_unit Off
      • Trigger - Turn off (This trigger)
 
Level 13
Joined
Dec 21, 2010
Messages
541
create a REAL variable for the duration of the ability ex: WT_Duration (set it to how long you want) this trigger is not for MUI purposes..

  • Walkthrough
    • Events
      • Unit - Starts an effect of an ability
    • Conditions
      • (Ability being cast) Equal to Walkthrough
    • Actions
    • Set WT_unit = (Target unit of ability being cast)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • WT_Duration Equal to 0.00
      • Then - Actions
        • Unit - Turn collision for WT_unit On
        • Trigger - Turn on Walkthrough 2 <gen>
      • Else - Actions
      • Set WT_Duration = 10.00
Make sure to uncheck "Initially On" for the 2nd trigger

  • Walkthrough 2
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WT_Duration Greater than 0.00
        • Then - Actions
          • Set WT_Duration = WT_Duration - 0.03
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • WT_Duration Less than or Equal to 0.00
                  • WT_unit is alive Equal to false
          • Then - Actions
            • Unit - Turn collision for WT_unit Off
            • Set WT_Duration = 0.00
            • Set WT_unit = no unit
            • Trigger - Turn off (This trigger)
          • Else - Actions
          • Else - Actions
 
Last edited:
Level 3
Joined
Mar 15, 2015
Messages
53
create a REAL variable for the duration of the ability ex: WT_Duration (set it to how long you want) this trigger is not for MUI purposes..

  • Walkthrough
    • Events
      • Unit - Starts an effect of an ability
    • Conditions
      • (Ability being cast) Equal to Walkthrough
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WT_Duration Equal to 0.00
        • Then - Actions
          • Unit - Turn collision for WT_unit On
          • Trigger - Turn on Walkthrough 2 <gen>
        • Else - Actions
      • Set WT_unit = (Target unit of ability being cast)
      • Set WT_Duration = 10.00
Make sure to uncheck "Initially On" for the 2nd trigger

  • Walkthrough 2
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WT_Duration Greater than 0.00
        • Then - Actions
          • Set WT_Duration = WT_Duration - 0.03
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • WT_Duration Less than or Equal to 0.00
                  • WT_unit is alive Equal to false
          • Then - Actions
            • Unit - Turn collision for WT_unit Off
            • Set WT_Duration = 0.00
            • Set WT_unit = no unit
            • Trigger - Turn off (This trigger)
          • Else - Actions
          • Else - Actions
thank you, you helped me a lot ^^
btw nice avatar so kawaii
 
Level 3
Joined
Mar 15, 2015
Messages
53
  • Walkthrough
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Walkthrough
    • Actions
      • Set WT_unit = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WT_Duration Equal to 0.00
        • Then - Actions
          • Unit - Turn collision for WT_unit On
          • Trigger - Turn on Walkthrough 2 <gen>
        • Else - Actions
      • Set WT_Duration = 10.00
  • Walkthrough 2
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WT_Duration Greater than 0.00
        • Then - Actions
          • Set WT_Duration = (WT_Duration - 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • WT_Duration Less than or equal to 0.00
                  • (WT_unit is alive) Equal to False
            • Then - Actions
              • Unit - Turn collision for WT_unit Off
              • Set WT_Duration = 0.00
              • Set WT_unit = No unit
              • Trigger - Turn off (This trigger)
            • Else - Actions
        • Else - Actions
wew it didn't work :( help!
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
What Dalvengyr tried to say (which I actually would not understand if I didn't knew it before) is that turning a unit's collision "off" doesn't really turn it off.

With this action, this unit can walk through other units and stuff but other units cannot walk through this unit for example.
I thought that there was a glitch with adding locust and (un)hiding units that you can remove the collision but never tried it myself.
Adding flight work too though.
 
Level 13
Joined
Dec 21, 2010
Messages
541
  • Walkthrough
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Walkthrough
    • Actions
      • Set WT_unit = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WT_Duration Equal to 0.00
        • Then - Actions
          • Unit - Turn collision for WT_unit On
          • Trigger - Turn on Walkthrough 2 <gen>
        • Else - Actions
      • Set WT_Duration = 10.00
  • Walkthrough 2
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WT_Duration Greater than 0.00
        • Then - Actions
          • Set WT_Duration = (WT_Duration - 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • WT_Duration Less than or equal to 0.00
                  • (WT_unit is alive) Equal to False
            • Then - Actions
              • Unit - Turn collision for WT_unit Off
              • Set WT_Duration = 0.00
              • Set WT_unit = No unit
              • Trigger - Turn off (This trigger)
            • Else - Actions
        • Else - Actions
wew it didn't work :( help!
If you are talking about walking through cliffs... you need to constantly click the cliffs in order for your hero to pass through...because if you click on the other side of the path, the hero will still find another way to get to the issued point.
 
Level 3
Joined
Mar 15, 2015
Messages
53
guys i ve found that the spell work, but in the ridiculously way: when i cast the main spell, the target unit doesn't go through anything, but after 10 seconds (the duration of the spell) it collision suddenly turn off
have any idea?
 
Level 3
Joined
Mar 15, 2015
Messages
53
In the triggers you posted above, you turn collision on when you start the buff and set collision off when the buffs ends.



Either of those is false.
(You have either NOT posted the up-to-date triggers or you have NOT switched the actions.)
you mean my triggers? lol okay i will try on that
 
Level 13
Joined
Dec 21, 2010
Messages
541
guys i ve found that the spell work, but in the ridiculously way: when i cast the main spell, the target unit doesn't go through anything, but after 10 seconds (the duration of the spell) it collision suddenly turn off
have any idea?


Hhahaha...sorry for this one... I saw something ridiculous xD just change the first trigger Turn Collision Off ...and the second trigger Turn Collision On..
 
Level 3
Joined
Mar 15, 2015
Messages
53
okay after change the collision on/off problem, the triggers still didn't work
  • Walkthrough
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Walkthrough
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WT_Duration Equal to 0.00
        • Then - Actions
          • Unit - Turn collision for WT_unit Off
          • Trigger - Turn on Walkthrough 2 <gen>
        • Else - Actions
      • Set WT_unit = (Target unit of ability being cast)
      • Set WT_Duration = 10.00
  • Walkthrough 2
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WT_Duration Greater than 0.00
        • Then - Actions
          • Set WT_Duration = (WT_Duration - 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • WT_Duration Less than or equal to 0.00
                  • (WT_unit is alive) Equal to False
            • Then - Actions
              • Unit - Turn collision for WT_unit On
              • Set WT_Duration = 0.00
              • Set WT_unit = No unit
              • Trigger - Turn off (This trigger)
            • Else - Actions
        • Else - Actions
i think that the problem is from the 1st trigger, because when i cast the ability to the unit that already have collision turned off, after the spell end that unit can't go through anymore
 
Level 3
Joined
Mar 15, 2015
Messages
53
Problem solved: just move Set WT_unit = (Target unit of ability being cast) top the top order of action....
  • Walkthrough
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Walkthrough
    • Actions
      • Set WT_unit = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WT_Duration Equal to 0.00
        • Then - Actions
          • Unit - Turn collision for WT_unit Off
          • Trigger - Turn on Walkthrough 2 <gen>
        • Else - Actions
      • Set WT_Duration = 10.00
omg i'm so dumb. Why can't i figure it out... :ogre_rage: i'm so so so sorry to bother you guys
 
Level 13
Joined
Dec 21, 2010
Messages
541
Problem solved: just move Set WT_unit = (Target unit of ability being cast) top the top order of action....
  • Walkthrough
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Walkthrough
    • Actions
      • Set WT_unit = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WT_Duration Equal to 0.00
        • Then - Actions
          • Unit - Turn collision for WT_unit Off
          • Trigger - Turn on Walkthrough 2 <gen>
        • Else - Actions
      • Set WT_Duration = 10.00
omg i'm so dumb. Why can't i figure it out... :ogre_rage: i'm so so so sorry to bother you guys

don't be too hard to yourself... it's good that you ask for help because you'll learn much faster.. :)
 
I haven't used that O_O... does that ability make the unit fly?
No, it just turns off collision with units (but not with buildings or destructables). The difference between this and "Turn Collision for unit off" is, that this ability works bi-directional: other units will be able to move through your unit aswell, which is not the case for the Collision function.
 
Status
Not open for further replies.
Top