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

Need unwalkable tiles

Status
Not open for further replies.
Level 4
Joined
Jul 11, 2007
Messages
82
I'm trying to make the Village Rock tile unwalkable (and unbuildable) and I've tried two different things but neither have worked. I don't want to resort to pathing blockers if possible.

First, I went to USMWE (or whatever it's called) in NewGen and selected the rock tiles and unchecked "walkable". I restarted the WE as it said and tested in game but that didn't work.

Next, I modified Terrain.slk by adding some 0s to the corresponding cells and imported it to TerrainArt\Terrain.slk

Sooooo any ideas on how I might have messed up either of these methods? Or is there another way that I haven't tried?
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
u could trigger it
(i once made a trigger which makes a region buildable instead of unbuildable)
nevertheless I'd suggest to code it again since my idea was quite slow (instant though)
biggest problem is the operation limit but it can be bypassed using "Run Trigger (ignoring conditions)" or something with jass
edit: here is the link http://www.hiveworkshop.com/forums/...e-98/change-terrain-tile-pathing-type-157398/ but it does not use any workarounds to bypass the region shit so it wont work with big regions
I'd suggest making something like that which checks tile types and runs the check trigger again every x executions where x is equal to some value small enough to prevent the rest of the code being skipped cause of mass function spam
 
Level 4
Joined
Jul 11, 2007
Messages
82
I'd rather not run that trigger 33 (or even 10) times per second because there are hundreds of units on the map. I'd like the pathing to just be blocked.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
You could wall it all off w/ pathing blockers if u really need it. UMWSE should work tho.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
If you're using JNGP:

JASS:
//! external PathMapper Vrck 2 1

That will make it unwalkable. By default Village Rock is already unbuildable, so you don't have to make any adjustments there.
 
Level 4
Joined
Jul 11, 2007
Messages
82
Hang on... so where do I put that code? (And do I put the //)

Also, where can I find the codes for the tiles? Such as VRock.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
You can put that code anywhere you want. Make a folder named "External" and a trigger-page named "PathMapper" and just plop it in there. Also, yes, you copy it exactly as I have written it (with the \\ marks). The codes for these tiles are located in TerrainArt/Terrain.slk, but I'm sure that there is reference to them in GUI. Let me see if I can't find it.

Here, you can choose whatever tile you want and then convert it to custom text, and it will generate the appropriate code (remember to leave out the ' marks).

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Environment - Change terrain type at (Center of (Playable map area)) to Village Fall - Rocks using variation -1 in an area of size 1 and shape Circle
If you convert this to custom text, it reads:

JASS:
...
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call SetTerrainTypeBJ( GetRectCenter(GetPlayableMapRect()), 'Qrck', -1, 1, 0 )
endfunction
...

So for Village Fall the code i Qrck.

This is what Village (normal) Rock converts to:

JASS:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call SetTerrainTypeBJ( GetRectCenter(GetPlayableMapRect()), 'Vrck', -1, 1, 0 )
endfunction
 
Level 4
Joined
Jul 11, 2007
Messages
82
I made the folder and the trigger and put that single line in there but I get an error on saving:

On external call:
//! external PathMapper Qrck 2
1//===================================================================================

Invalid check mode
1//===================================================================================
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Try this:

JASS:
//! external PathMapper Vrck 2 1 |

I just tested it on a new map and it worked. If you're still having issues perhaps try updating your Grimoire? I'm not sure on how up-to-date the JNGP download is with Grim.
 
Last edited:
Level 19
Joined
Feb 4, 2009
Messages
1,313
since it seems like you did not even read my post I will post it again
I even made a testmap for you
have fun with it
  • SetPathing Run
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- What shall be turned on or off? --------
      • Set PathingType = Walkability
      • -------- On or off? --------
      • Set b = False
      • -------- Where? --------
      • Set Region = (Playable map area)
      • -------- What? --------
      • Set TerrainType = Lordaeron Summer - Dark Grass
      • -------- This stuff is necessary for it to work --------
      • -------- Just ignore it unless it causes bugs --------
      • Set x = (Min X of Region)
      • Set y = (Min Y of Region)
      • Trigger - Run SetPathing Loop <gen> (ignoring conditions)
  • SetPathing Loop
    • Events
    • Conditions
    • Actions
      • -------- Reset counter and max values --------
      • Set i = 0
      • Set x2 = (Max X of Region)
      • Set y2 = (Max Y of Region)
      • -------- Loop threw every line and column --------
      • Custom script: loop
      • Custom script: exitwhen udg_x >= udg_x2
      • Custom script: loop
      • Custom script: exitwhen udg_y >= udg_y2
      • -------- Check terrain type --------
      • Custom script: if GetTerrainType(udg_x, udg_y) == udg_TerrainType then
      • -------- Change pathing type --------
      • Custom script: call SetTerrainPathable(udg_x, udg_y, udg_PathingType, udg_b)
      • Custom script: endif
      • -------- Bypass operation limit --------
      • Custom script: if udg_i == 1337 then
      • Trigger - Run (This trigger) (ignoring conditions)
      • Skip remaining actions
      • Custom script: endif
      • -------- Increase bypass counter --------
      • Set i = (i + 1)
      • -------- Move point to be checked up by 32 --------
      • Set y = (y + 32.00)
      • Custom script: endloop
      • -------- Move point right by 32 --------
      • Set x = (x + 32.00)
      • -------- Move point back to the bottom --------
      • Set y = (Min Y of Region)
      • Custom script: endloop
Notes:
-it will screw up wc3 pathfinding a little since it does not recognize this kind of pathing changes done during the game
-it will also cause lags on bad pcs
 

Attachments

  • SetPathing.w3x
    21.8 KB · Views: 107
Level 18
Joined
Jan 21, 2006
Messages
2,552
D4RK G4ND4LF said:
Notes:
-it will screw up wc3 pathfinding a little since it does not recognize this kind of pathing changes done during the game
-it will also cause lags on bad pcs

Usually there are many ways of doing things, but this here is dead wrong.

D4RK_G4ND4LF said:
since it seems like you did not even read my post I will post it again

Nobody should listen to your post.

I'm a little irritated that people are posting all of these useless "solutions" when there is one way of doing this properly in JNGP, and that's with the external PathMapper tool. Enabling UMSWE would also work in this case but nobody wants to enable UMSWE. Besides, there is no need for your map to be only UMSWE compatible when there are ways of avoiding it.

Its as if people are spamming the forums in hopes that they'll be thanked for their time. If you don't have the right answer, don't make one up out of thin air just to get noticed.

Bribe said:
Why don't you change the skin of Abyss? That's neither walkable nor buildable.

*Sigh*
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
Usually there are many ways of doing things, but this here is dead wrong.



Nobody should listen to your post.

I'm a little irritated that people are posting all of these useless "solutions" when there is one way of doing this properly in JNGP, and that's with the external PathMapper tool. Enabling UMSWE would also work in this case but nobody wants to enable UMSWE. Besides, there is no need for your map to be only UMSWE compatible when there are ways of avoiding it.

Its as if people are spamming the forums in hopes that they'll be thanked for their time. If you don't have the right answer, don't make one up out of thin air just to get noticed.

try it out yourself before calling my solution useless
the lag will be like 0.5 seconds everytime you change the terrain on an entire 256x256 map with a pentium II which should be fine since in exchange you can do it ingame anytime you want which is impossible with jngp as well as with a pathmapping tool
it supports all tile and pathing types and can be directly accessed using triggers which is worth a lot
and who cares about a very tiny pathfinding irregularity if he wants to make something unwalkable anyway :eekani:

and i did never talk about umswe anyway

edit:
according to Anitarf it is impossible to change back the pathing type
Note that, at least in my experience, tiles set to unpathable this way can not be made pathable again ingame by using destructibles like bridges or invisible platforms.

edit2:
if you execute the trigger at map initialization it will even work perfectly with the pathfinding (what wasn't that much of a deal anyway)
furthermore it removes the possible lag since it is added to the loading time instead and +0.5 sec to loading time won't hurt anyone

edit3:
regarding your problems with pathmapper
PathMapper doesn't work in 5c (since there's no mention of it in the changelog, I assume same is true for 5d), it gives an error saying that it wasn't found in the config file.
 
Last edited:
Level 18
Joined
Jan 21, 2006
Messages
2,552
I strongly suggest that you don't change the terrain-type like that, instead I would recommend just using the PathMapper command for a situation like yours.
 
Last edited:
Level 19
Joined
Feb 4, 2009
Messages
1,313
changing the pathing mid-game is a dumb idea in any situation. Systems made for dumb ideas are, well, dumb.

please use arguments instead of accusations

Someone who doesn't want to make maps that look like they've been made by a 3-year-old. It isn't a "tiny" irregularity either it can seriously screw with vital pathing calculations. Whats even funnier is how this system works when you add abilities that change the pathing of a unit, which you haven't even tried yourself since you're so narrow-minded as to the possible effects of fuxxing with pathing.

you are right
I did not test it since there aren't any abilities changing a unit's pathing type
instead the unit will be replaced with another unit with different pathing
yet if you found any bugs you are free to tell me about them
if you did that already why you did not state them in your post and if you didn't why did you even write it

however accusing people of being narrow-minded is not nice

Actually he states that they cannot be changed with a bridge/invisible platform, he didn't say anything about using triggers. Changing terrain pathability in-game is just asking for bugs. I'm sorry that I won't just sit here and let you give bad advice to this person who needs real help.

uuuuhhh....what a difference

** By the way, I checked out the link you gave in your first post and there isn't any code posted in your first post. Way to fail.

read the whole thread then
and even if it had been like that it would not matter since the code is in this thread already

I'll end this now cause I have other things to do
I'll let everyone decide by himself
if it works for the person it is fine
if it does not they are free to use your JNGP which can do all these nice things
 
Status
Not open for further replies.
Top