• 🏆 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] Help me in this Spell

Status
Not open for further replies.
Level 16
Joined
Aug 20, 2009
Messages
1,552
i am making a spell, where it summons 3 Pool unit, at the location of ability being cast,

then, in the pool area, it will summon some dummys at random position within the area, to cast war stomp. for each of the pool, so, 3 stomps each 0.2 sec.

this is the triggers

  • Blood Pool
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blood Pool (Tichondrius)
    • Actions
      • Set BloodPoint = (Target point of ability being cast)
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Blood Pool Dummy for (Owner of (Triggering unit)) at BloodPoint facing Default building facing degrees
          • Set BloodUnit = (Last created unit)
          • Unit - Add a 7.00 second Generic expiration timer to BloodUnit
          • Animation - Change BloodUnit's animation speed to (9.00 + (6.00 x (Real((Integer A)))))% of its original speed
          • Unit - Set level of Slow Aura 2 70% 20% (Blood Pool) (Tornado) for (Last created unit) to (Level of Blood Pool (Tichondrius) for (Triggering unit))
      • Trigger - Turn on Blood Periodic <gen>
  • Blood Periodic
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) 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 Blood Pool Dummy
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Unit Group - Add (Picked unit) to BloodGroup
              • Game - Display to (All players) the text: Working
              • Set TempPoint = ((Position of (Picked unit)) offset by (Random real number between 0.00 and 400.00) towards (Random angle) degrees)
              • Unit - Create 1 Dummy (Amphibious) for (Owner of (Picked unit)) at TempPoint facing Default building facing degrees
              • Special Effect - Create a special effect at TempPoint using Objects\Spawnmodels\Human\HumanLargeDeathExplode\HumanLargeDeathExplode.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Animation - Change (Last created unit)'s size to (125.00%, 125.00%, 125.00%) of its original size
              • Unit - Add Blood Pool Spike (Dummy) to (Last created unit)
              • Unit - Set level of Blood Pool Spike (Dummy) for (Last created unit) to (Level of Slow Aura 2 70% 20% (Blood Pool) (Tornado) for (Picked unit))
              • Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
              • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
            • Else - Actions
              • Unit Group - Remove (Picked unit) from BloodGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (BloodGroup is empty) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: No unit Detected
          • Trigger - Turn off (This trigger)
        • Else - Actions
but it keeps telling me that, no unit is detected...what do i do wrong?
 
why? yes it has locust..but what is wrong with it :D? sorry, i am not so good in this.

well, you cannot pick units with locust... even triggers cannot do that...

anyway as I said, just add them to the group on the first trigger, after you create them, its more efficient that way... then on the second trigger, just pick every unit inside the group and do the other actions...
 
I think you can pick them if they're already inside a group...

(basically if you already have the specific handle that points to that unit, you can "select" him using that handle like using Last Created Unit [though using LCU for a locust unit somehow has a limit, it bugs sometimes if used repeatedly]...)

basically,
  • Unit Group - Pick every unit within PlayableMapArea
does not pick locust units

and to make them pickable using a group loop, you need to add them to a group right after their creation...
 
Level 16
Joined
Aug 20, 2009
Messages
1,552
i get it going! :D

but then, somehow if i destroy the unit group, for the 2nd cast, it doesnt work,

in my case, how do you destroy the unit group leak? and is there any other leak?

  • Blood Pool
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blood Pool (Tichondrius)
    • Actions
      • Set BloodPoint = (Target point of ability being cast)
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Blood Pool Dummy for (Owner of (Triggering unit)) at BloodPoint facing Default building facing degrees
          • Set BloodUnit = (Last created unit)
          • Unit Group - Add (Last created unit) to BloodGroup
          • Unit - Add a 7.00 second Generic expiration timer to BloodUnit
          • Animation - Change BloodUnit's animation speed to (9.00 + (6.00 x (Real((Integer A)))))% of its original speed
          • Unit - Set level of Slow Aura 2 70% 20% (Blood Pool) (Tornado) for (Last created unit) to (Level of Blood Pool (Tichondrius) for (Triggering unit))
      • Trigger - Turn on Blood Periodic <gen>
  • Blood Periodic
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in BloodGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: Working
            • Else - Actions
              • Game - Display to (All players) the text: Unit Died
              • Unit Group - Remove (Picked unit) from BloodGroup
          • Set TempPoint = ((Position of (Picked unit)) offset by (Random real number between 0.00 and 400.00) towards (Random angle) degrees)
          • Unit - Create 1 Dummy (Amphibious) for (Owner of (Picked unit)) at TempPoint facing Default building facing degrees
          • Special Effect - Create a special effect at TempPoint using Objects\Spawnmodels\Human\HumanLargeDeathExplode\HumanLargeDeathExplode.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Animation - Change (Last created unit)'s size to (125.00%, 125.00%, 125.00%) of its original size
          • Unit - Add Blood Pool Spike (Dummy) to (Last created unit)
          • Unit - Set level of Blood Pool Spike (Dummy) for (Last created unit) to (Level of Slow Aura 2 70% 20% (Blood Pool) (Tornado) for (Picked unit))
          • Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (BloodGroup is empty) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Trigger is Off
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
dont destroy the group!!!... it does not leak because you always use that same group...

anyway you leak a point - (Position of (Picked unit))

do this:
  • Set TempPoint_1 = ((Position of (Picked unit))
  • Set TempPoint = (TempPoint_1) offset by (Random real number between 0.00 and 400.00) towards (Random angle) degrees)
and ofc, be sure to remove TempPoint_1 too... ^_^

oh, you also leak BloodPoint, you forgot to remove it at the end of the cast trigger
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
As I said earlier, it picks ALL units, Locust alike
Because you can see the action of picking can be done to the Dummy Unit and when we want to order the Dummy Unit to something else (Order Dummy to Human Mountain King - Storm Bolt), this refers to the dummy unit itself (Locusted unit, of course)
 
Status
Not open for further replies.
Top