I knew it would take a while to hunt them all down, and I knew I would still be making more of them while working on the last couple levels, so I set up the following script to handle it much more neatly:
script entity called pr
Code: Select all
printON = true
function nt(m1,m2,m3,m4)
if printON then
if m2 == nil and m3 == nil and m4 == nil then print(m1)
elseif m3 == nil and m4 == nil then print(m1,m2)
elseif m4 == nil then print(m1,m2,m3)
else print(m1,m2,m3,m4)
end
end
end
pr.nt("Debug texts are ON")
------------------------------------
-- this function and variable are for console printing. If
-- printON is true then all the console debug text will
-- print during play. Turn this to false before final release.
-- In scripts in the dungeon I might have a line like:
-- pr.nt("blah blah blah")pr.nt(my_table, variable1.." is not the way", suchTimer.x, suchTimer.y)
I've converted all my "print" to "pr.nt" by doing a big 'ol search and replace in the dungeon.lua, and voila, now it works great, and I can leave them on for the beta-testers and then just turn em off at public release time by editing "printON = true" to "printON = false"
