• 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.

Destructibles always created in center (5 ecookies for help!)

Status
Not open for further replies.
Level 5
Joined
Jun 24, 2012
Messages
112
For some reason, my doodads are more concentrated around the center of the circle. I've also tried using Point with Polar Offset doesn't make much difference. Will post screenshots if needed.
Also, is there a way to create circular regions?

  • RTG Marsh Generate
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to RTG_TerrainFeatureChance
        • Then - Actions
          • Set RTG_Depth = (Random real number between 160.00 and 192.00)
          • Set RTG_Width = (128.00 x (Random real number between 8.00 and 13.00))
          • Set RTG_EnvironmentVolume = ((Random integer number between 12 and 16) x ((Integer(RTG_Width)) / 128))
          • Set RTG_CritterVolume = ((Random integer number between 1 and 3) x ((Integer(RTG_Width)) / 256))
          • Set RTG_Environment[0] = Cattail
          • Set RTG_Environment[4] = Flies
          • Set RTG_Critter[0] = Frog
          • Set RTG_Critter[1] = Skink
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 100) Less than or equal to RTG_DeathMarshChance
            • Then - Actions
              • Set RTG_PropVolume = ((Random integer number between 4 and 8) x ((Integer(RTG_Width)) / 128))
              • Set RTG_Environment[1] = Corpse Impaled
              • Set RTG_Environment[2] = Corpse Impaled
              • Set RTG_Environment[3] = Head on Spear
            • Else - Actions
              • Set RTG_PropVolume = ((Random integer number between 1 and 3) x ((Integer(RTG_Width)) / 128))
              • Set RTG_Environment[1] = Log
              • Set RTG_Environment[2] = Corpse Impaled
              • Set RTG_Environment[3] = Head on Spear
          • Set RTG_Terrain[0] = Ashenvale - Grassy Dirt
          • -------- --- --------
          • -------- Generating Terrain Object --------
          • -------- --- --------
          • Set RTG_Point[0] = (Random point in Spawn Marsh <gen>)
          • Camera - Pan camera for Player 1 (Red) to RTG_Point[0] over 0.00 seconds
          • Camera - Set Player 1 (Red)'s camera Distance to target to 2500.00 over 0.00 seconds
          • Unit - Create 1 Headhunter for Player 1 (Red) at RTG_Point[0] facing Default building facing degrees
          • Environment - Create a 0.01 second Permanent crater deformation at RTG_Point[0] with radius RTG_Width and depth RTG_Depth
          • Environment - Change terrain type at RTG_Point[0] to RTG_Terrain[5] using variation -1 in an area of size (((Integer(RTG_Width)) / 128) - 1) and shape Circle
          • Wait 0.10 seconds
          • Destructible - Create a Birds at RTG_Point[0] facing (Random angle) with scale (Random real number between 0.80 and 1.20) and variation 0
          • Trigger - Run RTG Marsh Populate <gen> (ignoring conditions)
          • Wait until (RTG_MarshPopulated Equal to True), checking every 0.10 seconds
          • Custom script: call RemoveLocation(udg_RTG_Point[0])
        • Else - Actions
      • Custom script: call DestroyTrigger(gg_trg_RTG_Marsh_Populate)
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
  • RTG Marsh Populate
    • Events
    • Conditions
    • Actions
      • -------- --- --------
      • -------- Generating Critters --------
      • -------- --- --------
      • Set RTG_MaxRadius = (Random real number between 0.00 and (RTG_Width - 128.00))
      • Set RTG_X = (Random real number between (RTG_MaxRadius x -1.00) and RTG_MaxRadius)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 0 and 1) Equal to 0
        • Then - Actions
          • Set RTG_Y = ((Square root(((Power(RTG_MaxRadius, 2.00)) - (Power(RTG_X, 2.00))))) x 1.00)
        • Else - Actions
          • Set RTG_Y = ((Square root(((Power(RTG_MaxRadius, 2.00)) - (Power(RTG_X, 2.00))))) x -1.00)
      • Set RTG_Point[1] = (RTG_Point[0] offset by (RTG_X, RTG_Y))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RTG_Count[0] Less than RTG_CritterVolume
        • Then - Actions
          • Set RTG_Count[0] = (RTG_Count[0] + 1)
          • Unit - Create 1 RTG_Critter[(Random integer number between 0 and 1)] for Neutral Passive at RTG_Point[1] facing (Random angle) degrees
          • Trigger - Run (This trigger) (ignoring conditions)
        • Else - Actions
          • -------- --- --------
          • -------- Generating Environment --------
          • -------- --- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at RTG_Point[1]) Equal to Ashenvale - Grass
            • Then - Actions
              • Trigger - Run (This trigger) (ignoring conditions)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RTG_Count[1] Less than RTG_EnvironmentVolume
                • Then - Actions
                  • Set RTG_Count[1] = (RTG_Count[1] + 1)
                  • Destructible - Create a RTG_Environment[0] at RTG_Point[1] facing (Random angle) with scale (Random real number between 0.50 and 0.75) and variation 0
                  • For each (Integer B) from 1 to 6, do (Actions)
                    • Loop - Actions
                      • Set RTG_Point[2] = (RTG_Point[1] offset by 64.00 towards (60.00 x (Real((Integer B)))) degrees)
                      • Destructible - Create a RTG_Environment[0] at RTG_Point[2] facing (Random angle) with scale (Random real number between 0.50 and 0.75) and variation 0
                      • Custom script: call RemoveLocation(udg_RTG_Point[2])
                  • Trigger - Run (This trigger) (ignoring conditions)
                • Else - Actions
                  • -------- --- --------
                  • -------- Generating Props --------
                  • -------- --- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RTG_Count[2] Less than RTG_PropVolume
                    • Then - Actions
                      • Set RTG_Scale[1] = (Random real number between 0.80 and 1.00)
                      • Set RTG_Scale[2] = (Random real number between 1.15 and 1.40)
                      • Set RTG_Scale[3] = (Random real number between 1.15 and 1.40)
                      • Set RTG_Count[2] = (RTG_Count[2] + 1)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Random integer number between 1 and 100) Less than or equal to 60
                        • Then - Actions
                          • Set RTG_RandomInt = (Random integer number between 1 and 4)
                        • Else - Actions
                          • Set RTG_RandomInt = (Random integer number between 2 and 4)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • RTG_RandomInt Greater than or equal to 2
                        • Then - Actions
                          • Destructible - Create a RTG_Environment[4] at RTG_Point[1] facing (Random angle) with scale (Random real number between 0.80 and 1.20) and variation 0
                        • Else - Actions
                      • Destructible - Create a RTG_Environment[RTG_RandomInt] at RTG_Point[1] facing (Random angle) with scale RTG_Scale[RTG_RandomInt] and variation 0
                      • Trigger - Add to RTG Destroy <gen> the event (Destructible - (Last created destructible) dies)
                      • Trigger - Run (This trigger) (ignoring conditions)
                    • Else - Actions
                      • Set RTG_MarshPopulated = True
                      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
      • Custom script: call RemoveLocation(udg_RTG_Point[1])
 
Status
Not open for further replies.
Top