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

Some Code makes my Game crash.

Status
Not open for further replies.
Level 2
Joined
Feb 17, 2010
Messages
6
this is my script that causes the crash. a screenshot of the crash is attached below. the intention of this script is to check if an ability was cast of the kind "Flee". in my map combats are fought on battlefields and when you flee from battle half of ur units should die and the rest can be seen from script. the error tells something about "could not read memory" o_O any ideas?

  • flee
    • Ereignisse
      • Einheit - A unit Beginnt, eine Fähigkeit zu wirken
    • Bedingungen
      • (Ability being cast) Gleich Flee!
    • Aktionen
      • For each (Integer A) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • Or - Any (Conditions) are true
                • Bedingungen
                  • (Owner of (Triggering unit)) Gleich (Player(battlefield_attacker[(Integer A)]))
                  • (Owner of (Triggering unit)) Gleich (Player(battlefield_victim[(Integer A)]))
            • 'THEN'-Aktionen
              • Spezialeffekt - Destroy player_heroes_effects[battlefield_attacker[(Integer A)]]
              • Spezialeffekt - Destroy player_heroes_effects[battlefield_victim[(Integer A)]]
              • Einheit - Change ownership of player_heroes[battlefield_attacker[(Integer A)]] to (Player(battlefield_attacker[(Integer A)])) and Farbe wechseln
              • Einheit - Change ownership of player_heroes[battlefield_victim[(Integer A)]] to (Player(battlefield_victim[(Integer A)])) and Farbe wechseln
              • Einheit - Make player_heroes[battlefield_attacker[(Integer A)]] Verwundbar
              • Einheit - Make player_heroes[battlefield_victim[(Integer A)]] Verwundbar
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • (Owner of (Triggering unit)) Gleich (Player(battlefield_attacker[(Integer A)]))
                • 'THEN'-Aktionen
                  • Set battlefield_winner[(Integer A)] = battlefield_victim[(Integer A)]
                  • Spiel - Display to (All players) the text: (((player_txtcolor[battlefield_attacker[(Integer A)]] + (Name of (Player(battlefield_attacker[(Integer A)])))) + |r ) + fled from combat)
                  • Einheitengruppe - Pick every unit in (Units in battlefield_regions[(Integer A)] owned by (Player(battlefield_winner[(Integer A)]))) and do (Actions)
                    • Schleifen - Aktionen
                      • Einheit - Move (Picked unit) instantly to (Center of player_regions[battlefield_winner[(Integer A)]])
                      • Einheit - Order (Picked unit) to Position halten
                  • Set x = (Number of units in (Units in battlefield_regions[(Integer A)] owned by (Owner of (Triggering unit))))
                  • Einheitengruppe - Pick every unit in (Random (x / 2) units from (Units in battlefield_regions[(Integer A)] owned by (Owner of (Triggering unit)))) and do (Einheit - Kill (Picked unit))
                  • Einheitengruppe - Pick every unit in (Units in battlefield_regions[(Integer A)] owned by (Owner of (Triggering unit))) and do (Actions)
                    • Schleifen - Aktionen
                      • Einheit - Move (Picked unit) instantly to (Center of player_regions[(Player number of (Owner of (Triggering unit)))])
                      • Einheit - Order (Picked unit) to Position halten
                  • Einheit - Move player_heroes[(Player number of (Owner of (Triggering unit)))] instantly to (Position of (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle)))
                • 'ELSE'-Aktionen
                  • Set battlefield_winner[(Integer A)] = battlefield_attacker[(Integer A)]
                  • Spiel - Display to (All players) the text: (((player_txtcolor[battlefield_victim[(Integer A)]] + (Name of (Player(battlefield_victim[(Integer A)])))) + |r ) + fled from combat)
                  • Einheitengruppe - Pick every unit in (Units in battlefield_regions[(Integer A)] owned by (Player(battlefield_winner[(Integer A)]))) and do (Actions)
                    • Schleifen - Aktionen
                      • Einheit - Move (Picked unit) instantly to (Center of player_regions[battlefield_winner[(Integer A)]])
                      • Einheit - Order (Picked unit) to Position halten
                  • Set x = (Number of units in (Units in battlefield_regions[(Integer A)] owned by (Owner of (Triggering unit))))
                  • Einheitengruppe - Pick every unit in (Random (x / 2) units from (Units in battlefield_regions[(Integer A)] owned by (Owner of (Triggering unit)))) and do (Einheit - Kill (Picked unit))
                  • Einheitengruppe - Pick every unit in (Units in battlefield_regions[(Integer A)] owned by (Owner of (Triggering unit))) and do (Actions)
                    • Schleifen - Aktionen
                      • Einheit - Move (Picked unit) instantly to (Center of player_regions[(Player number of (Owner of (Triggering unit)))])
                      • Einheit - Order (Picked unit) to Position halten
                  • Einheit - Move player_heroes[(Player number of (Owner of (Triggering unit)))] instantly to (Position of (Random unit from (Units owned by (Owner of (Triggering unit)) of type Castle)))
              • Kamera - Pan camera for (Player(battlefield_attacker[(Integer A)])) to (Position of player_heroes[(Player number of (Player(battlefield_attacker[(Integer A)])))]) over 0.00 seconds
              • Kamera - Pan camera for (Player(battlefield_victim[(Integer A)])) to (Position of player_heroes[(Player number of (Player(battlefield_victim[(Integer A)])))]) over 0.00 seconds
              • Set battlefield_use[(Integer A)] = False
              • Set battlefield_attacker[(Integer A)] = 0
              • Set battlefield_victim[(Integer A)] = 0
              • Set battlefield_winner[(Integer A)] = 0
            • 'ELSE'-Aktionen
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
disable this trigger and check if the error still happens
if it does delete a few actions and check again

usually you will get this kind of errors if you execute stuff for ever like:

trigger:
if a unit casts a spell order a unit to cast a spell

this will make the trigger execute forever until your pc can't take it anymore and dies

I don't think that it is caused by that trigger since there is no action issuing another cast but it might be something else like using a unit outside of the map or just another trigger

by the way:
this is an english forum so you have to write english
(you can download the english wc3 version from blizzard if you got a valid key)
 
Status
Not open for further replies.
Top