HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Debugging

04-14-2008, 10:22 AM#1
Pheonix-IV
Aagahagahaghagahgh.

Is there any way to get this stupid program to print out some sort of error log so i can work out why my trigger is crashing the game when it runs for the second time for player 2 (only for player 2, not for player 1, player 1 can run it as many times as he wants. FUCK.)
04-14-2008, 10:30 AM#2
ADOLF
in NGJP there is a catching some instructions, which crashed game (execute functions are not present for example)

but here...
04-14-2008, 10:41 AM#3
Pheonix-IV
I miss SupCom's log :(

By the way, here's the relevant triggers if anyone wants to go through them and tell me what's wrong. (Don't tell me my code sucks. I don't care.)


What's happening is thus:

I grab my 3 players and start combat. Combat starts, initiative is randomly assaigned and somone goes first.

Everything is fine.

Then, when it reaches either Player 2 or Player 3's SECOND turn (either one, doesn't matter which, but it has to be the second turn) WCIII crashes somewhere after the wait in End Turn. I don't know where. So it's either crashing at End Turn after the wait or it's crashing trying to run Start Turn.

Here's the kicker, Player 1 can have as many turns as he wants. I rigged it to do the turns based on a timer and P1 never crashed. P2 and P3 always crashed on their second turn.



Start Combat

Trigger:
Start Combat
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to +Attack
((Triggering unit) has buff In Combat ) Equal to False
Collapse Actions
Set NumEnemy = 0
Set NumHero = 0
Set CombatState = 0
Set CombatOn = True
Set CurrentTurn = 0
Set TurnNumber = 0
Set temppoint = (Position of (Triggering unit))
Set temppoint2 = (Position of (Target unit of ability being cast))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Distance between temppoint and temppoint2) Greater than or equal to 1000.00
Collapse Then - Actions
Floating Text - Create floating text that reads Too Far at temppoint with Z offset 50.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 30.00 towards 90.00 degrees
Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
Floating Text - Change (Last created floating text): Disable permanence
Skip remaining actions
Else - Actions
Set tempgroup = (Units within ((Current movement speed of (Triggering unit)) x 4.00) of temppoint matching (((Matching unit) is A Hero) Equal to True))
Collapse Unit Group - Pick every unit in tempgroup and do (Actions)
Collapse Loop - Actions
Unit Group - Add (Picked unit) to InCombat
Custom script: call DestroyGroup( udg_tempgroup )
Set tempgroup = (Units within ((Current movement speed of (Triggering unit)) x 4.00) of temppoint2 matching (((Matching unit) is A Hero) Equal to True))
Collapse Unit Group - Pick every unit in tempgroup and do (Actions)
Collapse Loop - Actions
Unit Group - Add (Picked unit) to InCombat
Custom script: call RemoveLocation( udg_temppoint )
Custom script: call RemoveLocation( udg_temppoint2 )
Custom script: call DestroyGroup( udg_tempgroup )
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Set ActionsAvailable[(Integer A)] = 0
Set ActionsTaken[(Integer A)] = 0
Set TakenTurn[(Integer A)] = False
Collapse Unit Group - Pick every unit in InCombat and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of (Picked unit)) Equal to Player 1 (Red)
Collapse Then - Actions
Set NumEnemy = (NumEnemy + 1)
Collapse Else - Actions
Set NumHero = (NumHero + 1)
Unit - Remove In Combat from (Picked unit)
Unit - Add In Combat to (Picked unit)
Unit - Pause all units
Set Initiative[(Player number of (Owner of (Picked unit)))] = ((Random integer number between 1 and 20) + (Agility of Hero[(Player number of (Owner of (Picked unit)))] (Include bonuses)))
Set ActionsAvailable[(Player number of (Owner of (Picked unit)))] = (ActionsAvailable[(Player number of (Owner of (Picked unit)))] + 2)
Game - Display to (All players) the text: Combat Initiated!
Sound - Stop CurrentMusic After fading
Set tempint = (Random integer number between 1 and 2)
If (tempint Equal to 1) then do (Set CurrentMusic = Battle1 <gen>) else do (Set CurrentMusic = Battle2 <gen>)
Sound - Play CurrentMusic
Set TurnNumber = 0
Trigger - Run Turn Start <gen> (ignoring conditions)



Turn Start

Trigger:
Turn Start
Events
Conditions
Collapse Actions
Set tempint = 0
Set CurrentTurn = 0
Set TurnNumber = (TurnNumber + 1)
Collapse For each (Integer B) from 1 to NumPlayers, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Initiative[(Integer B)] Greater than tempint
TakenTurn[(Integer B)] Equal to False
((Hero[(Integer B)] is alive) Equal to True) or ((Integer B) Equal to 1)
Collapse Then - Actions
Set tempint = Initiative[(Integer B)]
Set CurrentTurn = (Integer B)
Else - Actions
Game - Display to (All players) the text: ((Name of (Player(CurrentTurn))) + 's Turn)
Collapse Unit Group - Pick every unit in InCombat and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of (Picked unit)) Equal to (Player(CurrentTurn))
Collapse Then - Actions
Unit - Unpause (Picked unit)
Collapse Else - Actions
Unit - Unpause (Picked unit)
Unit - Pause (Picked unit)
Wait 0.50 seconds
Trigger - Turn on Turn End <gen>



Turn End

Trigger:
Turn End
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Not equal to +Confirm Stats
(Ability being cast) Not equal to +Display Stats
(Ability being cast) Not equal to +Endurance
(Ability being cast) Not equal to +Intellegence
(Ability being cast) Not equal to +Range Circle
(Ability being cast) Not equal to +Reflexes
(Ability being cast) Not equal to +Reset Range Circle
(Ability being cast) Not equal to +Reset Stats
((Triggering unit) has buff In Combat ) Equal to True
CombatOn Equal to True
Collapse Actions
Set temppoint = (Position of (Triggering unit))
Set temppoint2 = (Position of (Triggering unit))
Set temppoint2 = (Target point of ability being cast)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Distance between temppoint and temppoint2) Greater than or equal to ((Current movement speed of (Triggering unit)) x 3.00)
Collapse Then - Actions
Unit - Pause (Triggering unit)
Unit - Order (Triggering unit) to Stop
Unit - Unpause (Triggering unit)
Floating Text - Create floating text that reads Too Far at temppoint with Z offset 50.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 30.00 towards 90.00 degrees
Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
Floating Text - Change (Last created floating text): Disable permanence
Custom script: call RemoveLocation( udg_temppoint )
Custom script: call RemoveLocation( udg_temppoint2 )
Skip remaining actions
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Ability being cast) Equal to +Move
Collapse Then - Actions
Set ActionsTaken[(Player number of (Owner of (Triggering unit)))] = (ActionsTaken[(Player number of (Owner of (Triggering unit)))] - 1)
Unit - Order (Triggering unit) to Move To temppoint2
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Ability being cast) Equal to +Attack
Collapse Then - Actions
Unit - Order (Triggering unit) to Attack Once (Target unit of ability being cast)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Ability being cast) Equal to +Hold Ground
Collapse Then - Actions
Unit - Add Holding Ground to (Triggering unit)
Set GuardTarget[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Ability being cast) Equal to +Guard
Collapse Then - Actions
Set temppoint3 = (Position of (Target unit of ability being cast))
Set temppoint4 = (temppoint3 offset by 150.00 towards (Angle from temppoint3 to temppoint) degrees)
Unit - Add Guarding to (Triggering unit)
Unit - Order (Triggering unit) to Move To temppoint4
Set GuardTarget[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
Custom script: call RemoveLocation( udg_temppoint3 )
Custom script: call RemoveLocation( udg_temppoint4 )
Else - Actions
Custom script: call RemoveLocation( udg_temppoint )
Custom script: call RemoveLocation( udg_temppoint2 )
Set ActionsTaken[(Player number of (Owner of (Triggering unit)))] = (ActionsTaken[(Player number of (Owner of (Triggering unit)))] + 2)
Collapse Unit Group - Pick every unit in InCombat and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of (Picked unit)) Equal to (Player(CurrentTurn))
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Holding Ground for (Picked unit)) Equal to 2
Collapse Then - Actions
Unit - Remove Holding Ground from (Picked unit)
Collapse Else - Actions
Unit - Increase level of Holding Ground for (Picked unit)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Guarding for (Picked unit)) Equal to 2
Collapse Then - Actions
Unit - Remove Guarding from (Picked unit)
Collapse Else - Actions
Unit - Increase level of Guarding for (Picked unit)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
ActionsTaken[(Player number of (Owner of (Triggering unit)))] Equal to ActionsAvailable[(Player number of (Owner of (Triggering unit)))]
Collapse Then - Actions
Unit Group - Add (Triggering unit) to PauseGroup
Game - Display to (All players) the text: ((Name of (Player((Player number of (Owner of (Triggering unit)))))) + 's turn ends.)
Set TakenTurn[CurrentTurn] = True
Wait 3.50 seconds
Set ActionsTaken[CurrentTurn] = 0
Collapse Unit Group - Pick every unit in PauseGroup and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of (Picked unit)) Equal to (Player(CurrentTurn))
Collapse Then - Actions
Unit - Pause (Picked unit)
Unit Group - Remove (Picked unit) from PauseGroup
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
NumEnemy Equal to 0
Collapse Then - Actions
Set CombatState = 1
Set CombatOn = False
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
NumHero Equal to 0
Collapse Then - Actions
Set CombatState = 2
Set CombatOn = False
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
CombatOn Equal to False
Collapse Then - Actions
Game - Display to (All players) the text: Combat Ends.
Sound - Stop CurrentMusic After fading
If (CombatState Equal to 1) then do (Game - Display to (All players) the text: Victory!) else do (Game - Display to (All players) the text: Defeat!)
If (CombatState Equal to 1) then do (Set CurrentMusic = Victory <gen>) else do (Set CurrentMusic = Defeat <gen>)
Sound - Play CurrentMusic
Countdown Timer - Start BGMReset as a One-shot timer that will expire in ((Length of CurrentMusic) / 2.00) seconds
Trigger - Turn off (This trigger)
Else - Actions
Trigger - Run Turn Start <gen> (ignoring conditions)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
CurrentTurn Greater than or equal to NumPlayers
Collapse Then - Actions
Collapse For each (Integer A) from 1 to NumPlayers, do (Actions)
Collapse Loop - Actions
Set TakenTurn[(Integer A)] = False
Set TurnNumber = 0
Else - Actions

04-14-2008, 12:38 PM#4
Coola
in turn end, you have 'set temppoint2=' something twice. i dont think thats the problem, but i think its an error too
04-15-2008, 12:28 AM#5
Pheonix-IV
Yes, i do that because sometimes the abilities are instant cast, and thus set no point of target ability being cast.

By setting it to the position of the caster first, it means that if it's an instant cast, it will be set to the caster position.


That was the theory anyway. Turned out that didn't work, and i havn't removed it yet because of the larger problem of the entire trigger dying.
04-15-2008, 01:53 AM#6
Rising_Dusk
Does it display the text "Game Ends" before crashing or not? You might consider adding game messages before and after every conditional, nothing jumps out and hits me as a crash-causer in a lookover.
04-15-2008, 09:39 AM#7
Pheonix-IV
tried that. I added messages every alternating line after the wait and in start turn.

It didn't display any of them. it displayed the one before the wait, and then it just crashed. No messages at all. It's somehow crashing immediately after the wait.

But the kicker is, when i remove all the functions after the wait, it still crashes.