DebugLog

Events


Map initialization

Conditions

Actions


-------- ------------------------------------------------------------ --------


-------- ------------------------------------------------------------ --------


-------- DEBUG LOG --------


-------- ------------------------------------------------------------ --------


-------- ------------------------------------------------------------ --------


-------- Records all messages (not the ones that spawn in the screen) --------


-------- as debug messages then adds it into a text document w/c is created --------


-------- ------------------------------------------------------------ --------


-------- ------------------------------------------------------------ --------


-------- ------------------------------------------------------------ --------


-------- CONFIGURATION --------


-------- ------------------------------------------------------------ --------


-------- ------------------------------------------------------------ --------


-------- Below,determines the folder path where you --------


-------- are going to save the document --------


-------- ------------------------------------------------------------ --------


Set DL_SavePath = Map Errors\\


Set DL_MapName = MyMap


-------- ------------------------------------------------------------ --------


-------- Below,allows you to auto-update or create the document --------


-------- ------------------------------------------------------------ --------


Set DL_Auto = False


-------- ------------------------------------------------------------ --------


-------- Below,the interval value where it will record all messages --------


-------- ------------------------------------------------------------ --------


Set DL_Int = 0.03


-------- ------------------------------------------------------------ --------


-------- END --------


-------- ------------------------------------------------------------ --------


Custom script: call ExecuteFunc("DL_OnInit")


Custom script: endfunction


-------- ------------------------------------------------------------ --------


-------- LogAdd --------


-------- ------------------------------------------------------------ --------


-------- Records the debug msg you want to add --------


-------- ------------------------------------------------------------ --------


-------- Recquires : DL_Msg --------


-------- ------------------------------------------------------------ --------


Custom script: function DL_LogAdd takes nothing returns nothing



Custom script: local string sec = I2S(udg_DL_Sec)



Custom script: local string msec = I2S(udg_DL_MSec)



If (All Conditions are True) then do (Then Actions) else do (Else Actions)




If - Conditions





DL_Sec Less than 10




Then - Actions





Custom script: set sec = "0" + sec




Else - Actions



If (All Conditions are True) then do (Then Actions) else do (Else Actions)




If - Conditions





DL_MSec Less than 10




Then - Actions





Custom script: set msec = "0" + msec




Else - Actions



Custom script: set udg_DL_Log[udg_DL_Index] = "[ " + I2S(udg_DL_Mins) + " : " + sec + " : " + msec + " ] : " + udg_DL_Msg + "\r\n\t"



Set DL_Index = (DL_Index + 1)


Custom script: endfunction


-------- ------------------------------------------------------------ --------


-------- LogClear --------


-------- ------------------------------------------------------------ --------


-------- Clears all recorded logs --------


-------- ------------------------------------------------------------ --------


Custom script: function DL_LogClear takes nothing returns nothing



Custom script: local integer i = 0



Custom script: loop



Custom script: exitwhen i > udg_DL_Index



Custom script: set udg_DL_Log[i] = ""



Custom script: set i = i + 1



Custom script: endloop



Set DL_Index = 0


Custom script: endfunction


-------- ------------------------------------------------------------ --------


-------- LogUpdate --------


-------- ------------------------------------------------------------ --------


-------- Updates or creates the text document --------


-------- which all of the msgs recorded are inside --------


-------- ------------------------------------------------------------ --------


Custom script: function DL_LogUpdate takes nothing returns nothing



Custom script: local integer i = 0



Custom script: call PreloadGenClear()



Custom script: call PreloadGenStart()



Custom script: loop



Custom script: exitwhen i > udg_DL_Index



Custom script: call Preload("\")\r\n\t" + udg_DL_Log[i] + "\r\n\t(\"")



Custom script: set i = i + 1



Custom script: endloop



Custom script: call PreloadGenEnd(udg_DL_SavePath + udg_DL_MapName +" - DebugLog.txt")


Custom script: endfunction


-------- ------------------------------------------------------------ --------


-------- TimeBuffer --------


-------- ------------------------------------------------------------ --------


-------- Records minutes , seconds and deciseconds --------


-------- ------------------------------------------------------------ --------


Custom script: function DL_TimeBuffer takes nothing returns nothing



Set DL_MSec = (DL_MSec + (Integer((DL_Int x 100.00))))



If (All Conditions are True) then do (Then Actions) else do (Else Actions)




If - Conditions





DL_MSec Greater than 99




Then - Actions





Set DL_MSec = (DL_MSec - 100)





Set DL_Sec = (DL_Sec + 1)





If (All Conditions are True) then do (Then Actions) else do (Else Actions)






If - Conditions







DL_Sec Greater than 59






Then - Actions







Set DL_Sec = 0







Set DL_Mins = (DL_Mins + 1)






Else - Actions




Else - Actions


Custom script: endfunction


-------- ------------------------------------------------------------ --------


-------- Initialize --------


-------- ------------------------------------------------------------ --------


Custom script: function DL_OnInit takes nothing returns nothing



If (All Conditions are True) then do (Then Actions) else do (Else Actions)




If - Conditions





DL_Auto Equal to True




Then - Actions





Custom script: call TimerStart(CreateTimer(),udg_DL_Int,true,function DL_LogUpdate)




Else - Actions



Custom script: call TimerStart(CreateTimer(),udg_DL_Int,true,function DL_TimeBuffer)
Example

Events


Unit - A unit Is attacked

Conditions

Actions


Set DL_Msg = (((Name of (Owner of (Attacking unit))) + ('s + (Name of (Attacking unit)))) + ( attacks + ((Name of (Triggering player)) + ('s + (Name of (Triggering unit))))))


Custom script: call ExecuteFunc("DL_LogAdd")


Game - Display to (All players) the text: DL_Msg


-------- Example of updating --------


Set I = (I + 1)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




I Equal to 10



Then - Actions




Custom script: call ExecuteFunc("DL_LogUpdate")




Game - Display to (All players) the text: Created Text Docume...




Set I = 0



Else - Actions