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

Hide skill (triggered)

Status
Not open for further replies.
Level 7
Joined
Apr 13, 2012
Messages
110
  • hideskill
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Hide
    • Actions
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Ashenvale Canopy Tree
            • Then - Actions
              • Set hidingdestru = (Position of (Picked destructible))
              • Set aroundtrees = (Units within 200.00 of hidingdestru)
              • Unit Group - Pick every unit in aroundtrees and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Equal to (Casting unit)
                    • Then - Actions
                      • Set hidingunit = (Position of (Casting unit))
                      • Set aroundhidingunit = (Units within 150.00 of hidingunit)
                      • Unit Group - Pick every unit in aroundhidingunit and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Picked unit) belongs to an enemy of Player 2 (Blue)) Equal to True
                            • Then - Actions
                              • Do nothing
                            • Else - Actions
                              • Unit - Pause (Casting unit)
                              • Unit - Make (Casting unit) Invulnerable
                              • Wait 1.00 seconds
                              • Unit - Make (Casting unit) Vulnerable
                              • Unit - Unpause (Casting unit)
                      • Custom script: call RemoveLocation(udg_hidingunit)
                      • Custom script: call DestroyGroup (udg_aroundhidingunit)
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_hidingdestru)
              • Custom script: call DestroyGroup (udg_aroundtrees)
            • Else - Actions
Is something wrong with this trigger? cause
when i pause the unit and make it invulnerable its all ok
but when its the time to unpause and make the unit vunerable its just doesn't
it seems to me the wait action is causing this problem to the trigger
cause when i remove wait it works fine.
 
Last edited:
Level 7
Joined
Jan 28, 2012
Messages
266
  • hideskill
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Hide
    • Actions
      • Custom script: local unitgroup udg_aroundhidingunit
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Ashenvale Canopy Tree
            • Then - Actions
              • Set hidingdestru = (Position of (Picked destructible))
              • Set aroundtrees = (Units within 200.00 of hidingdestru)
              • Custom script: call RemoveLocation(udg_hidingdestru)
              • Unit Group - Pick every unit in aroundtrees and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Equal to (Casting unit)
                    • Then - Actions
                      • Set hidingunit = (Position of (Casting unit))
                      • Set aroundhidingunit = (Units within 150.00 of hidingunit)
                      • Unit Group - Pick every unit in aroundhidingunit and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Picked unit) belongs to an enemy of Player 2 (Blue)) Equal to True
                            • Then - Actions
                              • (remove the unit from the unit group)
                            • Else - Actions
                              • Unit - Pause (Casting unit)
                              • Unit - Make (Casting unit) Invulnerable
                        • Custom script: call RemoveLocation(udg_hidingunit)
                      • Wait 1.00 seconds
                      • Unit Group - Pick every unit in aroundhidingunit and do (Actions
                        • Loop - Actions
                          • Unit - Make (Casting unit) Vulnerable
                          • Unit - Unpause (Casting unit)
                      • Custom script: call DestroyGroup (udg_aroundhidingunit)
                    • Else - Actions
              • Custom script: call DestroyGroup (udg_aroundtrees)
            • Else - Actions
this will fix your problem,
you cannot have waits in ForGroup loops.
you could do this more efficiently by picking all destructibles within 200 of the caster.
 
Level 7
Joined
Apr 13, 2012
Messages
110
Ender your trigger didnt work i tried many other things based on what you told me (including 2 trigger solution) but nothing.. if you could test the trigger it would be really great..thanks for your help so far

Tank-Commander I dont think i m ready to gui but i ll check it..also accuracy its not that important for that perticular ability
 
Well since it isn't working regardless of that solution I'd suggest this: At the start of the trigger call a custom script:

  • Custom script: local unit caster = (triggering unit)
then use that as your ref point rather than (casting unit) though it's a bit late at night for my brain to be in gear to see any other problems that might exist.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
okay, WHAT EXACTLY YOU'RE TRYING TO DO ?

If you can give me a full explanation on what you want to do, I can reconstruct your trigger and make it MUI.

Come on tell me, what do you want to do ? (full explanation with detail)
 
Level 7
Joined
Apr 13, 2012
Messages
110
wtf is MUI?
WHAT EXACTLY YOU'RE TRYING TO DO ?


Well... i want when i cast my spell to pick all the destructbles of a type and then pick every unit in 200 range of my chosen destructble and if picked unit is my casting unit then pick every unit in 200 range of my casting unit, and if picked unit is an enemy do nothing else do pause casting unit/make casting unit invunrable WAIT 1 sec then unpause casting unit/make casting unit vunrable

now i am also confused..
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
MUI(I dont know exactly how it is called in normal form :D(hope you undestand what I mean)) is basically when a unit casts spell and you have for instance wait in the trigger then if another unit casts it it will not get override but it will work for both. Basically it means that any number of units(teoretically) can cast it at the same time and it will not bug out
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Well... i want when i cast my spell to pick all the destructbles of a type and then pick every unit in 200 range of my chosen destructble and if picked unit is my casting unit then pick every unit in 200 range of my casting unit, and if picked unit is an enemy do nothing else do pause casting unit/make casting unit invunrable WAIT 1 sec then unpause casting unit/make casting unit vunrable

now i am also confused..
Basically what you want, is if your Caster is near any trees, you would Pause and make your Caster Invulnerable for 1 second, then Unpause it and remove Invulnerable ?
 
Level 7
Joined
Apr 13, 2012
Messages
110
any number of units(teoretically) can cast it at the same time and it will not bug out
That wont happed in my game cause its single player and no other unit than the main hero will use that ability
Basically what you want, is if your Caster is near any trees, you would Pause and make your Caster Invulnerable for 1 second, then Unpause it and remove Invulnerable ?
Yes only you forgot if any enemy is in 200 range of casting unit then do nothing
 
Status
Not open for further replies.
Top