• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Kill every unit of type X when enters grass

Status
Not open for further replies.
Level 4
Joined
Apr 26, 2011
Messages
65
check it guys:

Any footman enters dark grass -> add 50% bonus (only) to him
if he leaves dark grass, remove bonus movement speed from him

can u tell me how can i trigger that ??!
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
For the event, you can either cover any dark grass location in a region and use the TriggerRegisterEnterRegion event or you periodically check whether the terrain type beneath a unit's feet is equal to the dark grass type. Do you also have problems with applying the buff? How about a command aura that only targets self for example.
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
There should be no problem since you can add units that start event about entering dark grass to an unit group, and then do actions. Remember to give condtion for removing units if they left the given terrain type.

If you still don't understand i can make a simple test map for you.
 
Level 4
Joined
Apr 26, 2011
Messages
65
i can make a simple test map for you
please do, i'm lil bit confused
BTW: effect of trigger shouldn't work for all units of unit type around map. just for single unit of unit type... hope you understand me, too hard to write that :p
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Use the same trigger like in my test map above, but just change actions:

  • creep
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is dead) Equal to False) and ((Unit-type of (Matching unit)) Equal to yourunit))) and do (Actions)
        • Loop - Actions
          • Set Temp_point = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at Temp_point) Equal to YourTerrainType
            • Then - Actions
              • Unit - Remove YourAbility from (Picked unit)
          • Custom script: call RemoveLocation (udg_Temp_point)
 
Status
Not open for further replies.
Top