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

Boundaries and Cliffs...

Status
Not open for further replies.
For the boundaries thing, you can either use:
  • Set Point1 = (Position of (Unit))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Playable map area) contains Point1) Equal to False
    • Then - Actions
      • Unit - Kill (Unit)
    • Else - Actions
  • Custom script: call RemoveLocation (udg_Point1)
Of course these action will be used in a periodic event, to check the unit's position over time.

For the cliffs, since the result depends on the initial cliff level you have used in your map, make this test: Make a cliff and place a footman on it; then, in the Map Initialization, display the message: "(Terrain cliff level at (Point))" [where Point = (Position of Footman 0000 <gen>)]. Let's say it returns 3.

Then, just like the boundaries periodic check, make an additional check as:
  • Set Point1 = (Position of (Unit))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions)
        • ((Playable map area) contains Point1) Equal to False
        • (Terrain cliff level at Point1) Greater than or Equal to 3
    • Then - Actions
      • Unit - Kill (Unit)
    • Else - Actions
  • Custom script: call RemoveLocation (udg_Point1)
 
I realised what you're after and that one works. There are additionally three ways:

1) Check if the offset point has flyability and walkability; if yes, move the unit, else, kill it.

2) Use the old classic way of a hidden item in front of your unit that checks the same as (1).

3) Use this script that does the same thing: http://www.wc3c.net/showthread.php?t=102576
 
Status
Not open for further replies.
Top