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

Specific unit in X range from another, condition

Status
Not open for further replies.
Level 2
Joined
Jun 27, 2016
Messages
6
Hi, I can't find a way to make this...

Event:
-Sylvanas dies (is in game from the start)

Condition:
-Arthas is in range, maybe 2500 (arthas is in a variable)

Action:
-wait 5 sec
-Replace Sylvanas with her banshee verison under control of player 4

Thanks in advance
 
Level 19
Joined
Feb 27, 2019
Messages
582
  • Events
    • Unit - Sylvanas 0001 <gen> Dies
  • Conditions
    • (Distance between (Position of Sylvanas 0001 <gen>) and (Position of Arthas)) Less than 2500.00 ( Found in Real Comparison - Math - Distance between points )
  • Actions
    • Wait 5.00 game-time seconds
    • Unit - Change ownership of Sylvanas 0001 <gen> to Player 4 (Purple) and Change color
    • Hero - Instantly revive Sylvanas 0001 <gen> at (Position of Sylvanas 0001 <gen>), Hide revival graphics
    • Unit - Replace Sylvanas 0001 <gen> with a Banshee using The new unit's max life and mana
Try this?
  • Events
    • Unit - Sylvanas 0001 <gen> Dies
  • Conditions
    • (Number of units in (Units within 2500.00 of (Position of Sylvanas 0001 <gen>) matching ((Matching unit) Equal to Arthas).)) Equal to 1
  • Actions
An alternative
  • Events
    • Unit - Sylvanas 0001 <gen> Dies
  • Conditions
  • Actions
    • Set VariableSet Loc[1] = (Position of Sylvanas 0001 <gen>)
    • Set VariableSet Group[1] = (Units within 2500.00 of Loc[1] matching ((Matching unit) Equal to Arthas).)
    • Custom script: call RemoveLocation(udg_Loc[1])
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Number of units in Group[1]) Not equal to 0
      • Then - Actions
        • Custom script: call DestroyGroup(udg_Group[1])
        • Wait 5.00 game-time seconds
        • Unit - Change ownership of Sylvanas 0001 <gen> to Player 4 (Purple) and Change color
        • Set VariableSet Loc[1] = (Position of Sylvanas 0001 <gen>)
        • Hero - Instantly revive Sylvanas 0001 <gen> at Loc[1], Hide revival graphics
        • Custom script: call RemoveLocation(udg_Loc[1])
        • Unit - Replace Sylvanas 0001 <gen> with a Banshee using The new unit's max life and mana
      • Else - Actions
        • Custom script: call DestroyGroup(udg_Group[1])
Another one :/
 
Last edited:
Level 19
Joined
Feb 27, 2019
Messages
582
No problem. The Condition can be met with either Real, Integer or Boolean as the Boolean below shows. Maybe even in more ways?
  • (Arthas is in (Units within 2500.00 of (Position of (Sylvanas 0001 <gen>)).).) Equal to True
 
Status
Not open for further replies.
Top