• 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.

Periodic event - kill if terrain = X

Status
Not open for further replies.
Level 1
Joined
May 15, 2007
Messages
88
This is an Escape map, and I want to make it like if the unit enters dirt, it will die.
Since it will pick a random unit every 0.01 sec, it will pick LOADS of units in one sec, therefor making it pretty impossible to avoid it. ;)

And no, I cant use die on region quick write anymore, since I only got 150 regions left, and therefor have to save them to things I DO need regions for.

  • Perioudic
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • (Terrain type at (Position of (Random unit from Escapers))) Equal to Cityscape - Dirt
    • Actions
      • Unit - Kill (Matching unit)
(Don't care about typos, the typos aren't visible ingame ;) )


What shall I put in at action, Or shall I change condition, any ideas?
Thanks.
 
Last edited:
Level 18
Joined
May 27, 2007
Messages
1,689
first off this should be posted in the triggers GUI section but anyway the event could be "Unit-Is issued an order targeting a point" i think
but here is the trig

  • Kill
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Terrain type at (Target point of issued order)) Equal to Lordaeron Summer - Dirt
    • Actions
      • Wait until ((Distance between (Position of (Ordered unit)) and (Target point of issued order)) Less than or equal to 20.00), checking every 0.10 seconds
      • Unit - Kill (Ordered unit)
that should work i havent tested tho tell me if it doesnt and ill see what i can do
 
  • Death Trigger
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Escapers and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at TempPoint) Equal to Cityscape - Dirt
            • Then - Actions
              • Unit - Kill (Picked unit)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint)
Variable Name: TempPoint
Variable Type: Point
 
  • Terrain Check
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • -------- Remember that jass scripts are case sensitive! --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at TempPoint) Equal to Lordaeron Summer - Dirt
            • Then - Actions
              • Unit - Kill (Picked unit)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint)
          • -------- End of group loop --------
EDIT: Was no replies last i checked
 
Level 1
Joined
May 15, 2007
Messages
88
Doctor-Pepper, this didn't work quite that well ;)


  • Periodic
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (Terrain type at (Position of (Picked unit))) Equal to Cityscape - Dirt
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Kill (Picked unit))
  • Periodic Copy
    • Events
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Wait until ((Terrain type at (Position of (Triggering unit))) Equal to Cityscape - Dirt), checking every 0.10 seconds
      • Unit - Explode (Triggering unit)
This did work, but it is bugged, if the unit for example walks NOT on dirt, but into a corner of a wall, where there are no visible dirt, just tiled rock, its killed ....


Edit: Seems like I got to go over EVERY single part of map where there are corners, and put in grass -.- Duh


Are there a way to make Regions appear with the name Region1 (1-999) Since most Die on quickwrites don't allow more than 999 regions :S (Like the default appeareance of regions are Region1 X (X=1-999) So I can start over with regions?
Since the Die on quickwrite I got, allows:
(Regionname With space allowed, Exs:)
Region(Space)
Starting number: 1
Ending number 999

Like that, but since the default:
Region 1-999 Is used up, I need a new region type. As when I place the next region, it is region1 1, region1 2, region1 900 etc.

Thanks again for helping here ;)
 
Last edited:
Level 18
Joined
May 27, 2007
Messages
1,689
i think i have the answer to your problem, it was that your grammar was incorrect with the variable "Escapers", it should have been "Escapees", LOL jk but here is a few trigs that work, but i am not sure how ur game is set up, if all players are escaping or w/e but it would be fairly easy to change

  • Escapees
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to Escapees
You can then remove any units you want after you add the picked unit to the unit group
  • WhenToKillThem
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Escapees and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at TempPoint) Equal to Lordaeron Summer - Dirt
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Custom script: call RemoveLocation (udg_TempPoint)
            • Else - Actions
there u go hope this is what u were looking for
 
Status
Not open for further replies.
Top