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

Trigger when unit is close to unit type

Status
Not open for further replies.
Level 4
Joined
Jul 26, 2016
Messages
88
  • InitUnitTypeEvent
    • Evénements
      • Unité - A unit enters (Entire map)
    • Conditions
      • (Unit-type of (Triggering unit)) Egal à Paladin
    • Actions
      • Trigger - Add to UnitInRange <gen> the event (Unité - A unit comes within 200.00 of (Triggering unit))
  • UnitInRange
    • Evénements
    • Conditions
    • Actions
      • Custom script: Just do whatever you want here. Will trigger anytime a unit comes into range of a specified unit-type. Ressource-intensive.
 
Level 19
Joined
Apr 21, 2013
Messages
1,194
Upon reading it again, finally sitting on my chair, this method is more triggers than my current one.

I'm currently using these;

  • Speed Vault1
    • Events
      • Unit - A unit comes within 150.00 of Wooden Fence Unit 0021 <gen>
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Achilles
          • isParkour Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsWalking Equal to False
        • Then - Actions
          • Set isParkour = True
          • Set moveSpeed = 0.00
          • Animation - Reset Achilles's animation
          • Custom script: call SetUnitAnimationByIndex(udg_Achilles, 142)
          • Trigger - Turn on Speed Vault Loop <gen>
        • Else - Actions
  • Speed Vault Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set parkLoc1 = (Position of Achilles)
      • Set parkLoc2 = (parkLoc1 offset by (322.00 x 0.03) towards (Facing of Achilles) degrees)
      • Unit - Move Achilles instantly to parkLoc2
      • Custom script: call RemoveLocation(udg_parkLoc1)
      • Custom script: call RemoveLocation(udg_parkLoc2)
      • Set speedVaultDist = (speedVaultDist + (322.00 x 0.03))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • speedVaultDist Greater than or equal to 150.00
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Set speedVaultDist = 0.00
          • Set isParkour = False
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IsWalking Equal to True
            • Then - Actions
              • Set moveSpeed = 150.00
              • Custom script: call SetUnitAnimationByIndex(udg_Achilles, 1)
            • Else - Actions
              • Set moveSpeed = 322.00
              • Custom script: call SetUnitAnimationByIndex(udg_Achilles, 128)
        • Else - Actions
I only have to create one trigger for each obstacle unit.

In the suggested one, I will have to create two triggers or two events in one trigger, so that it can be used from both sides. And many more regions have to be created as well.
 
Status
Not open for further replies.
Top