• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Terrain Check

Status
Not open for further replies.
Level 9
Joined
Jun 7, 2008
Messages
440
I was wondering if there was a way to make a certain terrain unable to move on for regular units, while heros can move across it no problem? I have many spots that have this same type of terrain. I tried doing this in GUI, but failed. This is what I did:
  • Movement Restriction
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • ((Triggering unit) is A Hero) Equal to False
    • Actions
      • Set TempPoint = (Target point of issued order)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain type at TempPoint) Equal to Dalaran - Black Marble
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint)
Any Ideas? It can be done in GUI or JASS
 
Level 9
Joined
Nov 4, 2007
Messages
931
Well this might work, try using Periodic Timer of about 0.05 - 0.10, and loop through a unit group and have it do if GetTerrainType(PickedUnitX,PickedUnitY)=='ID", then SetUnitPosition(PickedUnit, X - ## in opposite direction the unit is facing, Y- ## in opposite direction the unit is facing), that should hopefully move the unit back away from the terrain it wasnt allowed on in the first place, i recommend to try adding the units to this group in a separate trigger rather than in the same one as the periodic timer will surely cause lag by constantly adding units.
 
Level 9
Joined
Jun 7, 2008
Messages
440
Thanks for that, as I already mentioned though, I have many spots where this type of terrain is. Making regions for that many spots, well, I suppose I could, but I was thinking there was an easier way to do it?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Have a look at this, the region is there just so you can add/remove units from the unit group so the script doesn't run all the time.

You can cover a lot of terrain spots of that specific type with one big region.

You don't even have to use regions at all.
 

Attachments

  • poikeea.w3x
    20.8 KB · Views: 32
Status
Not open for further replies.
Top