• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Terrain Check

Status
Not open for further replies.
Why isn't this working? The unit 'u[2]' is never killed when it moves across the cliffs!

Trigger:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Terrain type at temp_point[1]) Equal to Outland - Abyss Cliff
          • (Terrain type at temp_point[1]) Equal to Outland - Rough Dirt Cliff
    • Then - Actions
      • Unit - Kill u[2]
      • Custom script: call RemoveLocation(udg_temp_point[1])
    • Else - Actions
 
Yes, I am 100% sure. Well, I'll show you the whole trigger.

I am trying to create a bullet system, it works, but I need to fix collisions, and I really don't know the best way to do that.

Trigger:

  • MoveBullets
    • Events
      • Time - BulletTimer expires
    • Conditions
    • Actions
      • Set bulletgroup[2] = (Random BulletTotal units from bulletgroup[1])
      • Unit Group - Pick every unit in bulletgroup[2] and do (Actions)
        • Loop - Actions
          • Set u[2] = (Picked unit)
          • For each (Integer A) from 1 to MaxBulletTypes, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of u[2]) Equal to BulletUnitType[(Integer A)]
                • Then - Actions
                  • Set CheckBulletID = (Integer A)
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (u[2] is alive) Equal to True
            • Then - Actions
              • Set temp_point[1] = (Position of u[2])
              • Set temp_point[2] = (temp_point[1] offset by BulletTypeSpeed[CheckBulletID] towards (Facing of u[2]) degrees)
              • Unit - Move u[2] instantly to temp_point[2]
              • Custom script: call RemoveLocation(udg_temp_point[1])
              • Set temp_point[1] = (Position of u[2])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Terrain type at temp_point[1]) Equal to Outland - Abyss Cliff
                      • (Terrain type at temp_point[1]) Equal to Outland - Rough Dirt Cliff
                • Then - Actions
                  • Unit - Kill u[2]
                  • Custom script: call RemoveLocation(udg_temp_point[1])
                • Else - Actions
              • -------- // Collision Check // --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Unit-type of u[2]) Equal to FlameThrowerBullet
                      • (Unit-type of u[2]) Equal to LaserBullet
                      • (Unit-type of u[2]) Equal to RocketLauncherBullet
                      • (Unit-type of u[2]) Equal to ToxicBullet
                • Then - Actions
                  • Trigger - Run CollisionCheckWithEffect <gen> (checking conditions)
                • Else - Actions
                  • Trigger - Run CollisionCheckWithoutEffect <gen> (checking conditions)
              • -------- // Collision Check // --------
              • Custom script: call RemoveLocation(udg_temp_point[1])
              • Custom script: call RemoveLocation(udg_temp_point[2])
            • Else - Actions
          • Custom script: set udg_u[2] = null
          • Custom script: set udg_CheckBulletID = 0
      • Custom script: call DestroyGroup(udg_bulletgroup[2])
 
Level 9
Joined
May 30, 2008
Messages
430
ok as far as i can see the unit is set
but i recomend u to use this for your terrain cheking
  • (Terrain type at (Position of (Triggering unit))) Equal to Outland - Rough Dirt Cliff
if this don't work there is somthing in unit/groups. And btw your trigger is triggered when the timer expires the unit may go in the terrain of this type after timer is expired or before and go outside of it so u better use
  • Unit - A unit Is issued an order targeting a point
and rework your trigger, btw i never try to create bullet systems so i don't know how they are working exactly gl i can't help more than this
 
Level 11
Joined
May 31, 2008
Messages
698
Try creating 2 different triggers. Maybe the loop is messing it up. I think i did a trigger that had a couple of loops in it, but only the first loop would work. Im not sure if thats the problem but its worth a try.
 
Status
Not open for further replies.
Top