• Problems with custom gamemode
    5 replies, posted
These last days I started coding a bit and started creating a gamemode. I have encountered some problems but there is a major problem that I have yet to find a solution to. Here's my 3 files: init.lua : [code]AddCSLuaFile( "cl_init.lua" ) include('shared.lua')[/code] cl_init.lua : [code]include('init.lua')[/code] shared.lua : [code]DeriveGamemode("sandbox") GM.Name = "BuildWar" function GM:Initialize() end[/code] gamemode file : [code]"BuildWar" { "base" "sandbox" "title" "BuildWar" "author" "CA" }[/code] When I load the gamemode and I join, I can't use the spawn menu, my physgun is black and my tool gun is broken. Why is it doing that even tho the gamemode is derived from sandbox? [editline]16th June 2014[/editline] Just realized I don't need to include init.lua in cl_init, but it still does the same problem.
Try change "base" "sandbox" on "base" "base" in gamemode file
Still have the same problem.
You never AddCSLuaFile'd the shared file, I believe this is the issue. Also include shared.lua not init.lua in the clientside script.
Here's a skeleton game-mode; it is set up to recursively include all files in client, shared, server and content/maps/<map_name>/ [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_redistributable/basedev_gamemode.rar[/url] It uses the principles described here to let shared load it all: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/loading_files_across_realms.lua.html[/url] Hopefully it helps.
[QUOTE=Acecool;45117380]Here's a skeleton game-mode; it is set up to recursively include all files in client, shared, server and content/maps/<map_name>/ [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_redistributable/basedev_gamemode.rar[/url] It uses the principles described here to let shared load it all: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/loading_files_across_realms.lua.html[/url] Hopefully it helps.[/QUOTE] Thank you very much for helping me, you fixed my problem. I still don't know what was wrong with the gamemode but now it's working so w/e,
Sorry, you need to Log In to post a reply to this thread.