• Testing Gamemode
    7 replies, posted
I have started to create a gmod gamemode and have made all the essential files eg. init , cl_init, shared. I want to test this gamemode out but when I launch garry's mod I cannot start a game with this gamemode. Would I have to create a dedicated server to test it out?
Did you add [URL="http://wiki.garrysmod.com/page/Gamemode_Creation"]"menusystem" "1" to the gamemode txt[/URL] file? [code] "gamemode" { "base" "base" "title" "Your gamemode name" "maps" "^dm_" "menusystem" "1" } [/code] This should be in a file named after your gamemode , inside of the gamemode folder itself ( garrysmod/gamemodes/yourgamemodename/ ) After that your gamemode should appear on the bottom right of the menu ready to be tested, otherwise try to use "gamemode yourgamemodename" in the console if it doesn't work, and change level.
Yeah I'm sure I've done everything still not working though ctf.txt [CODE]"Capture the flag" { "base" "base" "title" "Capture the flag" "maps" "ctf_" "menusystem" "1" "settings" { } }[/CODE] init.lua [CODE]AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") function PlayerInitialSpawn(ply) ply:SetGravity(0.8) ply:SetWalkSpeed(0.8) ply:SetRunSpeed(0.8) end[/CODE] cl_init.lua [CODE]include("shared.lua")[/CODE] Shared.lua [CODE]GM.Name = "CTF" GM.Author = "N/A" GM.Email = "N/A" GM.Website = "N/A" [/CODE]
It's function GM:PlayerInitialSpawn(ply) not function PlayerInitialSpawn(ply), and you must define GM:Initialize on both, client and server( or in shared ) See [url]http://wiki.garrysmod.com/page/Gamemode_Creation[/url]
Also you need to call DeriveGamemode( "base" ) in shared.lua
[QUOTE=Jvs;45833753]Also you need to call DeriveGamemode( "base" ) in shared.lua[/QUOTE] I don't think that's true.
Okay I did everything and it still didn't work. I then proceeded to copy the garrysmod wiki for the gamemode creation there and it still didn't appear in the menu.
your gamemode folder must not contain upper case symbols or spaces.
Sorry, you need to Log In to post a reply to this thread.