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

[Crash] Serious crash problem

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,141
Edit: It seems i have solved this one. Check the bottom post for leak.

Hello everyone. It has been a long time to asking help from hive but i feel hopeless. I have a risk map and after i change capture circle system, game is freezing after few minutes and still i haven't found the source. Here is my code.

  • MoveKillingUnit
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
      • Unit - A unit owned by Player 2 (Blue) Dies
      • Unit - A unit owned by Player 3 (Teal) Dies
      • Unit - A unit owned by Player 4 (Purple) Dies
      • Unit - A unit owned by Player 5 (Yellow) Dies
      • Unit - A unit owned by Player 6 (Orange) Dies
      • Unit - A unit owned by Player 7 (Green) Dies
      • Unit - A unit owned by Player 8 (Pink) Dies
      • Unit - A unit owned by Player 9 (Gray) Dies
      • Unit - A unit owned by Player 10 (Light Blue) Dies
      • Unit - A unit owned by Player 11 (Dark Green) Dies
      • Unit - A unit owned by Player 12 (Brown) Dies
    • Conditions
    • Actions
      • Trigger - Run ordu guc cikar <gen> (checking conditions)
      • Unit - Change ownership of (Triggering unit) to Neutral Victim and Retain color
      • -------- Determine which unit is going to capture the point circle --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Unit-type of (Killing unit)) is An Ancient) Equal to True
          • (Unit-type of (Killing unit)) Not equal to Sniper // BARRACKS UNIT
        • Then - Actions
          • -------- Killing unit is an infantry,NOT SNIPER --------
          • -------- It can capture --------
          • Set CemberCaptureNearestUnit = (Killing unit)
        • Else - Actions
          • -------- Killing unit is NOT an infantry --------
          • -------- Find an infantry closest to it --------
          • Unit Group - Pick every unit in (Units within 600.00 of (Position of (Killing unit))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                  • ((Picked unit) belongs to an ally of (Owner of (Killing unit))) Equal to True
                  • ((Unit-type of (Picked unit)) is An Ancient) Equal to True
                  • (Unit-type of (Picked unit)) Not equal to Sniper // BARRACKS UNIT
                  • ((Picked unit) is in CemberGroup) Equal to False
                • Then - Actions
                  • Set CemberCaptureNearestUnit = (Picked unit)
                • Else - Actions
      • -------- greenland --------
      • If (((North Greenland <gen> contains (Triggering unit)) Equal to True) and ((((Units in North Greenland <gen> owned by (Owner of Barracks 0154 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of North Greenland <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Central Greenland <gen> contains (Triggering unit)) Equal to True) and ((((Units in Central Greenland <gen> owned by (Owner of Barracks 0166 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Central Greenland <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((East Greenland <gen> contains (Triggering unit)) Equal to True) and ((((Units in East Greenland <gen> owned by (Owner of Barracks 0165 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of East Greenland <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((South Greenland <gen> contains (Triggering unit)) Equal to True) and ((((Units in South Greenland <gen> owned by (Owner of Barracks 0167 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of South Greenland <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((North East Greenland <gen> contains (Triggering unit)) Equal to True) and ((((Units in North East Greenland <gen> owned by (Owner of Barracks 0182 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of North East Greenland <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- iceland --------
      • If (((East Iceland <gen> contains (Triggering unit)) Equal to True) and ((((Units in East Iceland <gen> owned by (Owner of Barracks 0172 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of East Iceland <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Central Iceland <gen> contains (Triggering unit)) Equal to True) and ((((Units in Central Iceland <gen> owned by (Owner of Barracks 0171 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Central Iceland <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((North Iceland <gen> contains (Triggering unit)) Equal to True) and ((((Units in North Iceland <gen> owned by (Owner of Barracks 0169 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of North Iceland <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((South Iceland <gen> contains (Triggering unit)) Equal to True) and ((((Units in South Iceland <gen> owned by (Owner of Barracks 0170 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of South Iceland <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Southwest Iceland <gen> contains (Triggering unit)) Equal to True) and ((((Units in Southwest Iceland <gen> owned by (Owner of Barracks 0168 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Southwest Iceland <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((West Iceland <gen> contains (Triggering unit)) Equal to True) and ((((Units in West Iceland <gen> owned by (Owner of Barracks 0173 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of West Iceland <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- 3 --------
      • If (((Bergen <gen> contains (Triggering unit)) Equal to True) and ((((Units in Bergen <gen> owned by (Owner of Barracks 0101 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Bergen <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Oslo <gen> contains (Triggering unit)) Equal to True) and ((((Units in Oslo <gen> owned by (Owner of Barracks 0099 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Oslo <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Trondheim <gen> contains (Triggering unit)) Equal to True) and ((((Units in Trondheim <gen> owned by (Owner of Barracks 0098 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Trondheim <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Lulea <gen> contains (Triggering unit)) Equal to True) and ((((Units in Lulea <gen> owned by (Owner of Barracks 0096 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Lulea <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Oulu <gen> contains (Triggering unit)) Equal to True) and ((((Units in Oulu <gen> owned by (Owner of Barracks 0097 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Oulu <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Helsinki <gen> contains (Triggering unit)) Equal to True) and ((((Units in Helsinki <gen> owned by (Owner of Barracks 0095 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Helsinki <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- russia --------
      • If (((Archangelsk <gen> contains (Triggering unit)) Equal to True) and ((((Units in Archangelsk <gen> owned by (Owner of Barracks 0094 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Archangelsk <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Moskou <gen> contains (Triggering unit)) Equal to True) and ((((Units in Moskou <gen> owned by (Owner of Barracks 0090 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Moskou <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Kotlas <gen> contains (Triggering unit)) Equal to True) and ((((Units in Kotlas <gen> owned by (Owner of Barracks 0093 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Kotlas <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((St Petersburg <gen> contains (Triggering unit)) Equal to True) and ((((Units in St Petersburg <gen> owned by (Owner of Barracks 0092 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of St Petersburg <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Riga <gen> contains (Triggering unit)) Equal to True) and ((((Units in Riga <gen> owned by (Owner of Barracks 0091 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Riga <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Toela <gen> contains (Triggering unit)) Equal to True) and ((((Units in Toela <gen> owned by (Owner of Barracks 0089 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Toela <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Minsk <gen> contains (Triggering unit)) Equal to True) and ((((Units in Minsk <gen> owned by (Owner of Barracks 0088 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Minsk <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Charkiw <gen> contains (Triggering unit)) Equal to True) and ((((Units in Charkiw <gen> owned by (Owner of Barracks 0086 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Charkiw <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Wolgagrad <gen> contains (Triggering unit)) Equal to True) and ((((Units in Wolgagrad <gen> owned by (Owner of Barracks 0085 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Wolgagrad <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- turkey --------
      • If (((Athene <gen> contains (Triggering unit)) Equal to True) and ((((Units in Athene <gen> owned by (Owner of Barracks 0081 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Athene <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Istanbul <gen> contains (Triggering unit)) Equal to True) and ((((Units in Istanbul <gen> owned by (Owner of Barracks 0082 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Istanbul <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Tbilisi <gen> contains (Triggering unit)) Equal to True) and ((((Units in Tbilisi <gen> owned by (Owner of Barracks 0084 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Tbilisi <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Aleppo <gen> contains (Triggering unit)) Equal to True) and ((((Units in Aleppo <gen> owned by (Owner of Barracks 0083 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Aleppo <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- england --------
      • If (((Dublin <gen> contains (Triggering unit)) Equal to True) and ((((Units in Dublin <gen> owned by (Owner of Barracks 0052 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Dublin <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Glasgow <gen> contains (Triggering unit)) Equal to True) and ((((Units in Glasgow <gen> owned by (Owner of Barracks 0053 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Glasgow <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Leeds <gen> contains (Triggering unit)) Equal to True) and ((((Units in Leeds <gen> owned by (Owner of Barracks 0054 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Leeds <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Southampton <gen> contains (Triggering unit)) Equal to True) and ((((Units in Southampton <gen> owned by (Owner of Barracks 0055 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Southampton <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((London <gen> contains (Triggering unit)) Equal to True) and ((((Units in London <gen> owned by (Owner of Barracks 0056 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of London <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- france --------
      • If (((Brussel <gen> contains (Triggering unit)) Equal to True) and ((((Units in Brussel <gen> owned by (Owner of Barracks 0057 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Brussel <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Brest <gen> contains (Triggering unit)) Equal to True) and ((((Units in Brest <gen> owned by (Owner of Barracks 0058 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Brest <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Bordeaux <gen> contains (Triggering unit)) Equal to True) and ((((Units in Bordeaux <gen> owned by (Owner of Barracks 0059 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Bordeaux <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Dijon <gen> contains (Triggering unit)) Equal to True) and ((((Units in Dijon <gen> owned by (Owner of Barracks 0060 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Dijon <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Marseille <gen> contains (Triggering unit)) Equal to True) and ((((Units in Marseille <gen> owned by (Owner of Barracks 0061 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Marseille <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- spain --------
      • If (((Zaragoza <gen> contains (Triggering unit)) Equal to True) and ((((Units in Zaragoza <gen> owned by (Owner of Barracks 0062 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Zaragoza <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Malaga <gen> contains (Triggering unit)) Equal to True) and ((((Units in Malaga <gen> owned by (Owner of Barracks 0063 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Malaga <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((La Coruna <gen> contains (Triggering unit)) Equal to True) and ((((Units in La Coruna <gen> owned by (Owner of Barracks 0065 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of La Coruna <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Lissabon <gen> contains (Triggering unit)) Equal to True) and ((((Units in Lissabon <gen> owned by (Owner of Barracks 0064 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Lissabon <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- portugal --------
      • If (((North Portugal <gen> contains (Triggering unit)) Equal to True) and ((((Units in North Portugal <gen> owned by (Owner of Barracks 0264 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of North Portugal <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((East Portugal <gen> contains (Triggering unit)) Equal to True) and ((((Units in East Portugal <gen> owned by (Owner of Barracks 0263 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of East Portugal <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((South Portugal <gen> contains (Triggering unit)) Equal to True) and ((((Units in South Portugal <gen> owned by (Owner of Barracks 0262 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of South Portugal <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((West Portugal <gen> contains (Triggering unit)) Equal to True) and ((((Units in West Portugal <gen> owned by (Owner of Barracks 0261 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of West Portugal <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- europe --------
      • If (((Amsterdam <gen> contains (Triggering unit)) Equal to True) and ((((Units in Amsterdam <gen> owned by (Owner of Barracks 0076 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Amsterdam <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Kopenhagen <gen> contains (Triggering unit)) Equal to True) and ((((Units in Kopenhagen <gen> owned by (Owner of Barracks 0102 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Kopenhagen <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Bern <gen> contains (Triggering unit)) Equal to True) and ((((Units in Bern <gen> owned by (Owner of Barracks 0074 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Bern <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Frankfurt <gen> contains (Triggering unit)) Equal to True) and ((((Units in Frankfurt <gen> owned by (Owner of Barracks 0075 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Frankfurt <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Boedapest <gen> contains (Triggering unit)) Equal to True) and ((((Units in Boedapest <gen> owned by (Owner of Barracks 0078 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Boedapest <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Warschau <gen> contains (Triggering unit)) Equal to True) and ((((Units in Warschau <gen> owned by (Owner of Barracks 0087 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Warschau <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Sarajevo <gen> contains (Triggering unit)) Equal to True) and ((((Units in Sarajevo <gen> owned by (Owner of Barracks 0079 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Sarajevo <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Triest <gen> contains (Triggering unit)) Equal to True) and ((((Units in Triest <gen> owned by (Owner of Barracks 0073 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Triest <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Boekarest <gen> contains (Triggering unit)) Equal to True) and ((((Units in Boekarest <gen> owned by (Owner of Barracks 0080 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Boekarest <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- italy --------
      • If (((Milaan <gen> contains (Triggering unit)) Equal to True) and ((((Units in Milaan <gen> owned by (Owner of Barracks 0072 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Milaan <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Rome <gen> contains (Triggering unit)) Equal to True) and ((((Units in Rome <gen> owned by (Owner of Barracks 0071 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Rome <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Napels <gen> contains (Triggering unit)) Equal to True) and ((((Units in Napels <gen> owned by (Owner of Barracks 0070 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Napels <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((East New Italy <gen> contains (Triggering unit)) Equal to True) and ((((Units in East New Italy <gen> owned by (Owner of Barracks 0257 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of East New Italy <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Palermo <gen> contains (Triggering unit)) Equal to True) and ((((Units in Palermo <gen> owned by (Owner of Barracks 0069 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Palermo <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((West New Italy <gen> contains (Triggering unit)) Equal to True) and ((((Units in West New Italy <gen> owned by (Owner of Barracks 0260 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of West New Italy <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((South New Italy <gen> contains (Triggering unit)) Equal to True) and ((((Units in South New Italy <gen> owned by (Owner of Barracks 0258 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of South New Italy <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Tetounan <gen> contains (Triggering unit)) Equal to True) and ((((Units in Tetounan <gen> owned by (Owner of Barracks 0259 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Tetounan <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- east africa --------
      • If (((Port Said <gen> contains (Triggering unit)) Equal to True) and ((((Units in Port Said <gen> owned by (Owner of Barracks 0174 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Port Said <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Baltim <gen> contains (Triggering unit)) Equal to True) and ((((Units in Baltim <gen> owned by (Owner of Barracks 0251 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Baltim <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Janaklis <gen> contains (Triggering unit)) Equal to True) and ((((Units in Janaklis <gen> owned by (Owner of Barracks 0292 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Janaklis <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Alexandria <gen> contains (Triggering unit)) Equal to True) and ((((Units in Alexandria <gen> owned by (Owner of Barracks 0175 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Alexandria <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Nasr <gen> contains (Triggering unit)) Equal to True) and ((((Units in Nasr <gen> owned by (Owner of Barracks 0295 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Alexandria <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((As Saidah <gen> contains (Triggering unit)) Equal to True) and ((((Units in As Saidah <gen> owned by (Owner of Barracks 0249 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of As Saidah <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Abu Talatt <gen> contains (Triggering unit)) Equal to True) and ((((Units in Abu Talatt <gen> owned by (Owner of Barracks 0250 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Abu Talatt <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- north africa --------
      • If (((Khoms <gen> contains (Triggering unit)) Equal to True) and ((((Units in Khoms <gen> owned by (Owner of Barracks 0253 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Khoms <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Zliten <gen> contains (Triggering unit)) Equal to True) and ((((Units in Zliten <gen> owned by (Owner of Barracks 0252 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Zliten <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Bani Waled <gen> contains (Triggering unit)) Equal to True) and ((((Units in Bani Waled <gen> owned by (Owner of Barracks 0254 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Bani Waled <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Msallata <gen> contains (Triggering unit)) Equal to True) and ((((Units in Msallata <gen> owned by (Owner of Barracks 0255 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Msallata <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Tininai <gen> contains (Triggering unit)) Equal to True) and ((((Units in Tininai <gen> owned by (Owner of Barracks 0298 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Tininai <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Tripoli <gen> contains (Triggering unit)) Equal to True) and ((((Units in Tripoli <gen> owned by (Owner of Barracks 0256 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Tripoli <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Nasmah <gen> contains (Triggering unit)) Equal to True) and ((((Units in Nasmah <gen> owned by (Owner of Barracks 0310 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Nasmah <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Mizdah <gen> contains (Triggering unit)) Equal to True) and ((((Units in Mizdah <gen> owned by (Owner of Barracks 0307 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Mizdah <gen>), facing Default building facing degrees) else do (Do nothing)
      • -------- west africa --------
      • If (((Nador <gen> contains (Triggering unit)) Equal to True) and ((((Units in Nador <gen> owned by (Owner of Barracks 0068 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Nador <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Taza <gen> contains (Triggering unit)) Equal to True) and ((((Units in Taza <gen> owned by (Owner of Barracks 0067 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Taza <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Bani Walid <gen> contains (Triggering unit)) Equal to True) and ((((Units in Bani Walid <gen> owned by (Owner of Barracks 0189 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Bani Walid <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Tangier <gen> contains (Triggering unit)) Equal to True) and ((((Units in Tangier <gen> owned by (Owner of Barracks 0066 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Tangier <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Larache <gen> contains (Triggering unit)) Equal to True) and ((((Units in Larache <gen> owned by (Owner of Barracks 0186 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Larache <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Dlalha <gen> contains (Triggering unit)) Equal to True) and ((((Units in Dlalha <gen> owned by (Owner of Barracks 0301 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Dlalha <gen>), facing Default building facing degrees) else do (Do nothing)
      • If (((Lemnassera <gen> contains (Triggering unit)) Equal to True) and ((((Units in Lemnassera <gen> owned by (Owner of Barracks 0304 <gen>)) is empty) Equal to True) and ((Unit-type of (Killing unit)) Not equal to Tower))) then do (Unit - Move CemberCaptureNearestUnit instantly to (Center of Lemnassera <gen>), facing Default building facing degrees) else do (Do nothing)

This trigger adds present units into the CemberGroup. Because game tries to pick and move unit into the circle but other trigger prevents it and it was causing crash.

  • U Group ekle
    • Events
      • Time - Elapsed game time is 0.35 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is An Ancient) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to CemberGroup

And this trigger prevents units moving out the circle

  • Leave All
    • Events
    • Conditions
    • Actions
      • For each (Integer B) from 1 to TOTAL_BARRACKS_COUNT, do (Actions)
        • Loop - Actions
          • Custom script: if IsPointInRegion(GetTriggeringRegion(), GetRectCenterX(udg_COPName[bj_forLoopBIndex]), GetRectCenterY(udg_COPName[bj_forLoopBIndex])) then
          • Set TempRegion = COPName[(Integer B)]
          • Custom script: endif
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in TempRegion matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True)))) Less than or equal to 0
          • ((Unit-type of (Leaving unit)) is An Ancient) Equal to True
          • ((Unit-type of (Leaving unit)) is A Hero) Equal to False
        • Then - Actions
          • Unit - Move (Triggering unit) instantly to (Center of TempRegion)
  • Change owner
    • Events
      • Time - Every 0.33 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to TOTAL_BARRACKS_COUNT, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Units in COPName[(Integer A)] matching (((Owner of (Matching unit)) Equal to (Owner of Barracks[(Integer A)])) and ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Not equal to Command Point) and ((Unit-type of (Matching unit)) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units in COPName[(Integer A)] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is An Ancient) Equal to True)))) Greater than 0
                • Then - Actions
                  • Unit Group - Pick every unit in (Random 1 units from (Units in COPName[(Integer A)] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is An Ancient) Equal to True)))) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Player number of (Picked player)) Less than 13
                        • Then - Actions
                          • Unit - Change ownership of Towers[(Integer A)] to (Owner of (Picked unit)) and Change color
                          • Unit - Change ownership of Barracks[(Integer A)] to (Owner of (Picked unit)) and Change color
                        • Else - Actions
                • Else - Actions
            • Else - Actions
        • Else - Actions
I have no idea why game is freezing. Maybe there was leak and i haven't realized it yet.

I will be grateful if you can find what causes this one :(
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Trigger - Run ordu guc cikar <gen> (checking conditions)
This trigger?
Leave All
The events?

You may need to supply the map. However I am guessing there is some trigger conflict going on where one trigger is causing the other to run in an infinite loop. Another cause could be due to Integer A/B interference from other triggers which are run by actions of the trigger when inside such a loop block.
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
Good morning. Let me inform you about the current situation.
I wanted to test something for the make sure.

First, i have started game on singleplayer and capture 16 circle. Then i have trained Cobra (helicoper, it cannot capture circles but when it killed unit within circle, if there is any ancient type unit within 500 aoe of cobra, teleport the unit into the circle) and after i killed 1 unit with cobra, crazy lag and freezing start

When i turned off this trigger (MoveKillingUnit) and everything is fine (i did the same things)

Now can we say MoveKillingUnit source of the crash?

And here is the extra details.

This trigger?

The events?

You may need to supply the map. However I am guessing there is some trigger conflict going on where one trigger is causing the other to run in an infinite loop. Another cause could be due to Integer A/B interference from other triggers which are run by actions of the trigger when inside such a loop block.

Ordu guc cikar simply decreases players army power into the board.
  • ordu guc cikar
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Infantry // BARRACKS UNIT
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Dying unit)))] = (OrduGucu[(Player number of (Owner of (Dying unit)))] - 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Commando
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 3)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Commando Veteran
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 5)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to TX-44 // BARRACKS UNIT
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 10)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Rocketer // BARRACKS UNIT
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 6)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Sniper // BARRACKS UNIT
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 30)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Scorpion // BARRACKS UNIT
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 30)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Cobra // BARRACKS UNIT
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 30)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Siege Tank // BARRACKS UNIT
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 40)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Tiger Tank // BARRACKS UNIT
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 80)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to TX-90
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 70)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Transport Ship I
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 3)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Transport Ship II
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 8)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Frigate
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 8)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Battleship
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 50)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Warship
        • Then - Actions
          • Set OrduGucu[(Player number of (Owner of (Triggering unit)))] = (OrduGucu[(Player number of (Owner of (Triggering unit)))] - 100)
        • Else - Actions
And it is the leave all
  • Leave All
    • Events
    • Conditions
    • Actions
      • For each (Integer B) from 1 to TOTAL_BARRACKS_COUNT, do (Actions)
        • Loop - Actions
          • Custom script: if IsPointInRegion(GetTriggeringRegion(), GetRectCenterX(udg_COPName[bj_forLoopBIndex]), GetRectCenterY(udg_COPName[bj_forLoopBIndex])) then
          • Set TempRegion = COPName[(Integer B)]
          • Custom script: endif
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in TempRegion matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True)))) Less than or equal to 0
          • ((Unit-type of (Leaving unit)) is An Ancient) Equal to True
          • ((Unit-type of (Leaving unit)) is A Hero) Equal to False
        • Then - Actions
          • Unit - Move (Triggering unit) instantly to (Center of TempRegion)
        • Else - Actions
 
Level 8
Joined
May 21, 2019
Messages
435
Are you using a LUA based garbage collector?
If not, you are leaking a crazy amount of memory in these triggers from unit groups and to a lesser extent points. You leak about 80+ unit groups every time a unit dies, and you're leaking even more unit groups several times per second from the periodic events. At this rate, you are going to be bloating the memory really really fast.
Again, only applies if you aren't using a LUA garbage collector.


Also, naming your variables and trigger names in English makes it a lot easier to read your code, so I would recommend that.
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
Are you using a LUA based garbage collector?
If not, you are leaking a crazy amount of memory in these triggers from unit groups and to a lesser extent points. You leak about 80+ unit groups every time a unit dies, and you're leaking even more unit groups several times per second from the periodic events. At this rate, you are going to be bloating the memory really really fast.
Again, only applies if you aren't using a LUA garbage collector.


Also, naming your variables and trigger names in English makes it a lot easier to read your code, so I would recommend that.

You are right. Actually most of my maps codes in english. By the way what is LUA garbage collector???
 
Level 8
Joined
May 21, 2019
Messages
435
You are right. Actually most of my maps codes in english. By the way what is LUA garbage collector???
Yeah, most, why not all? :D
LUA is a programming language introduced to the World Editor in 1.31
Garbage collection is automatised memory leak cleaning, a concept featured in most modern programming languages.
I am not entirely aware of how setting up one of those in 1.31 works, but @Dr Super Good recently posted a guide on how to enable one that apparently takes care of everything for you.

Seeing how you are most likely not cleaning these leaks now, I'd say that memory leaks is a very plausible reason for your crashes, especially if the game starts to gradually slow down towards the freeze (units reacting slower, especially computer controlled ones, is a very clear telltale sign of a memory leak). Trigger conflicts or infinite loops tends to crash the entire game, causing it to close down. I haven't seen it freezing the game, but I suppose it's possible that it could also fail to close the game in certain cases.
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
Yeah, most, why not all? :D
LUA is a programming language introduced to the World Editor in 1.31
Garbage collection is automatised memory leak cleaning, a concept featured in most modern programming languages.
I am not entirely aware of how setting up one of those in 1.31 works, but @Dr Super Good recently posted a guide on how to enable one that apparently takes care of everything for you.

Seeing how you are most likely not cleaning these leaks now, I'd say that memory leaks is a very plausible reason for your crashes, especially if the game starts to gradually slow down towards the freeze (units reacting slower, especially computer controlled ones, is a very clear telltale sign of a memory leak). Trigger conflicts or infinite loops tends to crash the entire game, causing it to close down. I haven't seen it freezing the game, but I suppose it's possible that it could also fail to close the game in certain cases.

Ok then i need to ask you something. If you need to create trigger like this, how you do that?
Scenario: Map have 2 types of units. Infantry and non-infantry.
When you kill the unit in the region, one of your infantries will teleport into the region. By the way it is not my trigger. My friend created this trigger by my request. If you can give me the example, i will duplicate it 80 times. Damn. I actually not liked my new system but my players requesting it.
 
Level 8
Joined
May 21, 2019
Messages
435
Ok then i need to ask you something. If you need to create trigger like this, how you do that?
Scenario: Map have 2 types of units. Infantry and non-infantry.
When you kill the unit in the region, one of your infantries will teleport into the region. By the way it is not my trigger. My friend created this trigger by my request. If you can give me the example, i will duplicate it 80 times. Damn. I actually not liked my new system but my players requesting it.
You need to refactor a lot more. The current way that you are doing things is crazy tasking. There's a bunch of things wrong with the current triggers, and I honestly am not sure where to start.

Let me start by asking:
It kind of seems like what you want, is for the base to be captured if the attacking unit is an infantry, and otherwise, you want to pick a nearby unit to capture it instead. Is that correct?
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
You need to refactor a lot more. The current way that you are doing things is crazy tasking. There's a bunch of things wrong with the current triggers, and I honestly am not sure where to start.

Let me start by asking:
It kind of seems like what you want, is for the base to be captured if the attacking unit is an infantry, and otherwise, you want to pick a nearby unit to capture it instead. Is that correct?

Let me tell you and let me show you what i did. I am not tested it yet. What about this trigger?

  • MoveKillingUnit Copy
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
      • Unit - A unit owned by Player 2 (Blue) Dies
      • Unit - A unit owned by Player 3 (Teal) Dies
      • Unit - A unit owned by Player 4 (Purple) Dies
      • Unit - A unit owned by Player 5 (Yellow) Dies
      • Unit - A unit owned by Player 6 (Orange) Dies
      • Unit - A unit owned by Player 7 (Green) Dies
      • Unit - A unit owned by Player 8 (Pink) Dies
      • Unit - A unit owned by Player 9 (Gray) Dies
      • Unit - A unit owned by Player 10 (Light Blue) Dies
      • Unit - A unit owned by Player 11 (Dark Green) Dies
      • Unit - A unit owned by Player 12 (Brown) Dies
    • Conditions
    • Actions
      • Unit - Change ownership of (Triggering unit) to Neutral Victim and Retain color
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Unit-type of (Killing unit)) is An Ancient) Equal to True
          • (Unit-type of (Killing unit)) Not equal to Sniper // BARRACKS UNIT
          • (North Greenland <gen> contains (Dying unit)) Equal to True
          • (Number of units in (Units owned by (Owner of (Dying unit)))) Equal to 0
        • Then - Actions
          • Unit - Move (Killing unit) instantly to (Center of North Greenland <gen>)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Unit-type of (Killing unit)) is An Ancient) Equal to False
          • (North Greenland <gen> contains (Dying unit)) Equal to True
          • (Number of units in (Units owned by (Owner of (Dying unit)))) Equal to 0
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 600.00 of (Position of (Killing unit))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                  • ((Picked unit) belongs to an ally of (Owner of (Killing unit))) Equal to True
                  • ((Unit-type of (Picked unit)) is An Ancient) Equal to True
                  • (Unit-type of (Picked unit)) Not equal to Sniper // BARRACKS UNIT
                  • ((Picked unit) is in CemberGroup) Equal to False
                • Then - Actions
                  • Unit - Move (Killing unit) instantly to (Center of North Greenland <gen>)
                • Else - Actions
        • Else - Actions
If it works well, i will made it 80+ times. And check the picture too.

You get it actually what i want.
When your infantry based unit kills the enemy unit into the region, it will teleports in here and you are capturing it.
But i don't want to teleport helicopter or tanks teleported into the region. At this point, i want to pick any infantry unit within x region of the killer.

CapturedGroup prevents the units gets teleported in another point. I was faced this issue and solved it. Because if your sniper kills the last unit into the circle (from 1300 range and if the trigger picks the unit already captured circle crashes)

I can explain much if you need to details. By the way is this trigger good?

First if then else checks these
 

Attachments

  • aa.jpg
    aa.jpg
    48.6 KB · Views: 36
Last edited:
Level 8
Joined
May 21, 2019
Messages
435
Let me tell you and let me show you what i did. I am not tested it yet. What about this trigger?

  • MoveKillingUnit Copy
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
      • Unit - A unit owned by Player 2 (Blue) Dies
      • Unit - A unit owned by Player 3 (Teal) Dies
      • Unit - A unit owned by Player 4 (Purple) Dies
      • Unit - A unit owned by Player 5 (Yellow) Dies
      • Unit - A unit owned by Player 6 (Orange) Dies
      • Unit - A unit owned by Player 7 (Green) Dies
      • Unit - A unit owned by Player 8 (Pink) Dies
      • Unit - A unit owned by Player 9 (Gray) Dies
      • Unit - A unit owned by Player 10 (Light Blue) Dies
      • Unit - A unit owned by Player 11 (Dark Green) Dies
      • Unit - A unit owned by Player 12 (Brown) Dies
    • Conditions
    • Actions
      • Unit - Change ownership of (Triggering unit) to Neutral Victim and Retain color
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Unit-type of (Killing unit)) is An Ancient) Equal to True
          • (Unit-type of (Killing unit)) Not equal to Sniper // BARRACKS UNIT
          • (North Greenland <gen> contains (Dying unit)) Equal to True
          • (Number of units in (Units owned by (Owner of (Dying unit)))) Equal to 0
        • Then - Actions
          • Unit - Move (Killing unit) instantly to (Center of North Greenland <gen>)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Unit-type of (Killing unit)) is An Ancient) Equal to False
          • (North Greenland <gen> contains (Dying unit)) Equal to True
          • (Number of units in (Units owned by (Owner of (Dying unit)))) Equal to 0
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 600.00 of (Position of (Killing unit))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                  • ((Picked unit) belongs to an ally of (Owner of (Killing unit))) Equal to True
                  • ((Unit-type of (Picked unit)) is An Ancient) Equal to True
                  • (Unit-type of (Picked unit)) Not equal to Sniper // BARRACKS UNIT
                  • ((Picked unit) is in CemberGroup) Equal to False
                • Then - Actions
                  • Unit - Move (Killing unit) instantly to (Center of North Greenland <gen>)
                • Else - Actions
        • Else - Actions
If it works well, i will made it 80+ times. And check the picture too.

You get it actually what i want.
When your infantry based unit kills the enemy unit into the region, it will teleports in here and you are capturing it.
But i don't want to teleport helicopter or tanks teleported into the region. At this point, i want to pick any infantry unit within x region of the killer.

CapturedGroup prevents the units gets teleported in another point. I was faced this issue and solved it. Because if your sniper kills the last unit into the circle (from 1300 range and if the trigger picks the unit already captured circle crashes)

I can explain much if you need to details. By the way is this trigger good?

First if then else checks these

Remaking this trigger 80 times would be absolutely crazy and very hard to maintain/change.
There's also a few issues with it. For example: (Number of units in (Units owned by (Owner of (Dying unit)))) Equal to 0
This means that it will only run if the owner of the unit is completely wiped out. If what I know about Risk is accurate, you can have multiple bases, so this means that the trigger would only work if that is the very last unit.

Again, I think we need to take a step back here, and make you a trigger that works in all 80 scenarios rather than tasking you with a ridiculous grind like that.

Also, what exactly happens if no infantry is around to capture the point?

First off, I think you need to stop working with regions completely and start working with units and data variables.

Lets say that an infantry kills the unit holding a base. My guess is that the unit is locked in place at the captured point, like, standing in the middle of the circle of power, right?

Well, then you'd want to dynamically track ownership.

Let me ask you, are there any 2 bases placed so closely together, that the buildings associated with a capture point are actually almost as close to a different capture point? Or are they spaced so far that all of the capture points are never as close to buildings belonging to a different capture point as they are to their own?
If they are spaced, then you could just find the nearby buildings by distance.
 
Level 8
Joined
May 21, 2019
Messages
435
@Cespie I have pasted trigger again. If you we're checking, refresh the page.
Alright... anyway... here's the basic gist of what I would do:

When an infantry holding a point dies.
  1. Find the associated buildings with that point
  2. Find an eligible infantry belonging to the killing player to capture the point
If step 2 fails:
  • Add the circle of power representing the point to a unit group that is periodically checked for nearby infantries, selecting the first match found. Until a unit is found, the point and all buildings associated with it are Neutral.
If step 2 succeeds or the above search finds an eligible unit:
  • Teleport the infantry to the point, lock its movement, and change the ownership of all related buildings to the owner of the infantry. Then mark the infantry holding the point with either a custom value or adding it to a group of units holding points.
This group or custom value doesn't need to be associated with particular point or base, those are gathered whenever any of these units die in step 1, as we know that they will always be standing on top of the related capture point.

Step 1 can be done in a lot of ways.
If the bases and points are spaced far enough, this can be done with distance. No effort needed.
If the bases and points are so close together, that a structure belonging to 1 point, is actually closer to another point, then you'd have to manually catalogue them, preferably using a hashtable.
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
@Cespie I have just arrived home. (Number of units in (Units owned by (Owner of (Dying unit)))) Equal to 0 My bad i was forgot add "region" in the region number of units equal to 0 And i will read rest of your message i need a time.

I have read but i am totally confused. My english is not sufficient for everything and i really don't get it.

Is my code will works? If yes, i can duplicate it 80 times. I don't care how long it takes. I just want to make this system without leak.

@Cespie I have realized something. When i train Cobra and kill the units within circle, nothing happens. But when i capture 1 circle, after i try to kill units within circles, leak starts.
Another words, leak not starts until i capture 1 circle.
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,141
Ok since yesterday i was experiment on ALL triggers. Solved few leaks and then i have found the source of the freezing (the trigger i have posted on the top MoveKillingUnit Copy) Surprisingly i have solved leak only with this trigger
  • Set CemberCaptureNearestUnit = No unit
But still there was leaking. I was disabled many triggers in groups of 10 and checked memory usage in task manager. After 15+ tries i find the source. When this triggers is active i am starting the map. After loading screen i even don't touching anything. Just looking memory usage and it slowly increases.

And here is the trigger leaking every seconds. I have tried few methods but i have failed.

  • Change owner
    • Events
      • Time - Every 0.33 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to TOTAL_BARRACKS_COUNT, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Units in COPName[(Integer A)] matching (((Owner of (Matching unit)) Equal to (Owner of Barracks[(Integer A)])) and ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Not equal to Command Point) and ((Unit-type of (Matching unit)) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units in COPName[(Integer A)] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is An Ancient) Equal to True)))) Greater than 0
                • Then - Actions
                  • Unit Group - Pick every unit in (Random 1 units from (Units in COPName[(Integer A)] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is An Ancient) Equal to True)))) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Player number of (Picked player)) Less than 13
                        • Then - Actions
                          • Unit - Change ownership of Towers[(Integer A)] to (Owner of (Picked unit)) and Change color
                          • Unit - Change ownership of Barracks[(Integer A)] to (Owner of (Picked unit)) and Change color
                        • Else - Actions
                • Else - Actions
            • Else - Actions
This trigger checks the unit standing on the circle (region) and changes owner of the tower and barracks linked with it. Command point is Circle of Power.

If i can solve this one too, finally i can continue update my map.

By the way i am open to all alternatives and solutions.

I can provide any informations you need.
 
Level 8
Joined
May 21, 2019
Messages
435
Ok since yesterday i was experiment on ALL triggers. Solved few leaks and then i have found the source of the freezing (the trigger i have posted on the top MoveKillingUnit Copy) Surprisingly i have solved leak only with this trigger
  • Set CemberCaptureNearestUnit = No unit
But still there was leaking. I was disabled many triggers in groups of 10 and checked memory usage in task manager. After 15+ tries i find the source. When this triggers is active i am starting the map. After loading screen i even don't touching anything. Just looking memory usage and it slowly increases.

And here is the trigger leaking every seconds. I have tried few methods but i have failed.

  • Change owner
    • Events
      • Time - Every 0.33 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to TOTAL_BARRACKS_COUNT, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Units in COPName[(Integer A)] matching (((Owner of (Matching unit)) Equal to (Owner of Barracks[(Integer A)])) and ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Not equal to Command Point) and ((Unit-type of (Matching unit)) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units in COPName[(Integer A)] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is An Ancient) Equal to True)))) Greater than 0
                • Then - Actions
                  • Unit Group - Pick every unit in (Random 1 units from (Units in COPName[(Integer A)] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is An Ancient) Equal to True)))) and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Player number of (Picked player)) Less than 13
                        • Then - Actions
                          • Unit - Change ownership of Towers[(Integer A)] to (Owner of (Picked unit)) and Change color
                          • Unit - Change ownership of Barracks[(Integer A)] to (Owner of (Picked unit)) and Change color
                        • Else - Actions
                • Else - Actions
            • Else - Actions
This trigger checks the unit standing on the circle (region) and changes owner of the tower and barracks linked with it. Command point is Circle of Power.

If i can solve this one too, finally i can continue update my map.

By the way i am open to all alternatives and solutions.

I can provide any informations you need.

You are still leaking a lot of unit groups here.

Could you sent me your map? I will have a look at it when I have the time.
 
Level 8
Joined
May 21, 2019
Messages
435
Sure i will. Thank you again for your interest.
Here you go.
This makes the move unit thing work for every single current and future base in the game, as long as the tower and barrack are always closest to the point they belong to. It also shouldn't cause any leaks (although there's still a ton of those in your map), it has a temporary fix for when a base is captured without a usable infantry nearby, it always selects the infantry closest to the captured point, it immobilizes the capturing infantry, and also works even if you upgrade the infantry holding the point.

The whole thing is done in 1 trigger, without using any constant variables. From your old system, I modified and reused the trigger "U Group ekle", but all of the other triggers are disabled, and can be deleted.

EDIT: I just uploaded a new version. I found a bug where if you killed one of your own infantry holding a point, a new one wasn't selected. This fixes that bug.

EDIT: Map file removed as per request of OP.
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,141
Here you go.
This makes the move unit thing work for every single current and future base in the game, as long as the tower and barrack are always closest to the point they belong to. It also shouldn't cause any leaks (although there's still a ton of those in your map), it has a temporary fix for when a base is captured without a usable infantry nearby, it always selects the infantry closest to the captured point, it immobilizes the capturing infantry, and also works even if you upgrade the infantry holding the point.

The whole thing is done in 1 trigger, without using any constant variables. From your old system, I modified and reused the trigger "U Group ekle", but all of the other triggers are disabled, and can be deleted.

EDIT: I just uploaded a new version. I found a bug where if you killed one of your own infantry holding a point, a new one wasn't selected. This fixes that bug.

You are amazing. Even if works or not, you deserve respect. I will give you credits for that, and i gave karma. I am so sleepy and need to get up early tomorrow, so after i finish my meeting, i will check this at the office. Thank you s o much again.
 
Status
Not open for further replies.
Top