Terrain Generator help

Teach101

New Member
Reaction score
4
I'm currently making a Terrain Generator, but I'm having a problem. Deformations are on my mountains, because I can't check Z for a radius (At least I don't know how) and when the hills form, it may take the deformations that formed before with it, causing holes in my mountains.

Anybody know how to fix this dilemma?


Figured it out myself.
 

Teach101

New Member
Reaction score
4
You could post how you figured it out so other people can see it too? :O

Trigger:
  • <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code">
    • <div class="bbCodeBlock-title">
      • Code:
    • </div>
    • <div class="bbCodeBlock-content" dir="ltr">
      • <pre class="bbCodeCode" dir="ltr" data-xf-init="code-block" data-lang=""><code>Terrain 3
        • Events
          • Time - Every 0.10 seconds of game time
        • Conditions
        • Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MUI Greater than 8000
            • Then - Actions
              • Set MUI = 0
            • Else - Actions
              • Set MUI = (MUI + 1)
          • Set Luck_Terrain[MUI] = (Random integer number between 1 and 10)
          • Set FoeSaken_Point[MUI] = (Random point in (Playable map area))
          • Custom script: set udg_Height_Terrain[udg_MUI] = GetLocationZ(udg_FoeSaken_Point[udg_MUI])
          • -------- Valley&#039;s --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Chance_More_Than Greater than or equal to 6
              • Luck_Terrain[MUI] Greater than or equal to Chance_More_Than
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                • Then - Actions
                  • Set Formation_Final = (Random real number between Formation_Least and Formation_Top)
                  • Set Formation_Radius_Final = (Random real number between Formation_Radius_Least and Formation_Radius_Top)
                  • Set Radius_Check = (Formation_Radius_Final / 3.00)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Height_Terrain[MUI] Greater than or equal to 120.00
                    • Then - Actions
                      • For each (Integer A) from 1 to 5, do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Radius_Check_Boolean Equal to True
                            • Then - Actions
                              • Set FoeSaken_Point_5Star[MUI] = (FoeSaken_Point[MUI] offset by Radius_Check towards (Degrees_Terrain + 72.00) degrees)
                              • Custom script: set udg_Height_Terrain[udg_MUI] = GetLocationZ(udg_FoeSaken_Point_5Star[udg_MUI])
                              • If (Height_Terrain[MUI] Greater than or equal to 110.00) then do (Set Radius_Check_Boolean = True) else do (Do nothing)
                              • Set Check_Radius_Number = (Check_Radius_Number + 1)
                            • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Check_Radius_Number Equal to 5
                              • Radius_Check_Boolean Equal to True
                            • Then - Actions
                              • Set Radius_Check = (Formation_Radius_Final / 2.00)
                              • For each (Integer B) from 1 to 5, do (Actions)
                                • Loop - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Radius_Check_Boolean Equal to True
                                    • Then - Actions
                                      • Set FoeSaken_Point_5Star[MUI] = (FoeSaken_Point[MUI] offset by Radius_Check towards (Degrees_Terrain + 72.00) degrees)
                                      • Custom script: set udg_Height_Terrain[udg_MUI] = GetLocationZ(udg_FoeSaken_Point_5Star[udg_MUI])
                                      • If (Height_Terrain[MUI] Greater than or equal to 110.00) then do (Set Radius_Check_Boolean = True) else do (Do nothing)
                                      • Set Check_Radius_Number = (Check_Radius_Number + 1)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • Check_Radius_Number Equal to 10
                                          • Radius_Check_Boolean Equal to True
                                        • Then - Actions
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • Height_Terrain[MUI] Less than 150.00
                                              • Height_Terrain[MUI] Greater than Terrain_Start_Height
                                            • Then - Actions
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • Height_Terrain[MUI] Greater than or equal to 120.00
                                                • Then - Actions
                                                  • For each (Integer A) from 1 to 5, do (Actions)
                                                    • Loop - Actions
                                                      • Set FoeSaken_Point_5Star[MUI] = (FoeSaken_Point[MUI] offset by 100.00 towards (Degrees_Terrain + 72.00) degrees)
                                                      • Custom script: set udg_Height_Terrain[udg_MUI] = GetLocationZ(udg_FoeSaken_Point_5Star[udg_MUI])
                                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                        • If - Conditions
                                                          • Height_Terrain[MUI] Less than 150.00
                                                          • Height_Terrain[MUI] Greater than Terrain_Start_Height
                                                        • Then - Actions
                                                          • Environment - Create a Formation_Time second Permanent crater deformation at FoeSaken_Point[MUI] with radius Formation_Radius_Final and depth Formation_Final
                                                        • Else - Actions
                                                      • Custom script: call RemoveLocation (udg_FoeSaken_Point_5Star[udg_MUI])
                                                • Else - Actions
                                                  • Environment - Create a Formation_Time second Permanent crater deformation at FoeSaken_Point[MUI] with radius Formation_Radius_Final and depth Formation_Final
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Height_Terrain[MUI] Less than 150.00
                                  • Height_Terrain[MUI] Greater than Terrain_Start_Height
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Height_Terrain[MUI] Greater than or equal to 120.00
                                    • Then - Actions
                                      • For each (Integer A) from 1 to 5, do (Actions)
                                        • Loop - Actions
                                          • Set FoeSaken_Point_5Star[MUI] = (FoeSaken_Point[MUI] offset by 100.00 towards (Degrees_Terrain + 72.00) degrees)
                                          • Custom script: set udg_Height_Terrain[udg_MUI] = GetLocationZ(udg_FoeSaken_Point_5Star[udg_MUI])
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • Height_Terrain[MUI] Less than 150.00
                                              • Height_Terrain[MUI] Greater than Terrain_Start_Height
                                            • Then - Actions
                                              • Environment - Create a Formation_Time second Permanent crater deformation at FoeSaken_Point[MUI] with radius Formation_Radius_Final and depth Formation_Final
                                            • Else - Actions
                                          • Custom script: call RemoveLocation (udg_FoeSaken_Point_5Star[udg_MUI])
                                    • Else - Actions
                                      • Environment - Create a Formation_Time second Permanent crater deformation at FoeSaken_Point[MUI] with radius Formation_Radius_Final and depth Formation_Final
                                • Else - Actions
                          • Custom script: call RemoveLocation (udg_FoeSaken_Point_5Star[udg_MUI])
                    • Else - Actions
                      • Environment - Create a Formation_Time second Permanent crater deformation at FoeSaken_Point[MUI] with radius Formation_Radius_Final and depth Formation_Final
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                • Then - Actions
                • Else - Actions
          • -------- Mountains --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Chance_Less_Than Less than or equal to 5
              • Luck_Terrain[MUI] Less than or equal to Chance_Less_Than
              • Height_Terrain[MUI] Less than or equal to Mountain_Top_Height
            • Then - Actions
              • Set Mountain_Final = (Random real number between Mountain_Least and Mountain_Most)
              • Set Mountains_Radius_Final = (Random real number between Mountain_Radius_Least and Mountain_Raidus_Top)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Height_Terrain[MUI] Less than or equal to 105.00
                • Then - Actions
                • Else - Actions
                  • Environment - Create a Formation_Time second Permanent crater deformation at FoeSaken_Point[MUI] with radius Mountains_Radius_Final and depth Mountain_Final
            • Else - Actions
          • Set Periodic_Time = (Periodic_Time + 0.10)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Chance_Less_Than Less than or equal to 5
              • Periodic_Time Greater than or equal to Terraining_Time
            • Then - Actions
              • Set Chance_More_Than = 6
              • Set Chance_Less_Than = 6
              • Set Periodic_Time = 0.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Chance_Less_Than Greater than or equal to 6
              • Periodic_Time Greater than or equal to Terraining_Time
            • Then - Actions
              • Trigger - Turn on Terrain Set Terrain &lt;gen&gt;
              • Set Chance_Less_Than = 5
              • Set Periodic_Time = 0.00
              • Set Chance_More_Than = 5
              • Trigger - Turn off (This trigger)
            • Else - Actions
          • Set Check_Radius_Number = 0
          • Set Radius_Check_Boolean = False
          • Custom script: call RemoveLocation (udg_FoeSaken_Point[udg_MUI])</code></pre>
    • </div>
    • </div>


It's most of the if/thens under valley. The last if/thens not under valley, are used to make hills before valleys. I will probably add something similar for mountains, so I can do other things and the load time will be shorter. Also I need to add the outer radius.
 
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