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

[General] Unit with locust Detection in range. Strange effect

Status
Not open for further replies.
Level 9
Joined
Sep 20, 2015
Messages
385
Hello, i have a strange issue in my map. I need to count the units in a range of 128 from another unit.

I used this condition in a 0.15 loop trigger.

  • (Number of units in (Units within 50.00 of ((Position of (Picked unit)) offset by 128.00 towards 270.00 degrees) matching ((Unit-type of (Matching unit)) Uguale a FireUnit (Livello 1)))) Uguale a 0
It's strange that the unit is counted only when it dies and the few seconds after the death.

I don't know what to do, i searched online and modified all filed in OE and tired with different type of triggers it still behave like i said.

I made a video that is better that my explanation. SKIP IT TO 21 SECONDS


As you can see the fire should be counted when it's alive. Instead it is couned when dead.

The unit has locust and a negative hp regeneration.

The red number on the blood mage is the count for'' the units owned by player of type fireunit'' and that seems to work just fine.

thank you in advance for the help
 
Last edited:
Level 7
Joined
Apr 17, 2017
Messages
316
You can Enum units with 'Aloc'. What you can do is giving the locust ability when trigger is run, instead of using object editor. That way you can keep track of units with locust ability. They get filtered out if you use gui unit groups.
I'd do something like this: set temppoint : Target point of ability being cast
Unit create dummy at xxxxx
Set dummy last created unit
Unit Add locust ability to dummy.
call RemoveLocation(udg_temppoint)
There you go.
 
Level 9
Joined
Sep 20, 2015
Messages
385
You can Enum units with 'Aloc'. What you can do is giving the locust ability when trigger is run, instead of using object editor. That way you can keep track of units with locust ability. They get filtered out if you use gui unit groups.
I'd do something like this: set temppoint : Target point of ability being cast
Unit create dummy at xxxxx
Set dummy last created unit
Unit Add locust ability to dummy.
call RemoveLocation(udg_temppoint)
There you go.

I tired this. I added locust ability via triggers after the trigger was running, and the result is the same, as soon as the unit has locust it's not counted anymore. I tried to add and remove locust only for the count loop but it doesnt work.

"Units In Range" does not get locust units, but "Units Owned By Player" does get all units -- locust-units included. If you loop through needed players, and check their units' distance it should work I guess.

Im not sure what you mean. I knwo there are group of players loops (pick every player and do) but how do i check the distance between each picked player owned unit in the entire map?
 
You can loop through all players, and for each player for all units. Then you might check for the distance, and add respective unit to a unit group. In the end the unit group should contain all units in range of 128, including locust units.

Like:

Unit Group - Clear MYGROUP
Set Point1 = (PositionOfUnit)
PickAllPlayers{
---- PickAllUnitsOwnedBy(PickedPlayer)
---- ---- Set Point2 = (PositionOf(PickedUnit))
---- ---- If (Distance Between Point1 and Point2 < 128 Then
---- ---- ---- Unit Group - Add Picked Unit to MYGROUP
---- ---- End If
--- EndPickAllUnits
EndPickAllPlayers

// now MYGROUP can be used
 
Level 9
Joined
Sep 20, 2015
Messages
385
You can loop through all players, and for each player for all units. Then you might check for the distance, and add respective unit to a unit group. In the end the unit group should contain all units in range of 128, including locust units.

Like:

Unit Group - Clear MYGROUP
Set Point1 = (PositionOfUnit)
PickAllPlayers{
---- PickAllUnitsOwnedBy(PickedPlayer)
---- ---- Set Point2 = (PositionOf(PickedUnit))
---- ---- If (Distance Between Point1 and Point2 < 128 Then
---- ---- ---- Unit Group - Add Picked Unit to MYGROUP
---- ---- End If
--- EndPickAllUnits
EndPickAllPlayers

// now MYGROUP can be used

Well, i can try this but my goal is to create a fire spreading effect on certain type of terrain. So in the loop the 8 points near the unit are checked and if there is grass terrain and 0 units it creates another one.

Made a video to show. In the video the units doesnt have locust an it works fine.



With locust it feels more like an actual fire but it creates lots of units in the same spot.
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
You didn't post a trigger aside from that one line snippet so none of know exactly what you're doing in your code and unless you do that we can only suggest methods not exact GUI lines you should make. Aeryn and Bo suggested the same thing but I guess I'm going to say it too: Using an action like this will not ever pick locusted units:
  • Unit Group - Pick every unit in (Units within X of SomePoint) and do (Actions)
    • Loop - Actions
      • -------- units with locust will never be found here --------
So if you want to use the method you already wrote to do the fire spreading you are going to have to do a different type of unit group picking. Specifically "units owned by PLAYER" does grab units with locust. You can check the distance yourself.
  • Unit Group - Remove all units from FIRE_GROUP
  • Set Point1 = The point you want to check distance to, I think "Position of (Picked Unit)"
  • Set TempGroup = (Units owned by (OWNER OF FIRE) matching (Unit-type of (Matching Unit) equal to FIRE))
  • Unit Group - Pick every unit in (TempGroup) and do (Actions)
    • Loop - Actions
      • Set Point2 = (Position of (Picked Unit))
      • If (All conditions) then do (Then actions) else do (Else actions)
        • If - Conditions
          • (Distance between Point1 and Point2) less than 50.00
        • Then - Actions
          • -------- do whatever you want here, maybe add it to a group to use later like Bo suggested: --------
          • Unit Group - Add (Picked Unit) to FIRE_GROUP
          • Custom script: call RemoveLocation(udg_TempPoint2) //change to match your variable names, but keep the udg_ prefix
        • Else - Actions
  • Custom script: call RemoveLocation(udg_TempPoint1) //same here
  • Custom script: call DestroyGroup(udg_TempGroup) //same here
  • Unit Group - Pick all units in FIRE_GROUP and do (Actions)
    • Loop - Actions
      • -------- fire is all here now --------
  • Unit Group - Remove all units from FIRE_GROUP
 
Level 9
Joined
Sep 20, 2015
Messages
385
You didn't post a trigger aside from that one line snippet so none of know exactly what you're doing in your code and unless you do that we can only suggest methods not exact GUI lines you should make. Aeryn and Bo suggested the same thing but I guess I'm going to say it too: Using an action like this will not ever pick locusted units:
  • Unit Group - Pick every unit in (Units within X of SomePoint) and do (Actions)
    • Loop - Actions
      • -------- units with locust will never be found here --------
So if you want to use the method you already wrote to do the fire spreading you are going to have to do a different type of unit group picking. Specifically "units owned by PLAYER" does grab units with locust. You can check the distance yourself.
  • Unit Group - Remove all units from FIRE_GROUP
  • Set Point1 = The point you want to check distance to, I think "Position of (Picked Unit)"
  • Set TempGroup = (Units owned by (OWNER OF FIRE) matching (Unit-type of (Matching Unit) equal to FIRE))
  • Unit Group - Pick every unit in (TempGroup) and do (Actions)
    • Loop - Actions
      • Set Point2 = (Position of (Picked Unit))
      • If (All conditions) then do (Then actions) else do (Else actions)
        • If - Conditions
          • (Distance between Point1 and Point2) less than 50.00
        • Then - Actions
          • -------- do whatever you want here, maybe add it to a group to use later like Bo suggested: --------
          • Unit Group - Add (Picked Unit) to FIRE_GROUP
          • Custom script: call RemoveLocation(udg_TempPoint2) //change to match your variable names, but keep the udg_ prefix
        • Else - Actions
  • Custom script: call RemoveLocation(udg_TempPoint1) //same here
  • Custom script: call DestroyGroup(udg_TempGroup) //same here
  • Unit Group - Pick all units in FIRE_GROUP and do (Actions)
    • Loop - Actions
      • -------- fire is all here now --------
  • Unit Group - Remove all units from FIRE_GROUP




Well my code is GUI and its pretty long, that's why i didn't posted it, but since you asked i will post it.


  • FireSpreadonYellowGrassTest
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Lava Spawn (Level 1)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Terrain type at (Position of (Picked unit))) Equal to Barrens - Rough Dirt
                  • (Terrain type at (Position of (Picked unit))) Equal to Barrens - Dark Desert
                  • (Terrain type at (Position of (Picked unit))) Equal to Barrens - Dirt
                  • (Terrain type at (Position of (Picked unit))) Equal to Ashenvale - Dirt
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 15.00)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Terrain type at (Position of (Picked unit))) Equal to Barrens - Rock
                  • (Terrain type at (Position of (Picked unit))) Equal to Dalaran Ruins - White Marble
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 35.00)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at (Position of (Picked unit))) Equal to Dalaran Ruins - Grass
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 25.00)
            • Else - Actions
          • -------- Check Pnts Radius Orizzontal --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Terrain type at ((Position of (Picked unit)) offset by 128.00 towards 0.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                  • (Terrain type at ((Position of (Picked unit)) offset by 128.00 towards 90.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                  • (Terrain type at ((Position of (Picked unit)) offset by 128.00 towards 180.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                  • (Terrain type at ((Position of (Picked unit)) offset by 128.00 towards 270.00 degrees)) Equal to Lordaeron Fall - Dark Grass
            • Then - Actions
              • -------- 270 gradi --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain type at ((Position of (Picked unit)) offset by 128.00 towards 270.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                  • (Terrain pathing at ((Position of (Picked unit)) offset by 128.00 towards 270.00 degrees) of type Floatability is off) Equal to True
                • Then - Actions
                  • Special Effect - Create a special effect at ((Position of (Picked unit)) offset by 128.00 towards 270.00 degrees) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
                  • Set NextFireEffect[3] = (Last created special effect)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in (Units owned by (Owner of (Picked unit)) of type Lava Spawn (Level 1))) Less than or equal to 8
                      • (Number of units in (Units within 50.00 of ((Position of (Picked unit)) offset by 128.00 towards 270.00 degrees) matching (((Unit-type of (Matching unit)) Equal to Lava Spawn (Level 1)) and ((Owner of (Matching unit)) Equal to (Owner of (Picked unit)))))) Equal to 0
                      • (Life of (Picked unit)) Less than 95.00
                    • Then - Actions
                      • Unit - Create 1 Lava Spawn (Level 1) for (Owner of (Picked unit)) at ((Position of (Picked unit)) offset by 128.00 towards 270.00 degrees) facing Default building facing degrees
                      • Environment - Change terrain type at ((Position of (Last created unit)) offset by 128.00 towards 90.00 degrees) to Dalaran Ruins - Grass using variation -1 in an area of size 1 and shape Circle
                    • Else - Actions
                  • Special Effect - Destroy NextFireEffect[3]
                • Else - Actions
              • -------- 180 gradi --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain type at ((Position of (Picked unit)) offset by 128.00 towards 180.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                  • (Terrain pathing at ((Position of (Picked unit)) offset by 128.00 towards 180.00 degrees) of type Floatability is off) Equal to True
                • Then - Actions
                  • Special Effect - Create a special effect at ((Position of (Picked unit)) offset by 128.00 towards 180.00 degrees) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
                  • Set NextFireEffect[2] = (Last created special effect)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in (Units owned by (Owner of (Picked unit)) of type Lava Spawn (Level 1))) Less than or equal to 8
                      • (Life of (Picked unit)) Less than 95.00
                      • (Number of units in (Units within 50.00 of ((Position of (Picked unit)) offset by 128.00 towards 180.00 degrees) matching ((Unit-type of (Matching unit)) Equal to Lava Spawn (Level 1)))) Equal to 0
                    • Then - Actions
                      • Unit - Create 1 Lava Spawn (Level 1) for (Owner of (Picked unit)) at ((Position of (Picked unit)) offset by 128.00 towards 180.00 degrees) facing Default building facing degrees
                      • Environment - Change terrain type at ((Position of (Last created unit)) offset by 128.00 towards 0.00 degrees) to Dalaran Ruins - Grass using variation -1 in an area of size 1 and shape Circle
                    • Else - Actions
                  • Special Effect - Destroy NextFireEffect[2]
                • Else - Actions
              • -------- 90 gradi --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain type at ((Position of (Picked unit)) offset by 128.00 towards 90.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                  • (Terrain pathing at ((Position of (Picked unit)) offset by 128.00 towards 90.00 degrees) of type Floatability is off) Equal to True
                • Then - Actions
                  • Special Effect - Create a special effect at ((Position of (Picked unit)) offset by 128.00 towards 90.00 degrees) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
                  • Set NextFireEffect[1] = (Last created special effect)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in (Units owned by (Owner of (Picked unit)) of type Lava Spawn (Level 1))) Less than or equal to 8
                      • (Life of (Picked unit)) Less than 95.00
                      • (Number of units in (Units within 50.00 of ((Position of (Picked unit)) offset by 128.00 towards 90.00 degrees) matching ((Unit-type of (Matching unit)) Equal to Lava Spawn (Level 1)))) Equal to 0
                    • Then - Actions
                      • Unit - Create 1 Lava Spawn (Level 1) for (Owner of (Picked unit)) at ((Position of (Picked unit)) offset by 128.00 towards 90.00 degrees) facing Default building facing degrees
                      • Environment - Change terrain type at ((Position of (Last created unit)) offset by 128.00 towards 270.00 degrees) to Dalaran Ruins - Grass using variation -1 in an area of size 1 and shape Circle
                    • Else - Actions
                  • Special Effect - Destroy NextFireEffect[1]
                • Else - Actions
              • -------- 0 gradi --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain type at ((Position of (Picked unit)) offset by 128.00 towards 0.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                  • (Terrain pathing at ((Position of (Picked unit)) offset by 128.00 towards 0.00 degrees) of type Floatability is off) Equal to True
                • Then - Actions
                  • Special Effect - Create a special effect at ((Position of (Picked unit)) offset by 128.00 towards 0.00 degrees) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
                  • Set NextFireEffect[0] = (Last created special effect)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in (Units owned by (Owner of (Picked unit)) of type Lava Spawn (Level 1))) Less than or equal to 8
                      • (Number of units in (Units within 50.00 of ((Position of (Picked unit)) offset by 128.00 towards 0.00 degrees) matching ((Unit-type of (Matching unit)) Equal to Lava Spawn (Level 1)))) Equal to 0
                      • (Life of (Picked unit)) Less than 95.00
                    • Then - Actions
                      • Unit - Create 1 Lava Spawn (Level 1) for (Owner of (Picked unit)) at ((Position of (Picked unit)) offset by 128.00 towards 0.00 degrees) facing Default building facing degrees
                      • Environment - Change terrain type at ((Position of (Last created unit)) offset by 128.00 towards 180.00 degrees) to Dalaran Ruins - Grass using variation -1 in an area of size 1 and shape Circle
                    • Else - Actions
                  • Special Effect - Destroy NextFireEffect[0]
                • Else - Actions
            • Else - Actions
              • -------- Diagonal --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Terrain type at ((Position of (Picked unit)) offset by 181.00 towards 45.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                      • (Terrain type at ((Position of (Picked unit)) offset by 181.00 towards 135.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                      • (Terrain type at ((Position of (Picked unit)) offset by 181.00 towards 225.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                      • (Terrain type at ((Position of (Picked unit)) offset by 181.00 towards 315.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                • Then - Actions
                  • -------- 225 gradi --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain type at ((Position of (Picked unit)) offset by 181.00 towards 225.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                      • (Terrain pathing at ((Position of (Picked unit)) offset by 181.00 towards 215.00 degrees) of type Floatability is off) Equal to True
                    • Then - Actions
                      • Special Effect - Create a special effect at ((Position of (Picked unit)) offset by 181.00 towards 225.00 degrees) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
                      • Set NextFireEffect[6] = (Last created special effect)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in (Units owned by (Owner of (Picked unit)) of type Lava Spawn (Level 1))) Less than or equal to 8
                          • (Number of units in (Units within 50.00 of ((Position of (Picked unit)) offset by 181.00 towards 225.00 degrees) matching ((Unit-type of (Matching unit)) Equal to Lava Spawn (Level 1)))) Equal to 0
                          • (Life of (Picked unit)) Less than 95.00
                        • Then - Actions
                          • Unit - Create 1 Lava Spawn (Level 1) for (Owner of (Picked unit)) at ((Position of (Picked unit)) offset by 181.00 towards 225.00 degrees) facing Default building facing degrees
                          • Environment - Change terrain type at ((Position of (Last created unit)) offset by 181.00 towards 45.00 degrees) to Dalaran Ruins - Grass using variation -1 in an area of size 1 and shape Circle
                        • Else - Actions
                      • Special Effect - Destroy NextFireEffect[6]
                    • Else - Actions
                  • -------- 315 gradi --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain type at ((Position of (Picked unit)) offset by 181.00 towards 315.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                      • (Terrain pathing at ((Position of (Picked unit)) offset by 181.00 towards 315.00 degrees) of type Floatability is off) Equal to True
                    • Then - Actions
                      • Special Effect - Create a special effect at ((Position of (Picked unit)) offset by 181.00 towards 315.00 degrees) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
                      • Set NextFireEffect[7] = (Last created special effect)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in (Units owned by (Owner of (Picked unit)) of type Lava Spawn (Level 1))) Less than or equal to 8
                          • (Number of units in (Units within 50.00 of ((Position of (Picked unit)) offset by 181.00 towards 315.00 degrees) matching ((Unit-type of (Matching unit)) Equal to Lava Spawn (Level 1)))) Equal to 0
                          • (Life of (Picked unit)) Less than 95.00
                        • Then - Actions
                          • Unit - Create 1 Lava Spawn (Level 1) for (Owner of (Picked unit)) at ((Position of (Picked unit)) offset by 181.00 towards 315.00 degrees) facing Default building facing degrees
                          • Environment - Change terrain type at ((Position of (Last created unit)) offset by 181.00 towards 135.00 degrees) to Dalaran Ruins - Grass using variation -1 in an area of size 1 and shape Circle
                        • Else - Actions
                      • Special Effect - Destroy NextFireEffect[7]
                    • Else - Actions
                  • -------- 135 gradi --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain type at ((Position of (Picked unit)) offset by 181.00 towards 135.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                      • (Terrain pathing at ((Position of (Picked unit)) offset by 181.00 towards 135.00 degrees) of type Floatability is off) Equal to True
                    • Then - Actions
                      • Special Effect - Create a special effect at ((Position of (Picked unit)) offset by 181.00 towards 135.00 degrees) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
                      • Set NextFireEffect[5] = (Last created special effect)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in (Units owned by (Owner of (Picked unit)) of type Lava Spawn (Level 1))) Less than or equal to 8
                          • (Number of units in (Units within 50.00 of ((Position of (Picked unit)) offset by 181.00 towards 135.00 degrees) matching ((Unit-type of (Matching unit)) Equal to Lava Spawn (Level 1)))) Equal to 0
                          • (Life of (Picked unit)) Less than 95.00
                        • Then - Actions
                          • Unit - Create 1 Lava Spawn (Level 1) for (Owner of (Picked unit)) at ((Position of (Picked unit)) offset by 181.00 towards 135.00 degrees) facing Default building facing degrees
                          • Environment - Change terrain type at ((Position of (Last created unit)) offset by 181.00 towards 315.00 degrees) to Dalaran Ruins - Grass using variation -1 in an area of size 1 and shape Circle
                        • Else - Actions
                      • Special Effect - Destroy NextFireEffect[5]
                    • Else - Actions
                  • -------- 45 gradi --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain type at ((Position of (Picked unit)) offset by 181.00 towards 45.00 degrees)) Equal to Lordaeron Fall - Dark Grass
                      • (Terrain pathing at ((Position of (Picked unit)) offset by 181.00 towards 45.00 degrees) of type Floatability is off) Equal to True
                    • Then - Actions
                      • Special Effect - Create a special effect at ((Position of (Picked unit)) offset by 181.00 towards 45.00 degrees) using Environment\LargeBuildingFire\LargeBuildingFire2.mdl
                      • Set NextFireEffect[4] = (Last created special effect)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in (Units owned by (Owner of (Picked unit)) of type Lava Spawn (Level 1))) Less than or equal to 8
                          • (Number of units in (Units within 50.00 of ((Position of (Picked unit)) offset by 181.00 towards 45.00 degrees) matching ((Unit-type of (Matching unit)) Equal to Lava Spawn (Level 1)))) Equal to 0
                          • (Life of (Picked unit)) Less than 95.00
                        • Then - Actions
                          • Unit - Create 1 Lava Spawn (Level 1) for (Owner of (Picked unit)) at ((Position of (Picked unit)) offset by 181.00 towards 45.00 degrees) facing Default building facing degrees
                          • Environment - Change terrain type at ((Position of (Last created unit)) offset by 181.00 towards 225.00 degrees) to Dalaran Ruins - Grass using variation -1 in an area of size 1 and shape Circle
                        • Else - Actions
                      • Special Effect - Destroy NextFireEffect[4]
                    • Else - Actions
                • Else - Actions
      • For each (Integer A) from 0 to FireTreeEffect, do (Actions)
        • Loop - Actions
          • Special Effect - Destroy FireTreesEffect[(Integer A)]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Lava Spawn (Level 1)))) Equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: Fire SPREAD OFF
          • Trigger - Turn off (This trigger)
          • Trigger - Turn on FireSpreadON <gen>
        • Else - Actions
 
Last edited:
If you're interested to use jass systems, that you might look to use TerrainInfection v2.1.

Additionaly to what was said to triggers already, you can probably just avoid this dummy unit and directly work with the terrain tile information. Or with terrain type (check for lava maybe), or internal storage of which tile was infected already.

By the way, there are a lot of memory leaks. You might read up how to remove them here Things That Leak.
 
Status
Not open for further replies.
Top