Random Terrain - Co-ordinates Help +rep

Fluffball

Well-Known Member
Reaction score
35
Ok, I made a trigger for random terrain for 2 reasons
- Ultimate Replayability
- Players will be able to type -sunkentemple and get sunken temple type terrain and the like for different tilesets

I think it is the Co-ordinates that are screwing up, so here is the trigger.

Code:
Randomized Terrain
    Events
        Map initialization
    Conditions
    Actions
        Set TempInteger = (Random integer number between 1 and 100)
        For each (Integer A) from 1 to (Integer((Width of (Playable map area)))), do (Actions)
            Loop - Actions
                Set TempReal = ((Real((Integer A))) x 32.00)
                For each (Integer B) from 1 to (Integer((Height of (Playable map area)))), do (Actions)
                    Loop - Actions
                        Set TempReal2 = ((Real((Integer B))) x 32.00)
                        Set TempPoint = (Point((Real((Integer A))), (Real((Integer B)))))
                        Environment - Change terrain type at TempPoint to TerrainAshenvale[(Random integer number between 1 and 4)] using variation -1 in an area of size 1 and shape Square

Code:
Melee Initialization
    Events
        Map initialization
    Conditions
    Actions
        Set TerrainAshenvale[1] = Ashenvale - Lumpy Grass
        Set TerrainAshenvale[2] = Ashenvale - Vines
        Set TerrainAshenvale[3] = Ashenvale - Leaves
        Set TerrainAshenvale[4] = Lordaeron Summer - Dark Grass


I know it's a mess, but please help.
 

YourFace

<span style="color:#9C9C9C;"><strong>Runner Up - T
Reaction score
91
i dont know the difference between integer a and b but in your first conditional statement you use for every integer B maybe thats the problem:confused:
it's too long to read this late at night sorry, i got school, im only in 8th grade:D sorry man, good luck
 

Weyrling

New Member
Reaction score
25
Immediately Noticeable: You only set the random number (TempInteger) once, yet go through a large number of loops using it.
Was this intentional?
Edit: For efficiency, you should place the
Code:
Set TempReal = ((Real((Integer A))) x 32.00)
Outside of the B loop, but inside the A loop.
Also, coordinate 0,0 is the center of the map, not the corner.
Additionally, you should use 'Entire Map' not 'Playable Map Area'.
 

Fluffball

Well-Known Member
Reaction score
35
Yes, it is intentional, but, since I use a very large amount of loops, then i will set a terrain type variable array at the start to make it look neater and be more efficient

BTW, i set the max camera place thing to playable map area, so i dont need to do entire map
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Replacing a map's terrain in GUI is just not possible.
It will either take 5 minutes or never finish...

There's a submission though in "Tutorials" that does this.
It's also in JASS and uses ".execute()" to get the job done.
 

Fluffball

Well-Known Member
Reaction score
35
Are you talking about Ghan04's submission? I would use that, but I can't think of a way to make his system deal with 1x1 squares, maybe even 2x2?

I currently have little to none knowledge of JASS, so i probably can't do it.

(Can't currently rep you Ace)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top