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

[Solved] Crashing instantly

Status
Not open for further replies.
Level 5
Joined
Sep 27, 2011
Messages
141
Can someone tell me why my trigger crashes the game instantly also how to fix it. Thanks. Generated starts at 0 Density is random from 100 to 200
  • Generate Terrain
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • For each (Integer tempInt) from 1 to 100, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (((Real(Generated)) / (Real(Density))) x 100.00) Less than or equal to (Real(tempInt))
            • Then - Actions
              • Set tempString = (tempString + RedBar)
            • Else - Actions
              • Set tempString = (tempString + GreenBar)
      • Cinematic - Clear the screen of text messages for (All players)
      • Game - Display to (All players) the text: tempString
      • For each (Integer tempInt) from 1 to (Density / 20), do (Actions)
        • Loop - Actions
          • Set Generated = (Generated + 1)
          • Set tempLoc = (Random point in (Playable map area))
          • Destructible - Create a Tree_Types[(Random integer number between Tree_Numbers and (Tree_Numbers + 1))] at tempLoc facing (Random angle) with scale 1.00 and variation 0
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 5) Equal to 3
            • Then - Actions
              • Set tempLoc2 = (tempLoc offset by (Random real number between 50.00 and 300.00) towards (Random angle) degrees)
              • Destructible - Create a Destructables[(Random integer number between 1 and 3)] at tempLoc2 facing (Random angle) with scale (Random real number between 0.75 and 1.25) and variation 0
              • Custom script: call RemoveLocation(udg_tempLoc2)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 6) Equal to 3
            • Then - Actions
              • Set tempLoc2 = (tempLoc offset by (Random real number between 50.00 and 500.00) towards (Random angle) degrees)
              • Set tempint2 = (((Area - 1) x 4) + 1)
              • Environment - Change terrain type at tempLoc2 to Terrain_Types[(Random integer number between tempint2 and (tempint2 + 3))] using variation -1 in an area of size (Random integer number between 2 and 4) and shape Circle
              • Custom script: call RemoveLocation(udg_tempLoc2)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_tempLoc)
      • For each (Integer tempInt) from 1 to 15, do (Actions)
        • Loop - Actions
          • Set tempLoc = (Random point in (Playable map area))
          • Unit - Create 1 Resources[(Random integer number between 1 and TotalResources)] for Neutral Passive at tempLoc facing Default building facing degrees
          • Unit Group - Add (Last created unit) to Hidden_Resources
          • Unit - Hide (Last created unit)
          • Custom script: call RemoveLocation(udg_tempLoc)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Generated Greater than or equal to Density
        • Then - Actions
          • Set tempForce = (All players matching (((Matching player) slot status) Equal to Is playing))
          • Player Group - Pick every player in tempForce and do (Actions)
            • Loop - Actions
              • Set tempLoc = (Random point in Region 000 <gen>)
              • Camera - Pan camera for (Picked player) to tempLoc over 0.00 seconds
              • Unit - Create 1 Town Hall for (Picked player) at tempLoc facing Default building facing degrees
              • Unit - Create 1 Worker for (Picked player) at tempLoc facing Default building facing degrees
              • Unit - Create 1 Worker for (Picked player) at tempLoc facing Default building facing degrees
              • Unit - Create 1 Worker for (Picked player) at tempLoc facing Default building facing degrees
              • Set tempLoc2 = (tempLoc offset by (Random real number between 500.00 and 700.00) towards (Random angle) degrees)
              • Unit - Create 1 Gold Ore for Neutral Passive at tempLoc2 facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_tempLoc2)
              • Set tempLoc2 = (tempLoc offset by (Random real number between 500.00 and 700.00) towards (Random angle) degrees)
              • Unit - Create 1 Coal for Neutral Passive at tempLoc2 facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_tempLoc2)
              • Set tempLoc2 = (tempLoc offset by (Random real number between 500.00 and 700.00) towards (Random angle) degrees)
              • Unit - Create 1 Stone for Neutral Passive at tempLoc2 facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_tempLoc2)
              • Custom script: call RemoveLocation(udg_tempLoc)
          • Cinematic - Clear the screen of text messages for (All players)
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Status
Not open for further replies.
Top