Skip to content

Commit

Permalink
Fixed: GetStatus log variable names
Browse files Browse the repository at this point in the history
Fixed: Initialization order
Changed: Default directories now persist in InitAssembly()
  • Loading branch information
dvdvideo1234 committed Mar 29, 2016
1 parent d46f0c8 commit a7f4e71
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion hooks/pre-commit.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ set LuaPath=%1
set LogFile=%2
echo %BasPath%, %LuaPath% > %LogFile%
copy %BasPath%..\lua\autorun\%OutFile% %BasPath%..\lua\autorun\%InpFile%
call %LuaPath%lua.exe %BasPath%pre-commit.lua %BasPath%..\lua\autorun\ %OutFile% UNX E:\Desktop\tst.txt
call %LuaPath%lua.exe %BasPath%pre-commit.lua %BasPath%..\lua\autorun\ %OutFile% UNX D:\Desktop\tmp.txt
del %BasPath%..\lua\autorun\tmp.lua
exit 0
10 changes: 3 additions & 7 deletions lua/autorun/trackassembly_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,17 @@ local duplicatorStoreEntityModifier = duplicator and duplicator.StoreEntityModif
local asmlib = trackasmlib

------ CONFIGURE ASMLIB ------
asmlib.InitAssembly("track","assembly")
asmlib.SetLogControl(0,"")

This comment has been minimized.

Copy link
@dvdvideo1234

dvdvideo1234 Mar 29, 2016

Author Owner

This after InitAssembly() because it uses the paths below

asmlib.SetOpVar("TOOL_VERSION","5.221")
asmlib.SetIndexes("V",1,2,3)
asmlib.SetIndexes("A",1,2,3)
asmlib.SetIndexes("S",4,5,6,7)
asmlib.InitAssembly("track","assembly")
asmlib.SetOpVar("TOOL_VERSION","5.220")
asmlib.SetOpVar("DIRPATH_BAS",asmlib.GetOpVar("TOOLNAME_NL")..asmlib.GetOpVar("OPSYM_DIRECTORY"))
asmlib.SetOpVar("DIRPATH_EXP","exp"..asmlib.GetOpVar("OPSYM_DIRECTORY"))
asmlib.SetOpVar("DIRPATH_DSV","dsv"..asmlib.GetOpVar("OPSYM_DIRECTORY"))
asmlib.SetOpVar("DIRPATH_LOG","")
asmlib.SetOpVar("MAX_MASS",50000)
asmlib.SetOpVar("MAX_LINEAR",1000)
asmlib.SetOpVar("MAX_ROTATION",360)
asmlib.SetOpVar("LOG_ONLY",nil)
asmlib.SetOpVar("LOG_SKIP",{"Qsort","ModelToName","GetEntitySpawn: Not hitting active point","CacheQueryPiece: Record not located", "GetEntitySpawn: Trace model missing"})
asmlib.SetLogControl(0,"")

------ CONFIGURE REPLICATED CVARS ----- Server tells the client what value to use
asmlib.MakeCoVar("maxactrad", "150", {1,500} ,bitBor(FCVAR_ARCHIVE, FCVAR_ARCHIVE_XBOX, FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_PRINTABLEONLY), "Maximum active radius to search for a point ID")
Expand Down
7 changes: 7 additions & 0 deletions lua/trackassembly/trackasmlib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@ function InitAssembly(sName,sPurpose)
SetOpVar("TOOLNAME_NU",stringUpper(GetOpVar("NAME_INIT")..GetOpVar("NAME_PERP")))
SetOpVar("TOOLNAME_PL",GetOpVar("TOOLNAME_NL").."_")
SetOpVar("TOOLNAME_PU",GetOpVar("TOOLNAME_NU").."_")
SetOpVar("DIRPATH_BAS",GetOpVar("TOOLNAME_NL")..GetOpVar("OPSYM_DIRECTORY"))

This comment has been minimized.

Copy link
@dvdvideo1234

dvdvideo1234 Mar 29, 2016

Author Owner

Getting pissed about the default directory names lately.
They are going to be the these by default and I do not need to use some others anyway.

SetOpVar("DIRPATH_EXP","exp"..GetOpVar("OPSYM_DIRECTORY"))
SetOpVar("DIRPATH_DSV","dsv"..GetOpVar("OPSYM_DIRECTORY"))
SetOpVar("DIRPATH_LOG","")
SetOpVar("MISS_NOID","N") -- No ID selected
SetOpVar("MISS_NOAV","N/A") -- Not Available
SetOpVar("MISS_NOMD","X") -- No model
Expand All @@ -380,6 +384,9 @@ function InitAssembly(sName,sPurpose)
SetOpVar("NAV_PROPERTY_NAMES",{})
SetOpVar("NAV_PROPERTY_TYPES",{})
SetOpVar("NAV_PANEL",{})
SetOpVar("LOG_MAXLOGS",0)
SetOpVar("LOG_CURLOGS",0)
SetOpVar("LOG_LOGFILE","")
SetOpVar("STRUCT_SPAWN",{
F = Vector(),
R = Vector(),
Expand Down
8 changes: 4 additions & 4 deletions lua/weapons/gmod_tool/stools/trackassembly.lua
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ end
function TOOL:GetStatus(stTrace,anyMessage,hdEnt)
local sDelim = "\n"
local iCurLog = asmlib.GetOpVar("LOG_CURLOGS")
local iFleLog = asmlib.GetOpVar("LOG_LOGFILE")
local sFleLog = asmlib.GetOpVar("LOG_LOGFILE")
local iMaxlog = asmlib.GetOpVar("LOG_MAXLOGS")
local sSpace = stringRep(" ",6 + stringLen(tostring(iMaxlog)))
local ply = self:GetOwner()
Expand All @@ -347,9 +347,9 @@ function TOOL:GetStatus(stTrace,anyMessage,hdEnt)
local sDu = ""
sDu = sDu..tostring(anyMessage)..sDelim
sDu = sDu..sSpace.."Dumping logs state:"..sDelim
sDu = sDu..sSpace.." MaxLogs: <"..tostring(iMaxlog)..">"..sDelim
sDu = sDu..sSpace.." CurLogs: <"..tostring(iCurLog)..">"..sDelim
sDu = sDu..sSpace.." iFleLog: <"..tostring(iFleLog)..">"..sDelim
sDu = sDu..sSpace.." LogsMax: <"..tostring(iMaxlog)..">"..sDelim

This comment has been minimized.

Copy link
@dvdvideo1234

dvdvideo1234 Mar 29, 2016

Author Owner

Let it print the state of the log too.

sDu = sDu..sSpace.." LogsCur: <"..tostring(iCurLog)..">"..sDelim
sDu = sDu..sSpace.." LogFile: <"..tostring(sFleLog)..">"..sDelim
sDu = sDu..sSpace.."Dumping player keys:"..sDelim
sDu = sDu..sSpace.." Player: "..stringGsub(tostring(ply),"Player%s","")..sDelim
sDu = sDu..sSpace.." IN.USE: <"..tostring(plyKeys["USE"])..">"..sDelim
Expand Down

0 comments on commit a7f4e71

Please sign in to comment.