Tile Replacement Trigger

DeepThought

New Member
Reaction score
1
For a map I am working on, I want to take advantage of more tiles then what the WE's defaults can allow. What I want is something (preferably GUI but regular JASS is fine as well) that will A. select all the terrain of a specific type (for example, "Lordaeron Dirt") using loops or whatever, then B. replace the terrain with another type (example "Northrend Dirt). That's basically all I want. I tried doing this, but none of my methods were as sucsessful and I had hoped. I am asking for your assistance.

Here is what I mean, in screenshot form:

Before
After

Hopefully someone can help me out here.

EDIT: Keep in mind the screenshots are for example purposes only. I am going for a much less random replacement.
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Code:
Untitled Trigger 001
    Events
        Time - Every 2.10 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                For each (Integer B) from 1 to 6, do (Actions)
                    Loop - Actions
                        Set p = ((Center of Region 000 <gen>) offset by ((128.00 x (Real((Integer A)))), (128.00 x (Real((Integer B))))))
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Terrain type at p) Equal to Lordaeron Summer - Dark Grass
                            Then - Actions
                                Environment - Change terrain type at p to Lordaeron Summer - Rock using variation -1 in an area of size 1 and shape Circle
                            Else - Actions
Place the region bottom left of the place you want to change the terrain type. Misplaced it? Move it again.
Leaks points
 

Romek

Super Moderator
Reaction score
964
Click

It's in vJass though. Any reason why you only want regular Jass?
 

DeepThought

New Member
Reaction score
1
Code:
Untitled Trigger 001
    Events
        Time - Every 2.10 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                For each (Integer B) from 1 to 6, do (Actions)
                    Loop - Actions
                        Set p = ((Center of Region 000 <gen>) offset by ((128.00 x (Real((Integer A)))), (128.00 x (Real((Integer B))))))
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Terrain type at p) Equal to Lordaeron Summer - Dark Grass
                            Then - Actions
                                Environment - Change terrain type at p to Lordaeron Summer - Rock using variation -1 in an area of size 1 and shape Circle
                            Else - Actions
Place the region bottom left of the place you want to change the terrain type. Misplaced it? Move it again.
Leaks points

Yup, this works! Thanks +rep.
 

Romek

Super Moderator
Reaction score
964
You may want to note that ManyTimes' trigger leaks (Center of Region 000 <gen>). :)
 

DeepThought

New Member
Reaction score
1
Yeah, in this case I would have to call RemoveLocation(udg_p). Despite the leak it is still very helpful :)
 

Romek

Super Moderator
Reaction score
964
It'd still leak, as you're not setting (Center of Region 000 <gen>) to a variable, and thus cannot remove it. :)
You'd need to use 2 point variables there.
One for Center of Region, and the other for that one offset.
Then remove them both.
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top