init.lua and modifying Default Terrortown files

Post Reply
Vexas
New to forums
New to forums
Posts: 5
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sun May 19, 2013 3:46 pm

init.lua and modifying Default Terrortown files

Post by Vexas »

Hey there, I had a long conversation with support which boiled down to this:

I have a modified init.lua (located in /garrysmod/gamemodes/terrortown/gamemode). The default init.lua was deleted, moved, and hidden in a different folder. The edited init.lua has been moved and replaced. However, when there is no init.lua present, the server will not start in gamemode Terrortown (so it obviously has some impact).

The issue here is that the server is loading the default init.lua when it is not even on the server- only the modified one is.

Thanks in advance.
User avatar
Spray
Former staff
Former staff
Posts: 630
Joined: Wed Dec 28, 2011 10:41 pm
Location: Oregon

Re: init.lua and modifying Default Terrortown files

Post by Spray »

Out of curiosity, how are you confirming that the default init.lua is the one being loaded?
User avatar
Edge100x
Founder
Founder
Posts: 12945
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: init.lua and modifying Default Terrortown files

Post by Edge100x »

What you see in the server's FTP is exactly what it's run from. If Garrysmod is somehow still loading the file when it is missing, then it must be somewhere else in the directory structure, or built-in in some way.
Vexas
New to forums
New to forums
Posts: 5
Joined: Sun May 19, 2013 3:46 pm

Re: init.lua and modifying Default Terrortown files

Post by Vexas »

I added a print function to the code, and does NFO superimpose any default game mode files on the server?
User avatar
Edge100x
Founder
Founder
Posts: 12945
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: init.lua and modifying Default Terrortown files

Post by Edge100x »

I'm not sure what you mean when you say superimpose. What you see in the FTP is what exists on disk, though, as I mentioned -- there are no other files.
User avatar
Spray
Former staff
Former staff
Posts: 630
Joined: Wed Dec 28, 2011 10:41 pm
Location: Oregon

Re: init.lua and modifying Default Terrortown files

Post by Spray »

If I understand correctly, when you have your modified init.lua placed in /garrysmod/gamemodes/terrortown/gamemode, the server is still loading the init.lua that is not present?

I would check the includes in your modified init.lua to make sure it loading anything that isn't intended.
Vexas
New to forums
New to forums
Posts: 5
Joined: Sun May 19, 2013 3:46 pm

Re: init.lua and modifying Default Terrortown files

Post by Vexas »

So then why is TTT loading a nonexistent init.lua?

Not sure what you mean spray.
User avatar
Spray
Former staff
Former staff
Posts: 630
Joined: Wed Dec 28, 2011 10:41 pm
Location: Oregon

Re: init.lua and modifying Default Terrortown files

Post by Spray »

Vexas wrote:So then why is TTT loading a nonexistent init.lua?

Not sure what you mean spray.
Sorry, I meant to say: I would check the includes in your modified init.lua to make sure it's not loading anything that isn't intended.

Is the init.lua script you've modified very different from the original?
User avatar
Edge100x
Founder
Founder
Posts: 12945
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: init.lua and modifying Default Terrortown files

Post by Edge100x »

There are a few possibilities.
  • There's another copy of the file somewhere in the directory tree that the game is automatically loading.
  • Another file is loaded automatically when init.lua is missing, or in addition to the init.lua file, and it does something similar.
  • The game essentially has a built-in init.lua that it uses if one isn't found, or before one is loaded.
Vexas
New to forums
New to forums
Posts: 5
Joined: Sun May 19, 2013 3:46 pm

Re: init.lua and modifying Default Terrortown files

Post by Vexas »

Other people have gotten the same file I'm using to work.
User avatar
Edge100x
Founder
Founder
Posts: 12945
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: init.lua and modifying Default Terrortown files

Post by Edge100x »

In that case, you're missing something, but I don't know what (and what I said about the problem's source still applies). Someone more familiar with what you're trying to do might be able to help more than I.

I just wanted to be clear that whatever is going on would not be due to our version of the files, since we just use the standard gmod distribution and you can see all of the files through the FTP.
Vexas
New to forums
New to forums
Posts: 5
Joined: Sun May 19, 2013 3:46 pm

Re: init.lua and modifying Default Terrortown files

Post by Vexas »

anyone else know where an init.lua would be found?
User avatar
ThatGuyNex
This is my homepage
This is my homepage
Posts: 239
Joined: Tue May 28, 2013 12:23 pm

Re: init.lua and modifying Default Terrortown files

Post by ThatGuyNex »

If you would be so kind as to post the file in question I can take a look. I have a feeling that your modified file is in fact the one being loaded though. There are two types of lua files with garrysmod, those that are being run on the server, and those that are being run on the client (and technically those that run on both, but those are mainly files containing functions and declarations). Init.lua is the file that gets automatically loaded on the server end of things, as such, the standard print function would only be available if you were looking directly at the console. However, if you add -condebug to your launch parameters it will dump all console output into the console.log text file.

Edit: Also I would use this function instead of print for debugging lines:

Code: Select all

MsgN("message")
Fscreams
A semi-regular
A semi-regular
Posts: 21
Joined: Mon May 27, 2013 10:49 pm

Re: init.lua and modifying Default Terrortown files

Post by Fscreams »

Garrysmod comes with TTT by default - If you want a NEW file, go here

https://github.com/garrynewman/garrysmo ... terrortown

That has all the default TTT files that comes with gmod, and it even shows the file path the file should be put in.

So - Copy and paste the ini file from there, and just put it in the server.
Post Reply