How to go about doing this...

strembitsky

Member
Reaction score
1
I'm making a maze map, which means when the player goes near a creep, the player dies. When I made these maps back in Warcraft 3, I wasted a lot of time making many, many triggers for all of the players. I tried to compact it here, but it won't work. Here's what I have:

Trigger:
  • CreepDeath
    • Events
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 1 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 2 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 3 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 4 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 5 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 6 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 7 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 8 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 9 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 10 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 11 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 12 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 13 from Units)
    • Unit - Any Unit Enters a distance of 1.0 from (Unit 14 from Units)
    • Local Variables
    • Conditions
    • ((Triggering unit) is in Units 2) == True
    • Actions
    • Unit - Kill (Triggering unit)

The reason it won't work is because there isn't a function for the action that is "Unit 1-14 from Units". I don't want it to kill the triggering unit, but rather the unit it's entering range of.
Help?
 

Dave312

Censored for your safe viewing
Reaction score
269
You would need to add an action that loops through all of the units in your unit group to determine which one is close to the entering unit.

Trigger:
  • CreepDeath
    • Events
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 1 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 2 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 3 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 4 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 5 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 6 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 7 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 8 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 9 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 10 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 11 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 12 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 13 from Units)
      • Unit - Any Unit Enters a distance of 1.0 from (Unit 14 from Units)
    • Local Variables
    • Conditions
      • ((Triggering unit) is in Units 2) == True
    • Actions
      • Unit Group - Pick each unit in Units and do (Actions)
        • Actions
          • General - If (Conditions) then do (Actions) else do (Actions)
            • If
              • (Distance between (Position of (Triggering unit)) and (Position of (Picked unit))) <= 1.0
            • Then
              • Unit - Kill (Picked unit)
              • General - Break
            • Else
      • Unit - Kill (Triggering unit)


Personally, I would be using the Data Editor to get this working. You can easily create a behaviour which kills both units when the two units come close together. If you are interested in making this via the Data Editor, let me know and I can post a step by step guide on how to do it.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
As Dave said, using the data editor for this is definitely a good way to do it. MissKerrigan has been asking for similar things and both me and Dave have answered here and here.

Basically, instead of having a new event for every unit, you add a behavior in the data editor to the unit-types you want to have as creeps(you can even add and remove this behavior in-game if you want the player to be able to touch them sometimes).

In the post I wrote for MissKerrigan, I did it the other way around. I gave a behavior to the player's unit, which searched for nearby banelings. I think a better way would be to do it as Dave explained in his post, where he gave it to the creeps. You might want a validator to check that the unit is a player's unit and not just any unit, but you can also use filters for that.

Anyway, if you decide you want to do it in the data editor, tell us and me or Dave will give you a better explanation on how it works.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top