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

Change Terrain Tile Pathing Type

Status
Not open for further replies.
Level 19
Joined
Feb 4, 2009
Messages
1,313
Just get JNGP... honestly.

WITHOUT JNGP!

Why do you think I write this?

The easiest fix is to go into the structure that you want to be buildable on that stone in the Object Editor, then uncheck the "PlacementRequires" - Buildable, and uncheck that.

I have stone floor and want to build on it but I also have an other type of stone floor which should not be buildable
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

Somehow I try something with this: ( For testing I use the "Lordaeron Summer - Rock )

  • TestTrigger
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint1 = (Random point in TestRect <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Terrain type at TempPoint1) Equal to Lordaeron Summer - Rock) and ((Terrain pathing at TempPoint1 of type Buildability is off) Equal to True)
        • Then - Actions
          • Environment - Set terrain pathing at TempPoint1 of type Buildability to On
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempPoint1)
The thing is (maybe you know a way) to put this "TempPoint1" only at places where the terrain type is "Lordaeron Summer - Rock" or just increase the the size where he set the terrain to buildable ( because it's only always a very small part - so it need some time to change all )

Edit: But somehow I don't get this what I want -_-;
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
Seas =)

Somehow I try something with this: ( For testing I use the "Lordaeron Summer - Rock )

  • TestTrigger
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint1 = (Random point in TestRect <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Terrain type at TempPoint1) Equal to Lordaeron Summer - Rock) and ((Terrain pathing at TempPoint1 of type Buildability is off) Equal to True)
        • Then - Actions
          • Environment - Set terrain pathing at TempPoint1 of type Buildability to On
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempPoint1)
The thing is (maybe you know a way) to put this "TempPoint1" only at places where the terrain type is "Lordaeron Summer - Rock" or just increase the the size where he set the terrain to buildable ( because it's only always a very small part - so it need some time to change all )

Edit: But somehow I don't get this what I want -_-;

THAT's how people should answer :D

and it works <3

JASS:
function SetPathingRect takes rect re, pathingtype pt, boolean pathable returns nothing
    //probably this trigger won't work if you don't snap the regions to the grid

    //available pathing types
//PATHING_TYPE_ANY                 //if this is false you can't walk/build/fly on it
//PATHING_TYPE_WALKABILITY         //if this is false you can't walk on it
//PATHING_TYPE_FLYABILITY          //if this is false you can't fly on it
//PATHING_TYPE_BUILDABILITY        //if this is false you can't build on it
//PATHING_TYPE_PEONHARVESTPATHING  //don't know
//PATHING_TYPE_BLIGHTPATHING       //if this is false you can't build ziggs on it
//PATHING_TYPE_FLOATABILITY        //don't know
//PATHING_TYPE_AMPHIBIOUSPATHING   //don't know

    local real r = 32  //size of pathing blocks
    local real x = GetRectMinX(re)
    local real y
    local real x2 = GetRectMaxX(re)
    local real y2 = GetRectMaxY(re)

    loop
        exitwhen x == x2
        set y = GetRectMinY(re)
        loop
            exitwhen y == y2
            call SetTerrainPathable(x, y, pt, pathable)
            set y = y + r
        endloop
        set x = x + r
    endloop
    call RemoveRect(re)
    set re = null
    set pt = null
endfunction
  • Ini
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • Floating Text - Create floating text that reads Any Off at (Center of AnyOff <gen>) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads Walk Off at (Center of WalkOff <gen>) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads Fly Off at (Center of FlyOff <gen>) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads Build Off at (Center of BuildOff <gen>) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads Harvest Off at (Center of HarvestOff <gen>) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads Blight Off at (Center of BlightOff <gen>) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads Float Off at (Center of FloatOff <gen>) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Create floating text that reads Amphibious Off at (Center of AmphibiousOff <gen>) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Custom script: call SetPathingRect(gg_rct_AnyOn, PATHING_TYPE_ANY, true)
      • Custom script: call SetPathingRect(gg_rct_WalkOn, PATHING_TYPE_WALKABILITY, true)
      • Custom script: call SetPathingRect(gg_rct_FlyOn, PATHING_TYPE_FLYABILITY, true)
      • Custom script: call SetPathingRect(gg_rct_BuildOn, PATHING_TYPE_BUILDABILITY, true)
      • Custom script: call SetPathingRect(gg_rct_HarvestOn, PATHING_TYPE_PEONHARVESTPATHING, true)
      • Custom script: call SetPathingRect(gg_rct_BlightOn, PATHING_TYPE_BLIGHTPATHING, true)
      • Custom script: call SetPathingRect(gg_rct_FloatOn, PATHING_TYPE_FLOATABILITY, true)
      • Custom script: call SetPathingRect(gg_rct_AmphibiousOn, PATHING_TYPE_AMPHIBIOUSPATHING, true)
      • Custom script: call SetPathingRect(gg_rct_AnyOff, PATHING_TYPE_ANY, false)
      • Custom script: call SetPathingRect(gg_rct_WalkOff, PATHING_TYPE_WALKABILITY, false)
      • Custom script: call SetPathingRect(gg_rct_FlyOff, PATHING_TYPE_FLYABILITY, false)
      • Custom script: call SetPathingRect(gg_rct_BuildOff, PATHING_TYPE_BUILDABILITY, false)
      • Custom script: call SetPathingRect(gg_rct_HarvestOff, PATHING_TYPE_PEONHARVESTPATHING, false)
      • Custom script: call SetPathingRect(gg_rct_BlightOff, PATHING_TYPE_BLIGHTPATHING, false)
      • Custom script: call SetPathingRect(gg_rct_FloatOff, PATHING_TYPE_FLOATABILITY, false)
      • Custom script: call SetPathingRect(gg_rct_AmphibiousOff, PATHING_TYPE_AMPHIBIOUSPATHING, false)
edit:
it won't work for big regions cause of the operation limit
it's possible to break it using "Run <Trigger>" but I am unable to implent it

edit2:
ok I did it
 

Attachments

  • SetPathingRect.w3x
    12.9 KB · Views: 99
Last edited:
Status
Not open for further replies.
Top