Where To Start With Multiplayer Gamemode

Just discovered lua and using it to make game modes in gmod. I know some actionscript which looks similar to lua so I can kind of wrap my brain around the programming language. I just have a few questions about work flow. How can I develop a multiplayer game by myself? The system doesn’t seem to have very functional bots to work with. I want a simple team deathmatch base, but i can’t code and determine if everything works without having other players to start the round and compete against.

So how do most of you pros go about developing a mp game mode.
Also, do I have to restart gmod completely before I can modify code and see the changes?

Sorry if these are complete n00b questions, gotta start somewhere right?

I know the answer to your last question.
You do not have to restart your whole GMod to see if a change worked.
You just type gamemode_reload or gamemode_reload_cl in console.
Not sure which one you need.

That is awesome. Does anyone know of a good team deathmatch base I can download and start modifying?

Sandbox

Copy and paste sandbox, rename the folder and begin to modify some functions and add some teams.

Base gamemode is actually much easier to work with when your new as its much simpler also I suggest OP uses this as a reference

And this.

Yea, I’ve been in and out of wiki.garrysmod.com, starting to grasp the concepts. I tried the gamemode_reload and gamemode_reload_cl it appears to do nothing. I populate the other teams with bots, but they are quite useless as I’m sure most of you know.

So new questions. How can I use the ak47 from CS:S or any CS:S weapon and how could I use my SWEPs in my gamemode? I used the simple fretta deathmatch base that garry provides in the wiki.garrysmod.com tutorials. From what I can tell the player loadout is in a file called “Deathmatchers” in a folder called player_class. The code looks like this

"local CLASS = {}

CLASS.DisplayName = “Deathmatcher”
CLASS.WalkSpeed = 230
CLASS.CrouchedWalkSpeed = 0.2
CLASS.RunSpeed = 400
CLASS.DuckSpeed = 0.2
CLASS.DrawTeamRing = false

function CLASS:Loadout( pl )

pl:GiveAmmo( 20, "Buckshot" )
pl:GiveAmmo( 400, "SMG1" )
pl:GiveAmmo( 50, "pistol" )

pl:Give( "weapon_pistol" )
pl:Give( "weapon_shotgun" )
pl:Give( "weapon_smg1" )
pl:Give( "item_ar2_grenade" )

end

player_class.Register( “Deathmatcher”, CLASS )"

I assume all I need to do is replace “Weapon_smg1” with the appropriate code, but I don’t know where those codes are. I’m sure there is probably a list of all weapons and their associated codes, but haven’t found one yet.

Use [lua] tags next time :wink:
[lua]"local CLASS = {}

CLASS.DisplayName = “Deathmatcher”
CLASS.WalkSpeed = 230
CLASS.CrouchedWalkSpeed = 0.2
CLASS.RunSpeed = 400
CLASS.DuckSpeed = 0.2
CLASS.DrawTeamRing = false

function CLASS:Loadout( pl )

pl:GiveAmmo( 20, "Buckshot" )
pl:GiveAmmo( 400, "SMG1" )
pl:GiveAmmo( 50, "pistol" )

pl:Give( "weapon_pistol" )
pl:Give( "weapon_shotgun" )
pl:Give( "weapon_smg1" )
pl:Give( "item_ar2_grenade" )

end[/lua]

Thanks, didn’t know bout the lua tag, wont make that mistake again. I’ve got all the questions answered that I had so far. Will report back with more probably lol

New questions. I want to attach different player models to different teams, for now, using the counter-terrorist and terrorist models would be fine. But where do I insert that on the player_class files? and would it be [lua]pl:SetModel(“models/humans/Group03/male_01.mdl”)[/lua]

Also, gamemode_reload or gamemode_reload_cl still isn’t resetting the game mode with changes. It appears to do nothing, as of now, I’m loading the game, figuring out what I need to tweak, and verifying recent changes disconnecting then editing lua and restarting a server, any more efficient way to do this?

You should get this lua_reloadent it can reload and entity, tool or weapon, and even load a new one as long as it’s in a recognized directory. Also for single files use lua_openscript for server files, and lua_openscript_cl for client files. I always just use reload in the console and wait for the map to reload when I change the gamemode files, just encase I changed the name of something, so it won’t be loaded twice.

EDIT:
Just re-read your post, and I don’t think lua_reloadent works on servers, I dev mostly in singleplayer then move to the server when things are looking good. Hope something there helps.

Well, it just says server. I don’t know if it technically is. I just start the game in multiplayer. would it work better if I started it in singleplayer? Can I add bots to populate the other teams. and on that subject, can I get bots that are similar to the bots premade in CS:S?

[editline]30th May 2011[/editline]

starting in single player didn’t help… any advice on models?