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

Changing water in-game

Status
Not open for further replies.
Level 18
Joined
Aug 13, 2007
Messages
1,584
Hi. So I'm trying to make a map about ancient Kalimdor and I'm running into a huge problem when I have to represent the Sundering. Basically, I have to turn a large portion of the ground on the map into water.

The problem is, it cannot be done via a simple terrain deformation:

  • Actions
  • Environment - Create a 2.00 second Permanent crater deformation at (Center of Region 006 <gen>) with radius 1024.00 and depth 512.00
because the deformation does occur, but the terrain does remain as ground, even if the surrounding water is above it, it does not "flood" it. I am aware this is due to the water plane mesh being set upon map initialization and not being editable in-game.

So I tried to use some type of water doodad/destructible and switch the pathing in the region from ground to naval:

  • Actions:
  • Environment - Set terrain pathing at (Center of Region 006 <gen>) of type Walkability to Off
  • Environment - Set terrain pathing at (Center of Region 006 <gen>) of type Floatability to On
Guess what - the pathing doesn't work at all. The ground units that used to be in the region still stand there happily, moving about, and sea units cannot enter the region, even if it is surrounded by water.

What troubles me is that naval pathing is not on the same layer as ground, air and buildable pathing. Else I would have just made a destructible with a pathing map that only allows floating and spam it across the map. Regrettably, I do not know where to locate or how to edit the naval pathing map. I only know it shows up as a blank (as opposed to ground pathing, which is orange) space when I press N in the editor.

Thanks in advance for any information you might share on the subject.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
I do not know if it does work that way but your test is off because you do not modify the whole region. The Set Terrain Pathing action takes a location argument, so it only affects that spot, meaning the pathing cell of 32*32 in size the location is in (display smallest grid in World Editor to see the pathing cells). You would normally build yourself a function to iterate over the region.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
You do not have to.

  • Set r = Region 000 <gen>
  • For each (Integer A) from 0 to (((Integer((Height of r))) / 32) - 1), do (Actions)
    • Loop - Actions
      • For each (Integer B) from 0 to (((Integer((Width of r))) / 32) - 1), do (Actions)
        • Loop - Actions
          • Set x = ((Min X of r) + ((Real((Integer B))) x 32.00))
          • Set y = ((Min Y of r) + ((Real((Integer A))) x 32.00))
          • Set p = (Point(x, y))
          • Environment - Set terrain pathing at p of type Walkability to Off
          • Environment - Set terrain pathing at p of type Floatability to On
          • Custom script: call RemoveLocation(udg_p)
Works for not too big-sized regions.
 
Status
Not open for further replies.
Top