Non working unit in range trigger

eatbeaver

New Member
Reaction score
7
Why doesn't this trigger work? It is supposed to damage all units owned by player 12 in 512 range but nothing happens.

Code:
Gravitiy
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units of type Gravity) and do (Actions)
            Loop - Actions
                Unit Group - Pick every unit in (Units within 512.00 of (Position of (Picked unit)) matching ((Owner of (Picked unit)) Equal to Player 12 (Brown))) and do (Actions)
                    Loop - Actions
                        Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 1.00)
                        Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Items\VampiricPotion\VampPotionCaster.mdl
 

Dregonx

TH.net Regular
Reaction score
21
How much damage do you want to do? Because my bet is that it needs to be done with a damage rather then a "set life to whatever".

Also your trigger has leaks in it, which adds lag to your game.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
do it like this:
Code:
Trigger
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set TempGroup = (Units in (Playable map area)((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Soldat)))
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                Set TempPoint = (Position of (Picked unit))
                Set TempGroup2 = (Units within 512.00 of TempPoint matching ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Equal to Player 12 (Brown))))
                Unit Group - Pick every unit in TempGroup2 and do (Actions)
                    Loop - Actions
                        Unit - Cause (Picked unit) to damage (Picked unit), dealing 10.00 damage of attack type Chaos and damage type Unknown
                        Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Items\VampiricPotion\VampPotionCaster.mdl
                        Special Effect - Destroy (Last created special effect)
                Custom script: call RemoveLocation (udg_TempPoint)
                Custom script: call DestroyGroup (udg_TempGroup2)
        Custom script: call DestroyGroup (udg_TempGroup)
fully leakless.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top