• Nil printing in the console for no reasons
    11 replies, posted
Hello everybody, I have a strange problem with a gamemode I'm working on, each time I run it, it prints nil 4 times in the console (2 serverside and 2 clientside), like this: [img]http://imageshack.com/a/img534/6985/6i68.jpg[/img] The thing is that I never use the print, Msg or PrintTable functions in my codes. What can actually cause this please? Thanks!
An addon you have installed does this.
I unistalled the two addons I had and it still prints the 4 nils in the console, and only with my gamemode.
Then it must be something in your gamemode remove parts of your code at a time and find out what causes it.
Wow that was a huge bug, it was because of commentaries in my player class, I never thought it commentaries could do that kind of stuff. Because I already done what you said and it didn't change anything, because I didn't thought about commentaries. Thanks!
Look for all instances of MsgC ( which will cover the cyan output ) Look for all instances of print ( This should cover the white, if not then it's the MsgC ) The default delimiter separator for arguments in print is \t - tabular = ~ 5 spaces, which is what's seen on both the cyan and white text. It may help to look for all instances of \t if it is in MsgC.
[QUOTE=Lyc@n;43898629]Wow that was a huge bug, it was because of commentaries in my player class, I never thought it commentaries could do that kind of stuff. Because I already done what you said and it didn't change anything, because I didn't thought about commentaries. Thanks![/QUOTE] Post whatever caused it. [QUOTE=Acecool;43898718]Look for all instances of MsgC ( which will cover the cyan output ) Look for all instances of print ( This should cover the white, if not then it's the MsgC ) The default delimiter separator for arguments in print is \t - tabular = ~ 5 spaces, which is what's seen on both the cyan and white text. It may help to look for all instances of \t if it is in MsgC.[/QUOTE] You are like totally wrong there. It's logically is print, somewhere in autorun/loaded when server starts.
No that was nothing I've just done a big mistake, I wanted to put a code as commentary with npp with Ctrl+Q but there was some print that were already commentaries so npp removed the "--" before them. I just didn't saw it, I seriously don't know how I didn't saw that! But thank you anyway and please excuse me for this mistake.
[QUOTE=Robotboy655;43898804]You are like totally wrong there. It's logically is print, somewhere in autorun/loaded when server starts.[/QUOTE] Where did I say it is not print? I said the default delimiter for multiple arguments when using print is a tab; he has nil\tnil being output. That's why I said look for all instances of print being called, with two arguments. Next, for the colored text, I suggested he look for MsgC. If you were to use print( "nil", "nil" ); or print( other_testing_var, testing_var ); you'd have that exact white-text output; but for the colored output, you'd need MsgC. He was confused at where to start looking, I simply provided two function names, and information about them, to help him find what he was looking for based on what I saw in the console output; it wouldn't matter when it happened whether during server start-up, running, or shut-down -- he could still use notepad++ to search all files for print( and MsgC( ..
[QUOTE=Acecool;43899286]Where did I say it is not print? I said the default delimiter for multiple arguments when using print is a tab; he has nil\tnil being output. That's why I said look for all instances of print being called, with two arguments. Next, for the colored text, I suggested he look for MsgC. If you were to use print( "nil", "nil" ); or print( other_testing_var, testing_var ); you'd have that exact white-text output; but for the colored output, you'd need MsgC. He was confused at where to start looking, I simply provided two function names, and information about them, to help him find what he was looking for based on what I saw in the console output; it wouldn't matter when it happened whether during server start-up, running, or shut-down -- he could still use notepad++ to search all files for print( and MsgC( ..[/QUOTE] All 4 "nil"s are coloured and presumably output from a shared file. print() doesn't output white text.
[QUOTE=Acecool;43899286]Where did I say it is not print? I said the default delimiter for multiple arguments when using print is a tab; he has nil\tnil being output. That's why I said look for all instances of print being called, with two arguments. Next, for the colored text, I suggested he look for MsgC. If you were to use print( "nil", "nil" ); or print( other_testing_var, testing_var ); you'd have that exact white-text output; but for the colored output, you'd need MsgC. He was confused at where to start looking, I simply provided two function names, and information about them, to help him find what he was looking for based on what I saw in the console output; it wouldn't matter when it happened whether during server start-up, running, or shut-down -- he could still use notepad++ to search all files for print( and MsgC( ..[/QUOTE] print is colored text, it will never print in white. It will print cyan on server and yellow on client. That's where you are wrong. I don't think you realize, but there are no white text saying "nil nil", it's yellow and cyan. He wan't confused, as he has already posted that he fixed the problem before you posted. [editline]13th February 2014[/editline] Damn you Willox :v:
[QUOTE=Robotboy655;43899364]print is colored text, it will never print in white. It will print cyan on server and yellow on client. That's where you are wrong. I don't think you realize, but there are no white text saying "nil nil", it's yellow and cyan. He wan't confused, as he has already posted that he fixed the problem before you posted. [editline]13th February 2014[/editline] Damn you Willox :v:[/QUOTE] [QUOTE=Willox;43899359]All 4 "nil"s are coloured and presumably output from a shared file. print() doesn't output white text.[/QUOTE] Whoops, my bad. I haven't used default print in so long I forgot about the colors... I print everything in white except for certain other elements. [lua]PRINT_COLORS = { Angle = COLOR_WHITE; -- Boolean = COLOR_WHITE; -- Color = nil; -- This actually uses the COLOR of the element, instead of a set color. DamageInfo = COLOR_WHITE; -- EffectData = COLOR_WHITE; -- Entity = COLOR_WHITE; -- Function = COLOR_WHITE; -- LuaEmitter = COLOR_WHITE; -- LuaParticle = COLOR_WHITE; -- Material = COLOR_WHITE; -- MoveData = COLOR_WHITE; -- Number = COLOR_WHITE; -- Panel = COLOR_WHITE; -- Player = COLOR_WHITE; -- RecipientFilter = COLOR_WHITE; -- SoundPatch = COLOR_WHITE; -- String = COLOR_WHITE; -- StringLanguage = COLOR_CYAN; StringLanguageF = COLOR_RED; Table = COLOR_WHITE; -- ToString = COLOR_GRAY; -- Texture = COLOR_WHITE; -- UserCmd = COLOR_WHITE; -- Vector = COLOR_WHITE; -- VMatrix = COLOR_WHITE; -- };[/lua]
Sorry, you need to Log In to post a reply to this thread.