• 🏆 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 Terrain?

Status
Not open for further replies.
Level 7
Joined
Feb 26, 2011
Messages
238
Hi all, so i have an idea, if you walkover a terrain X ammount of times, is it possible to make it change?
Example- A footman walks over a patch of grass 12 times and the grass turns to dirt.....
If it is possible can anyone tell/show me how to?
Thanks!
 
Last edited:
Level 7
Joined
Jul 25, 2008
Messages
292
That actualy sounds awesome! so an entire battle field would get warn out! could it also go from thick grass to grass to dirt? If anyone figures out how to do this could they also say if it would slow a map by much (my map is big so I wouldn't be suprised...)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
It is possible, there's Environment - Change terrain type.

You could keep track of every unit's coordinates. The map is divided into tiles of 128x128 size. Check which tile's center the unit is closest to. Store it. Always compare the current and previous tile, if they are different, then the unit has moved over a tile and you can increase the "move over" count.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I've got question Maker
Say, we create a region, all same size, covering all areas in that map
How do we determine the size of the region = size of changed terrain ?
I mean, I did the math formula (Width * Height = Area) but when I did that, it just covers up all the map and it seems my formula has went overboard, like 96 x 96 (the size of Width and Height respectively)
What is the real formula, then ?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You mean size in tiles or what?

Integer((MaxX - MinX) / 128) = Number of horizontal tiles.

Min X is negative so it will add the numbers up. The integer conversion convets the value to nearest possible tile number (downwards conversion).

Do the same with y to get the number of vertical tiles.

I think there's also width of region function.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Uh, the size of the region is:
(GetRectMaxX(rect)-GetRectMinX(rect)) * (GetRectMaxY(rect)-GetRectMinY(rect))

That should give a real representing the area (surface) of the rect.
I don't know how to do this in GUI (aside from custom script of course, which isn't GUI in my eyes).

when I did that, it just covers up all the map and it seems my formula has went overboard, like 96 x 96 (the size of Width and Height respectively)
96x96 is a very small region.
However, if you use this:
  • Environment - Change terrain type at loc to type variation 0 in an area of size 1 and shape Circle
Note that the "Size 1" actually means it will cover an area of 128x128 warcraft-units.
So a size of 96x96 would mean it'll cover a size of 128*96 = 12288x12288 warcraft-units, obviously covering the entire map.
 
Level 7
Joined
Feb 26, 2011
Messages
238
It is possible, there's Environment - Change terrain type.

You could keep track of every unit's coordinates. The map is divided into tiles of 128x128 size. Check which tile's center the unit is closest to. Store it. Always compare the current and previous tile, if they are different, then the unit has moved over a tile and you can increase the "move over" count.

I've got question Maker
Say, we create a region, all same size, covering all areas in that map
How do we determine the size of the region = size of changed terrain ?
I mean, I did the math formula (Width * Height = Area) but when I did that, it just covers up all the map and it seems my formula has went overboard, like 96 x 96 (the size of Width and Height respectively)
What is the real formula, then ?

You mean size in tiles or what?

Integer((MaxX - MinX) / 128) = Number of horizontal tiles.

Min X is negative so it will add the numbers up. The integer conversion convets the value to nearest possible tile number (downwards conversion).

Do the same with y to get the number of vertical tiles.

I think there's also width of region function.

Uh, the size of the region is:
(GetRectMaxX(rect)-GetRectMinX(rect)) * (GetRectMaxY(rect)-GetRectMinY(rect))

That should give a real representing the area (surface) of the rect.
I don't know how to do this in GUI (aside from custom script of course, which isn't GUI in my eyes).


96x96 is a very small region.
However, if you use this:
  • Environment - Change terrain type at loc to type variation 0 in an area of size 1 and shape Circle
Note that the "Size 1" actually means it will cover an area of 128x128 warcraft-units.
So a size of 96x96 would mean it'll cover a size of 128*96 = 12288x12288 warcraft-units, obviously covering the entire map.
Thanks but thats pretty confusing, i think i can figure it out though, +rep to all!
 
Status
Not open for further replies.
Top