gamemode files do not initiate when launching gamemode

for some reason init.lua does NOT open automatically when I host my gamemode from listen server (i have to do lua_openscript)
I don’t think shared or cl does either for some reason
the path to those files is is garrysmod/garrysmod/gamemodes/AntlionSurvival/gamemode/init.lua and shared.lua and cl_init.lua

im pretty sure everyone in WDYNHW is sick of you always posting your errors without any thought to debug them yourself, but moving on.

im going to work under the assumption that this is for gmod 13 (being less than a fortnight away).

in your gamemodes/AntlionSurvival you need a text document named the same thing (AntlionSurvival) im not sure if its case sensitive so if it doesnt work straight away, just mess around with the case.

the contents of the text document is keyvalues for, well the values of your gamemode.

something like:



"antlionsurvival"
{
	"title"		"Antlion Survival"
	"base"	"base" // or sandbox
}


im willing to be you already have this, and im assuming that the gamemode actually shows up in servers, but in the off chance that its wrong theres “A” solution.

if its not, we will need more information about the problem (errors in the console etc)

Honestly though, do you ever try to debug? Or at least, learn the basics of lua. I doubt no less than 50% of the pages on WDYNHW have you complaining about an lua error you’ve made no attempt to fix. Programming is about creating, and fixing both broken code, and mistakes. If you have no intention of debugging, then just quit right now.

i tried to debug and i know the basics of lua? i made teams, hooks, math.randoms for file names, functions, concommands and other general basic stuff

i’m not bragging (that would be very stupid) im just trying to tell you i know the basics of lua now

also function GAMEMODE:LuaCode( ver )
ver:gmod.version(math.random( 10, 13 ))

output: 12

Why would you want random file names?

[

i meant for death sounds and hurt sounds

function GAMEMODE:PlayerDeath( ply )
	ply:EmitSound(Sound("npc/combine_soldier/die" .. math.random(1, 3) .. ".wav"), 500, 100)
end
hook.Add( "PlayerDeath", "plydeath", Death )

function GAMEMODE:PlayerHurt( ply )
	ply:EmitSound(Sound("npc/combine_soldier/pain" .. math.random(1, 3) .. ".wav"), 500, 100)
end
hook.Add( "PlayerHurt", "plyhurt", Hurt )

ci?

[editline]10th October 2012[/editline]

btw for some reason when using GM:afunctionorwhatevergoeshere i get some kind of nil value error, which is why i use GAMEMODE:afunctionorwhatevergoeshere instead.

also ill start working on this gamemode for gm 13 soon

already dumbed?

[editline]10th October 2012[/editline]

solution did not work @G4MB!T

Oh, for sounds.

Uh, what is the purpose of the hook.Add’s? ‘Death’ and ‘Hurt’ aren’t defined.

um i was kinda taught that way with player inital spawn i guess i should remove that…
also by ending a function for some reason lots of the time i get the error i hate most of all errors, THIS:’<eof>’ expected near ‘end’

END OF FILE IS DEFINED STUPID LUA

function 
ply:Kill()
	ply:PrintMessage( HUD_PRINTTALK, "Please set your team with team_1 or team_5 or inbetween. team_1 = default, team_2 ar2, team_3 = shotgun, team_4 = 357 team 5 = scout, team 6 = heavy., " .. ply:Nick() .. "!" )
	end
 

please ignore the totally stupid unfinshed function, its random because im testing. but seriously, this file is correctly ended, right?

That <eof> near end error means that there too many/little ends.

Also what’s that function there for? Aren’t you going to add a hook for initialspawn and put that in the function?

Maybe you should refer to the gmod wiki before asking basic questions.