• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Duel event crashing game

Status
Not open for further replies.
Level 8
Joined
Jul 25, 2009
Messages
194
Hi, im currently trying to make a team battle event where all units of both teams fight in an arena but before it finishes, it always crashes at a random time during the match and just recently it crashed 5 seconds after the match begun. I cant seem to find out wats causing it. Can someone help find out wats causing game to crash? Thanks soo much if help

The duel trigger:
  • Events
    • Time - Elapsed game time is 815.00 seconds
  • Conditions
  • Actions
    • Unit - Pause all units
    • Unit Group - Pick every unit in (Units in Entire map excluding out of bounds <gen>) and do (Actions)
      • Loop - Actions
        • If (((Picked unit) is A structure) Equal to False) then do (Unit - Create 1 Protector for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees) else do (Do nothing)
    • Unit Group - Pick every unit in (Units in Entire map excluding out of bounds <gen>) and do (Actions)
      • Loop - Actions
        • Unit - Order (Picked unit) to Orc Shadow Hunter - Big Bad Voodoo
    • Game - Display to (All players) for 15.00 seconds the text: All humans VS all u...
    • Sound - Stop the currently playing music theme
    • Sound - Play PH1 <gen>
    • Wait 5.00 seconds
    • Trigger - Turn on Humans win duel <gen>
    • Trigger - Turn on Undead Win <gen>
    • Player Group - Pick every player in Evil and do (Actions)
      • Loop - Actions
        • Camera - Pan camera for (Picked player) to (Center of Undead duel spawn area <gen>) over 0.00 seconds
    • Player Group - Pick every player in Humans and do (Actions)
      • Loop - Actions
        • Camera - Pan camera for (Picked player) to (Center of Human duel spawn area <gen>) over 0.00 seconds
    • Unit Group - Pick every unit in (Units in Entire map excluding out of bounds <gen>) and do (Actions)
      • Loop - Actions
        • If ((((Owner of (Picked unit)) is in Evil) Equal to True) and (((Picked unit) is A structure) Equal to False)) then do (Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of (Picked unit)) at (Random point in Undead duel spawn area <gen>) facing Default building facing degrees) else do (Do nothing)
    • Unit Group - Pick every unit in (Units in Entire map excluding out of bounds <gen>) and do (Actions)
      • Loop - Actions
        • If ((((Owner of (Picked unit)) is in Humans) Equal to True) and (((Picked unit) is A structure) Equal to False)) then do (Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of (Picked unit)) at (Random point in Human duel spawn area <gen>) facing Default building facing degrees) else do (Do nothing)
Unit dies:

  • Events
    • Unit - A unit Dies
  • Conditions
    • (Duel area <gen> contains (Dying unit)) Equal to True
    • ((Owner of (Dying unit)) is in Humans) Equal to True
    • ((Dying unit) is A structure) Equal to False
    • ((Dying unit) is Summoned) Equal to False
    • (Unit-type of (Dying unit)) Not equal to Worker
    • (Unit-type of (Dying unit)) Not equal to Worker 2
    • (Unit-type of (Dying unit)) Not equal to Footman
    • (Unit-type of (Dying unit)) Not equal to Footman 2
    • (Unit-type of (Dying unit)) Not equal to Archer
    • (Race of (Dying unit)) Equal to Human
  • Actions
    • Unit - Create 1 Humans for Neutral Passive at (Center of Humans lose zone <gen>) facing Default building facing degrees
Unit dies2:
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Duel area <gen> contains (Dying unit)) Equal to True
    • ((Owner of (Dying unit)) is in Evil) Equal to True
    • ((Dying unit) is A structure) Equal to False
    • ((Dying unit) is Summoned) Equal to False
    • (Unit-type of (Dying unit)) Not equal to Giant Zombie
    • (Unit-type of (Dying unit)) Not equal to Poison Zombie
    • (Unit-type of (Dying unit)) Not equal to Speedy Zombie
    • (Unit-type of (Dying unit)) Not equal to Doom Guard
    • (Race of (Dying unit)) Equal to Undead
  • Actions
    • Unit - Create 1 Undead for Neutral Passive at (Center of Humans lose zone <gen>) facing Default building facing degrees
Undead Win:
  • Events
    • Time - Every 0.01 seconds of game time
  • Conditions
    • (Number of living Humans units owned by Neutral Passive) Equal to (Number of players in (All allies of (Random player from Humans)))
  • Actions
    • Game - Display to (All players) for 30.00 seconds the text: The Undead have won...
    • Player Group - Pick every player in Evil and do (Actions)
      • Loop - Actions
        • Player - Add 100 to (Picked player) Current gold
    • Unit - Unpause all units
    • Unit Group - Pick every unit in (Units in Duel area <gen>) and do (Actions)
      • Loop - Actions
        • Unit - Remove (Picked unit) from the game
    • Trigger - Turn on Game resuming in 10 seconds <gen>
    • Trigger - Turn off (This trigger)
Human Win:
  • Time - Every 0.01 seconds of game time
  • Conditions
    • (Number of living Undead units owned by Neutral Passive) Equal to (Number of players in (All allies of (Random player from Evil)))
  • Actions
    • Game - Display to (All players) for 30.00 seconds the text: The Humans have won...
    • Player Group - Pick every player in Humans and do (Actions)
      • Loop - Actions
        • Player - Add 100 to (Picked player) Current gold
    • Unit - Unpause all units
    • Unit Group - Pick every unit in (Units in Duel area <gen>) and do (Actions)
      • Loop - Actions
        • Unit - Remove (Picked unit) from the game
      • Trigger - Turn on Game resuming in 10 seconds <gen>
    • Trigger - Turn off (This trigger)
 
Level 8
Joined
Jul 25, 2009
Messages
194
Thanks :D I didnt know leaks could cause game to crash. Did i fix it?

EDIT:I just got 17 compile errors :l That said: "invalid argument type (rect)" or "expected a code statement (rect)" while trying to save
What does it mean?


The duel trigger:
  • Events
    • Time - Elapsed game time is 815.00 seconds
  • Conditions
  • Actions
    • Unit - Pause all units
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in Entire map excluding out of bounds <gen>) and do (Actions)
      • Loop - Actions
        • If (((Picked unit) is A structure) Equal to False) then do (Unit - Create 1 Protector for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees) else do (Do nothing)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in Entire map excluding out of bounds <gen>) and do (Actions)
      • Loop - Actions
        • Unit - Order (Picked unit) to Orc Shadow Hunter - Big Bad Voodoo
    • Game - Display to (All players) for 15.00 seconds the text: All humans VS all u...
    • Sound - Stop the currently playing music theme
    • Sound - Play PH1 <gen>
    • Wait 5.00 seconds
    • Trigger - Turn on Humans win duel <gen>
    • Trigger - Turn on Undead Win <gen>
    • Set Region1 = Undead duel spawn area <gen>
    • Set Region2 = Human duel spawn area <gen>
    • Set Region5 = Entire map excluding out of bounds <gen>
    • Set PG1 = Evil
    • Set PG2 = Humans
    • Player Group - Pick every player in PG1 and do (Actions)
      • Loop - Actions
        • Camera - Pan camera for (Picked player) to (Center of Region1) over 0.00 seconds
    • Player Group - Pick every player in PG2 and do (Actions)
      • Loop - Actions
        • Camera - Pan camera for (Picked player) to (Center of Region2) over 0.00 seconds
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in Region5) and do (Actions)
      • Loop - Actions
        • If ((((Owner of (Picked unit)) is in Evil) Equal to True) and (((Picked unit) is A structure) Equal to False)) then do (Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of (Picked unit)) at (Random point in Region1) facing Default building facing degrees) else do (Do nothing)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in Entire map excluding out of bounds <gen>) and do (Actions)
      • Loop - Actions
        • If ((((Owner of (Picked unit)) is in Humans) Equal to True) and (((Picked unit) is A structure) Equal to False)) then do (Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of (Picked unit)) at (Random point in Region2) facing Default building facing degrees) else do (Do nothing)
    • Custom script: call RemoveLocation(udg_Region1)
    • Custom script: call RemoveLocation(udg_Region2)
    • Custom script: call RemoveLocation(udg_Region5)
    • Custom script: call DestroyForce(udg_PG1)
    • Custom script: call DestroyForce(udg_PG2)
Unit dies:

  • Events
    • Unit - A unit Dies
  • Conditions
    • (Duel area <gen> contains (Dying unit)) Equal to True
    • ((Owner of (Dying unit)) is in Humans) Equal to True
    • ((Dying unit) is A structure) Equal to False
    • ((Dying unit) is Summoned) Equal to False
    • (Unit-type of (Dying unit)) Not equal to Worker
    • (Unit-type of (Dying unit)) Not equal to Worker 2
    • (Unit-type of (Dying unit)) Not equal to Footman
    • (Unit-type of (Dying unit)) Not equal to Footman 2
    • (Unit-type of (Dying unit)) Not equal to Archer
    • (Race of (Dying unit)) Equal to Human
  • Actions
    • Set Region3 = Humans lose zone <gen>
    • Unit - Create 1 Humans for Neutral Passive at (Center of Humans lose zone <gen>) facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_Region3)
Unit dies2:
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Duel area <gen> contains (Dying unit)) Equal to True
    • ((Owner of (Dying unit)) is in Evil) Equal to True
    • ((Dying unit) is A structure) Equal to False
    • ((Dying unit) is Summoned) Equal to False
    • (Unit-type of (Dying unit)) Not equal to Giant Zombie
    • (Unit-type of (Dying unit)) Not equal to Poison Zombie
    • (Unit-type of (Dying unit)) Not equal to Speedy Zombie
    • (Unit-type of (Dying unit)) Not equal to Doom Guard
    • (Race of (Dying unit)) Equal to Undead
  • Actions
    • Set Region3 = Undead Lose Zone <gen>
    • Unit - Create 1 Undead for Neutral Passive at (Center of Humans lose zone <gen>) facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_Region4)
Undead Win:
  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
    • (Number of living Humans units owned by Neutral Passive) Equal to (Number of players in (All allies of (Random player from Humans)))
  • Actions
    • Game - Display to (All players) for 30.00 seconds the text: The Undead have won...
    • Set PG1 = Evil
    • Player Group - Pick every player in PG1 and do (Actions)
      • Loop - Actions
        • Player - Add 100 to (Picked player) Current gold
    • Custom script: call DestroyForce(udg_PG1)
    • Unit - Unpause all units
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in Duel area <gen>) and do (Actions)
      • Loop - Actions
        • Unit - Remove (Picked unit) from the game
    • Trigger - Turn on Game resuming in 10 seconds <gen>
    • Trigger - Turn off (This trigger)
Human Win:
I died same as undead win
 
  • Camera - Pan camera for (Picked player) to (Center of Region1) over 0.00 seconds
Leak 1

  • Camera - Pan camera for (Picked player) to (Center of Region2) over 0.00 seconds
Leak 2

  • If ((((Owner of (Picked unit)) is in Evil) Equal to True) and (((Picked unit) is A structure) Equal to False)) then do (Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of (Picked unit)) at (Random point in Region1) facing Default building facing degrees) else do (Do nothing)
Leak 3 (I am speaking of the "Random point in Region1")

  • If ((((Owner of (Picked unit)) is in Humans) Equal to True) and (((Picked unit) is A structure) Equal to False)) then do (Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of (Picked unit)) at (Random point in Region2) facing Default building facing degrees) else do (Do nothing)
Leak 4 (Same as above)

You are doing something wrong:

  • Set Region1 = Undead duel spawn area <gen>
  • Custom script: call RemoveLocation(udg_Region1)
Your Region1 variable is a region variable, yet you remove it as if it was a location. To remove regions, you need this script:
  • Custom script: call RemoveRect(udg_Region1)
What is more, if you are about to use that region again, you must not remove it, because you won't be able of using it again.

  • Unit - Create 1 Humans for Neutral Passive at (Center of Humans lose zone <gen>) facing Default building facing degrees
Leak 5 (Center of Humans lose zone <gen>)

  • Unit - Create 1 Undead for Neutral Passive at (Center of Humans lose zone <gen>) facing Default building facing degrees
Leak 6

You didn't realize how to remove point leaks.
You don't need to make a Region-based variable, you must make a Point-based variable and refer to it, e.g.:
  • Set Point1 = (Center of Region 001 <gen>)
  • Unit - Create 1 Unit for (Picked Player) at Point1 facing default building degrees
  • Custom script: call RemoveLocation (udg_Point1)
 
Level 8
Joined
Jul 25, 2009
Messages
194
thanks so much! Is this fixed? I didn't get any error messages :D


The duel trigger:
  • Events
    • Time - Elapsed game time is 815.00 seconds
  • Conditions
  • Actions
    • Unit - Pause all units
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in Entire map excluding out of bounds <gen>) and do (Actions)
      • Loop - Actions
        • If (((Picked unit) is A structure) Equal to False) then do (Unit - Create 1 Protector for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees) else do (Do nothing)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in Entire map excluding out of bounds <gen>) and do (Actions)
      • Loop - Actions
        • Unit - Order (Picked unit) to Orc Shadow Hunter - Big Bad Voodoo
    • Game - Display to (All players) for 15.00 seconds the text: All humans VS all u...
    • Sound - Stop the currently playing music theme
    • Sound - Play PH1 <gen>
    • Wait 5.00 seconds
    • Trigger - Turn on Humans win duel <gen>
    • Trigger - Turn on Undead Win <gen>
    • Set Region1 = Undead duel spawn area <gen>
    • Set Region2 = Human duel spawn area <gen>
    • Set Region5 = Entire map excluding out of bounds <gen>
    • Set PG1 = Evil
    • Set PG2 = Humans
    • Set Point1 = (Center of Humans lose zone <gen>)
    • Set Point2 = (Center of Undead Lose Zone <gen>)
    • Player Group - Pick every player in PG1 and do (Actions)
      • Loop - Actions
        • Camera - Pan camera for (Picked player) to (Center of Region1) over 0.00 seconds
    • Player Group - Pick every player in PG2 and do (Actions)
      • Loop - Actions
        • Camera - Pan camera for (Picked player) to (Center of Region2) over 0.00 seconds
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in Region5) and do (Actions)
      • Loop - Actions
        • If ((((Owner of (Picked unit)) is in Evil) Equal to True) and (((Picked unit) is A structure) Equal to False)) then do (Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of (Picked unit)) at (Random point in Region1) facing Default building facing degrees) else do (Do nothing)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in Entire map excluding out of bounds <gen>) and do (Actions)
      • Loop - Actions
        • If ((((Owner of (Picked unit)) is in Humans) Equal to True) and (((Picked unit) is A structure) Equal to False)) then do (Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of (Picked unit)) at (Random point in Region2) facing Default building facing degrees) else do (Do nothing)
Unit dies:

  • Events
    • Unit - A unit Dies
  • Conditions
    • (Duel area <gen> contains (Dying unit)) Equal to True
    • ((Owner of (Dying unit)) is in Humans) Equal to True
    • ((Dying unit) is A structure) Equal to False
    • ((Dying unit) is Summoned) Equal to False
    • (Unit-type of (Dying unit)) Not equal to Worker
    • (Unit-type of (Dying unit)) Not equal to Worker 2
    • (Unit-type of (Dying unit)) Not equal to Footman
    • (Unit-type of (Dying unit)) Not equal to Footman 2
    • (Unit-type of (Dying unit)) Not equal to Archer
    • (Race of (Dying unit)) Equal to Human
  • Actions
    • Unit - Create 1 Humans for Neutral Passive at Point1 facing Default building facing degrees
Unit dies2:
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Duel area <gen> contains (Dying unit)) Equal to True
    • ((Owner of (Dying unit)) is in Evil) Equal to True
    • ((Dying unit) is A structure) Equal to False
    • ((Dying unit) is Summoned) Equal to False
    • (Unit-type of (Dying unit)) Not equal to Giant Zombie
    • (Unit-type of (Dying unit)) Not equal to Poison Zombie
    • (Unit-type of (Dying unit)) Not equal to Speedy Zombie
    • (Unit-type of (Dying unit)) Not equal to Doom Guard
    • (Race of (Dying unit)) Equal to Undead
  • Actions
    • Unit - Create 1 Undead for Neutral Passive at Point2 facing Default building facing degrees
Game Resuming (Turns on when duel over):
  • Events
    • Time - Every 4.00 seconds of game time
  • Conditions
  • Actions
    • Wait 3.00 seconds
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in Region5) and do (Actions)
      • Loop - Actions
        • If ((Unit-type of (Picked unit)) Equal to Protector) then do (Unit - Remove (Picked unit) from the game) else do (Do nothing)
    • Sound - Stop music After fading
    • Game - Display to (All players) for 30.00 seconds the text: Game will resume so...
    • Sound - Play Human 1
    • Custom script: call RemoveLocation(udg_Point1)
    • Custom script: call RemoveLocation(udg_Point2)
    • Custom script: call DestroyForce(udg_PG1)
    • Custom script: call DestroyForce(udg_PG2)
    • Custom script: call RemoveRect(udg_Region1)
    • Custom script: call RemoveRect(udg_Region2)
    • Custom script: call RemoveRect(udg_Region5)
    • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top