• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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
933
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?
 
Status
Not open for further replies.
Top