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

[Trigger] access violation error in certain script

Status
Not open for further replies.
Level 4
Joined
Jun 10, 2007
Messages
46
I have a bunch of triggers in my map that, when it reached them, cause errors over a duration. Could someone look at them and help me figure out what is going on/something I shouldn't have done with it?

I use GUI.

  • Demon Well
    • Events
      • Unit - A unit enters Demon Well <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DeathPortal[1] Equal to True
          • DeathPortal[2] Equal to True
          • DeathPortal[3] Equal to True
          • DeathPortal[4] Equal to True
          • DeathPortal[5] Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DeathPortal[6] Equal to False
            • Then - Actions
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffcc00ff Ob...
              • Wait until (((Death Warp <gen> contains (Triggering unit)) Equal to True) and ((Hero level of (Triggering unit)) Greater than or equal to 150)), checking every 1.00 seconds
              • Trigger - Run Environment Changes <gen> (ignoring conditions)
              • Wait until (DeathPortal[6] Equal to True), checking every 1.00 seconds
              • Trigger - Run Environment Changes 2 <gen> (ignoring conditions)
            • Else - Actions
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffcc00ff Ob...
        • Else - Actions
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffcc00ff Ob...
  • Demon Outpouring
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Set Loc = (Center of Death Exit <gen>)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in Death Region <gen> owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to False
            • Then - Actions
              • Unit - Order (Picked unit) to Move To Loc
            • Else - Actions
      • Custom script: call RemoveLocation(udg_Loc)
  • Demon Charge
    • Events
      • Unit - A unit enters Death Warp Back <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
      • ((Triggering unit) is A Hero) Equal to False
    • Actions
      • Set Loc = (Point((Random real number between -15000.00 and 9500.00), -12900.00))
      • Unit - Add Demonic Endurance (Neutral Hostile) to (Triggering unit)
      • Unit - Add Dreadlord Aura (Neutral Hostile) to (Triggering unit)
      • Unit - Order (Triggering unit) to Attack-Move To Loc
      • Custom script: call RemoveLocation(udg_Loc)
  • Lightning Blast
    • Events
      • Time - Every 16.00 seconds of game time
    • Conditions
    • Actions
      • Set Loc = (Center of Death Warp <gen>)
      • Set Loc2 = (Center of Demon Well <gen>)
      • Lightning - Create a Chain Lightning - Primary lightning effect from source Loc to target Loc2
      • Wait 2.00 seconds
      • Lightning - Destroy (Last created lightning effect)
      • Set Loc = (Center of Death Warp <gen>)
      • Set Loc2 = (Center of Demon Well <gen>)
      • Lightning - Create a Drain Life lightning effect from source Loc to target Loc2
      • Wait 2.00 seconds
      • Lightning - Destroy (Last created lightning effect)
      • Set Loc = (Center of Death Warp <gen>)
      • Set Loc2 = (Center of Demon Well <gen>)
      • Lightning - Create a Drain Mana lightning effect from source Loc to target Loc2
      • Wait 2.00 seconds
      • Lightning - Destroy (Last created lightning effect)
      • Set Loc = (Center of Death Warp <gen>)
      • Set Loc2 = (Center of Demon Well <gen>)
      • Lightning - Create a Finger of Death lightning effect from source Loc to target Loc2
      • Wait 2.00 seconds
      • Lightning - Destroy (Last created lightning effect)
      • Set Loc = (Center of Death Warp <gen>)
      • Set Loc2 = (Center of Demon Well <gen>)
      • Lightning - Create a Healing Wave - Primary lightning effect from source Loc to target Loc2
      • Wait 2.00 seconds
      • Lightning - Destroy (Last created lightning effect)
      • Set Loc = (Center of Death Warp <gen>)
      • Set Loc2 = (Center of Demon Well <gen>)
      • Lightning - Create a Mana Burn lightning effect from source Loc to target Loc2
      • Wait 2.00 seconds
      • Lightning - Destroy (Last created lightning effect)
      • Set Loc = (Center of Death Warp <gen>)
      • Set Loc2 = (Center of Demon Well <gen>)
      • Lightning - Create a Spirit Link lightning effect from source Loc to target Loc2
      • Wait 2.00 seconds
      • Lightning - Destroy (Last created lightning effect)
      • Set Loc = (Center of Death Warp <gen>)
      • Set Loc2 = (Center of Demon Well <gen>)
      • Lightning - Create a Mana Flare lightning effect from source Loc to target Loc2
      • Wait 2.00 seconds
      • Lightning - Destroy (Last created lightning effect)
      • Custom script: call RemoveLocation(udg_Loc)
      • Custom script: call RemoveLocation(udg_Loc2)
  • Horn Blast
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Sound - Play ClanInvitation <gen>
  • Death Spawn
    • Events
      • Time - Every 20.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Set DeathCount = (Number of units in (Units in (Playable map area) owned by Player 12 (Brown)))
      • If (DeathCount Greater than 90) then do (Skip remaining actions) else do (Do nothing)
      • Set Loc = (Random point in Death Spawn 1 <gen>)
      • Unit - Create 1 Abomination for Player 12 (Brown) at Loc facing Default building facing degrees
      • Set Loc = (Random point in Death Region <gen>)
      • Unit - Order (Last created unit) to Move To Loc
      • Set Loc = (Random point in Death Spawn 1 <gen>)
      • Unit - Create 6 Ghoul for Player 12 (Brown) at Loc facing Default building facing degrees
      • Set Loc = (Random point in Death Region <gen>)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Order (Last created unit group) to Move To Loc
      • Set Loc = (Random point in Death Spawn 1 <gen>)
      • Unit - Create 1 Frost Wyrm for Player 12 (Brown) at Loc facing Default building facing degrees
      • Set Loc = (Random point in Death Region <gen>)
      • Unit - Order (Last created unit) to Move To Loc
      • Set Loc = (Random point in Death Spawn 2 <gen>)
      • Unit - Create 1 Nether Dragon for Player 12 (Brown) at Loc facing Default building facing degrees
      • Set Loc = (Random point in Death Region <gen>)
      • Unit - Order (Last created unit) to Move To Loc
      • Set Loc = (Random point in Death Spawn 3 <gen>)
      • Unit - Create 1 Doom Guard for Player 12 (Brown) at Loc facing Default building facing degrees
      • Set Loc = (Random point in Death Region <gen>)
      • Unit - Order (Last created unit) to Move To Loc
      • Set Loc = (Random point in Death Spawn 3 <gen>)
      • Unit - Create 1 Fel Stalker for Player 12 (Brown) at Loc facing Default building facing degrees
      • Set Loc = (Random point in Death Region <gen>)
      • Unit - Order (Last created unit) to Move To Loc
      • Set Loc = (Random point in Death Spawn 3 <gen>)
      • Unit - Create 1 Abomination for Player 12 (Brown) at Loc facing Default building facing degrees
      • Set Loc = (Random point in Death Region <gen>)
      • Unit - Order (Last created unit) to Move To Loc
      • Custom script: call RemoveLocation(udg_Loc)
  • Environment Changes
    • Events
    • Conditions
    • Actions
      • Trigger - Turn on Horn Blast <gen>
      • Trigger - Turn on Reminder <gen>
      • Trigger - Turn on Portal <gen>
      • Trigger - Turn on Lightning Blast <gen>
      • Trigger - Turn on Demon Outpouring <gen>
      • Trigger - Turn on Death Spawn <gen>
      • Environment - Change water tinting color to (0.00%, 100.00%, 0.00%) with 0.00% transparency
      • Environment - Set fog to style Linear, z-start 0.00, z-end 6000.00, density 1.00 and color (100.00%, 0.00%, 0.00%)
      • Game - Set time of day speed to 10000.00% of the default speed
  • Demon Attack
    • Events
      • Unit - A unit comes within 1000.00 of The Demon 0578 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
    • Actions
      • Sound - Stop music After fading
      • Sound - Play Doom <gen>
      • Unit - Reset ability cooldowns for The Demon 0578 <gen>
      • Set Loc = (Position of (Triggering unit))
      • Unit - Order The Demon 0578 <gen> to Special Archimonde - Rain Of Chaos Loc
      • Custom script: call RemoveLocation(udg_Loc)
      • Wait 60.00 seconds
      • Sound - Resume music
I know FOR CERTAIN that the error is in one of those triggers because the game never crashes until after those are run, and it happens at a time in the game that is not constant. Bascially, I'm just looking for something that I did that is a big 'no-no' in the programming.

Can anybody help?
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
Well, wall of text hits me for 999 damage.
I couldn't read the whole stuff, sorry.

Game - Set time of day speed to 10000.00% of the default speed
This smells fishy. I'm not sure if it can cause problems, but if you speed up everything to 10000% times then that means your computer has to work on 100 times of its normal pace.. My baby sometimes cries when there are more than a few dozen units on the screen at once... so...

The other thing is. I saw you have events which are fired when something enters an area. You can making it infinitly recursive if you create a unit in the same area.
 
Level 4
Joined
Jun 10, 2007
Messages
46
Well, after scanning the triggers I'm confident I'm not having recursion problems.

I'm going to disable the special effects for now until somebody can tell me what I'm doing wrong. My best guess is that most of my problems are coming from the environment effects, the time setting, (like you said) and various other stuff.

I've tried to check as frequently as possible for memory leaks, but I'm pretty much a noob at finding/fixing memory leaks, so there's a chance that those might be my problem.
 
Last edited:
Level 4
Joined
Jun 10, 2007
Messages
46
Found

Okay, while working on another map of mine, I figured out the problem, which could be important for other map designers.

WCIII hates lightning effects.

in the lightning blast trigger, I'm firing a lightning effect every few seconds indefinately.

In the map I was working on, I added a permanent lightning effect that arcs across the map every half second. The map crashed within minutes.

So the question becomes, of course............. does anybody know how to get lightning to work without problems?
 
Status
Not open for further replies.
Top