• 🏆 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] Detecting Terrain's Rawcode

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
Well, basicly it requires this code in JASS

JASS:
function terraintype takes location l returns integer
    return GetTerrainTypeBJ(l)
endfunction

However, im not sure exacly how to use it with GUI.

You can try making something like this, im not sure it will work though.

  • Untitled Trigger 001
    • Events
      • Some Event
    • Conditions
    • Actions
      • Custom script: local location l = GetUnitLoc(GetTriggerUnit())
      • Custom script: local integer i = terraintype(l)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • i Equal to (Integer(Your_Rawcode))
        • Then - Actions
          • Do something
        • Else - Actions
      • Custom script: call RemoveLocation(l)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
You will need to put that function I gave you into your map header if you want this to work (and even then im not sure if the GUI code I gave you would work).

The map header is this

attachment.php


Click on that scroll and it will open to text boxes for you, copy that code to the lower part.
 
Status
Not open for further replies.
Top