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

"Picked Unit" Function Is Not Working ???

Status
Not open for further replies.
Level 3
Joined
Sep 10, 2005
Messages
23
I HAVE A QUESTION ABOUT THIS TRIGGER...
A HAVE MARKED BY UNDERLINE MY PROBLEM
UNDERLINED FUNCTIONS ARE NOT WORKING... BUT WHY ??? I AM GETTING CRAZY...

Blood Raven Effect 2
Events
Unit - A unit Dies
Conditions
(Unit-type of (Dying unit)) Equal to Blood Raven (Level 12)
Actions
Unit Group - Pick every unit in (Random 1 units from (Units within 1000.00 of (Position of (Dying unit)) matching ((Unit-type of (Matching unit)) Equal to Zombie (Level 4)))) and do (Actions)
Loop - Actions
Lightning - Create a lightning effect Chain Lightning - Primary (Position of (Dying unit)) (Position of (Picked unit))
Set BloodRavenLigtning = (Last created lightning effect)
Wait 0.05 seconds
Unit - Kill (Picked unit)
Lightning - Destroy BloodRavenLigtning
Wait 0.10 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units within 1000.00 of (Position of (Dying unit)) matching ((Unit-type of (Matching unit)) Equal to Zombie (Level 4)))) Greater than or equal to 1
Then - Actions
Trigger - Run (This trigger) (ignoring conditions)
Else - Actions
Do nothing

I HAVE A QUESTION ABOUT THIS TRIGGER...
A HAVE MARKED BY UNDERLINE MY PROBLEM
UNDERLINED FUNCTIONS ARE NOT WORKING... BUT WHY ??? I AM GETTING CRAZY...
 
And I guess wait's do not work properly within any kind of loop. You should try a pick and a loop:

Experience TRIGGER TAGS! From the same creator than Jass tags and many more things!
  • Actions
    • Set x = 0
    • Unit Group - Pick every unit in (there) and do (Actions)
      • Loop - Actions
        • Lightning - Create
        • Set Lightning[x] = Last Created Lightning
        • Set Unit[x] = (Picked Unit)
        • Set x = x + 1
    • Wait 0.05 seconds
    • For each integer (Integer A) from 0 to x do (Actions)
      • Loop - Actions
        • Lightning - Destroy Lightning[(Integer A)]
        • Unit - Kill Unit[(Integer A)]
This is the only way I see to get it to work properly =P
But maybe it's just any other problem I don't see now xD
 
Status
Not open for further replies.
Top