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

[Trigger] Environment - Change Terrain Type

Status
Not open for further replies.
Level 2
Joined
Dec 14, 2008
Messages
21
Ok, so I decided it would be cool to set up a pokemon style animal trainer arena map where you can have different 'pets' to control. As part of the gameplay I though it would be nice to have different terrain style arenas, like a winter one (Northrend), a tropical one (Sunken Ruins), a forest one (Felwood), autumn (Lorderon Fall), a desert one (Barrens), etc.

Any who, using GUI I set up a trigger to test my idea, it periodically selects a random trigger from my list of terrain triggers. The terrain triggers then generate a base area of terrain type (example felwood - grass) for the arena size and then for each integer 1-20 generate a small ( 1 - 3 ) area of a random terrain type (example felwood - leaves) somewhere random inside the arena. I have made sure it has no leaks (call RemoveLocation( udg_TerrainChange )) and every thing was working smoothly until!!!

If I have more than approximately 3 different terrain styles (felwood, northrend, etc.) then instead of changing the terrain type to what it's supposed to, it changes it to a random one of the previous so far done 3. Let me give you an example as an explantion:

It does the barrens one, perfect, then it does the sunken ruins one, all is well, then the lorderon fall one, things are great, then it tries to do the northrend one and instead of changing the terrain to northrend tiles, it does random barrens ones instead, it says that it ran the northrend trigger, and the terrain types don't match the usual barrens ones. Since it's randomly generated it's not always these ones (ie some times the northrend works fine and the lorderon fall one fails etc).


My question is, does anyone know of this bug and any way to fix it?

Might it be because I am using it on the same terrain spots? If I change the spots will the bug disapear?

Is it becase I'm using GUI? I know some JASS **, so if I had to try and re-do it in JASS I probably could (or if someone wrote one for me :xxd: ) but only if I knew it was gonna work!

Is there simply a limit to the number of different terrain types you can use, even with triggers? I didn't think this was the case because I swear I've seen maps that used them all!


Please help me out guys :thumbs_up:


** I am fairly adept at Java, and a C++ beginner, I have read a couple guides on JASS but prefer GUI because I'm too lazy to type and to learn all the JASS syntax (war3 programming is my break from C++ / Java learning).
 
Level 24
Joined
Jun 16, 2008
Messages
1,939
it would be best to reset the terrain type of that area after each change, when it is no longer needed, or before u create a new one

else check the variable or whatever and integers you use

the trigger may just reselect the barrens thing because it randoms from 1 to 3 and you would have to have as many chances as terraintypes

hope it helped u

hint: post the trigger
 
Level 2
Joined
Dec 14, 2008
Messages
21
  • Felwood
  • Conditions
  • Actions
    • Custom script call RemoveLocation( udg_TerrainChange )
    • Set TerrainChange = (Point(0.00,0.00))
    • Environment - Change terrain type at TerrainChange to Felwood - Grass using variation -1 in an area of size 18 and shape Circle
    • For each (Integer A) from 1 to 20, do (Actions)
      • Loop - Actions
        • Custom script call RemoveLocation( udg_TerrainChange )
        • Set TerrainChange = (Point((Random real number between -1500.00 and 700.00), (Random real number between -1500.00 and 850)))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Random integer number between 1 and 4) Equal to 1
          • Then - Actions
            • Environment - Change terrain type at TerrainChange to Felwood - Rock using variation -1 in an area of size (Random integer number between 1 and 3) and shape Circle
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Random integer number between 1 and 3) Equal to 1
              • Then - Actions
                • Environment - Change terrain type at TerrainChange to Felwood - Leaves using variation -1 in an area of size (Random integer number between 1 and 3) and shape Circle
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Random integer number between 1 and 2) Equal to 1
                  • Then - Actions
                    • Environment - Change terrain type at TerrainChange to Felwood - Vines using variation -1 in an area of size (Random integer number between 1 and 3) and shape Circle
                  • Else - Actions
                    • Environment - Change terrain type at TerrainChange to Felwood - Rough Dirt using variation -1 in an area of size (Random integer number between 1 and 3) and shape Circle
That's an example of one of the different arenas (Forest). Nothing changes from arena to arena except the Environment change will be for example:

  • Environment - Change terrain type at TerrainChange to Northrend - Snow using variation -1 in an area of size (Random integer number between 1 and 3) and shape Circle
See how just the Northrend - Snow (from Felwood - Grass) changes.

I thought my self pretty clever until it didn't work :sad:

And what do you mean by reset the terrain type? I tried including a line that changed it back to barrens dirt (the starting terrain type) then waiting 2 seconds and then doing it's thing... doesn't fix it :angry:

P.S. The trigger that calls the changes is simply the same kind of randomization I used for the terrain types where it goes:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Random integer number between 1 and 4) Equal to 1
    • Then - Actions
      • Trigger - Run Felwood <gen> (checking conditions)
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 3) Equal to 1
Etc. Etc.

Hope some one can help me solve it now :gg:

If some one could come up with any kind of alternative method for getting a similar result that would be just as good too :grin:
 
Status
Not open for further replies.
Top