• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Change specific tileset in an area to another

Status
Not open for further replies.
Level 6
Joined
Sep 19, 2005
Messages
169
Hi. I need help creating a system to change the terrain type for an area of land. It is not square in shape, imagine just a random polygon area of land with a few different terrain tiles on it, and I need to be able to swap back and forth between two tilesets.

In GUI I couldnt think of any smart solution because theres no way to change specific poritons of land from one type to another tileset, only a condition to allow to check if a point contains that tileset which is lame.
 
Level 16
Joined
Aug 7, 2009
Messages
1,406
I did terrain modification in my HC6 entry. The spell "Hailstorm" creates a frozen field on the ground. It was kinda hard to get it work properly, and is kinda complicated (~150 lines from the 450 is the terrain data only), but you can examine the code if you want. It's written in vJASS though.
 
Last edited:
Level 19
Joined
Aug 8, 2007
Messages
2,765
160036-albums4747-picture60351.png


Uh. What.
 

ABM

ABM

Level 7
Joined
Jul 13, 2005
Messages
279
You can do it in GUI

[Trigger=]
Initialisation Terrain
Events
Conditions
Actions
Environnement - Change terrain type at (Point(x, y)) to Summer Lordaeron - Terre using variation -1 in an area of size 1 and shape Cercle
Environnement - Change terrain type at (Point(x, y)) to Barrens - Terre using variation -1 in an area of size 3 and shape Cercle
[/Trigger]

you can ask for circle or square shape from point choosing the wideness...
personally i advise you if you want to make something special to manually paint the terrain with a 1 wide brush.
variation of -1 = random variation, if you put something else it will paint with the variation choosen if avaiable

you need center coordinate, the form and size of drawing, then do the calculus to change the point each time to each position and draw...
remember that 1 square like a tree pathing (4x4 half square) is actually 128 distance in coordinate.
the only little flaw with this method is if the terrain will be centered at random using ability at point as event, the drawing could be off by 64 pixel...
because when you paint the tile the tile itself is centered so on the editor you always paint at intersection of 4 tiles..
ex:
_ _ _
|_|_|
|_|_|

the point if centered not in the middle of this will automatically paint the middle, so the square your aiming might be painted a little left, right, up or down....
but that is just for the center tile all other tiles will work correctly from the center decided by the game.
so you drawing will be perfect but a little off by 32 or less pixel

also not sure, but to be able to change the tile of a map i think they should be avaiable in the map editor of this map (even if you didn't use them)
if you used 16 tiles max allready on the editor but want to draw with trigger a 17th it might not work.
when manually painting remember alway jump +/-128 from x or y.

thats all i think i can do a demo map if really needed but it should be easy...
if needed explain me exactly what you want to do in details.
 
Status
Not open for further replies.
Top