All Projects → danielga → garrysmod_common

danielga / garrysmod_common

Licence: other
A repository of common bits for compilation projects based on Garry's Mod.

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
lua
6591 projects
powershell
5483 projects
shell
77523 projects

Projects that are alternatives of or similar to garrysmod common

gm luaerror
A module for Garry's Mod that adds hooks for obtaining errors that happen on the client and server (if activated on server, it also pushes errors from clients).
Stars: ✭ 35 (-53.95%)
Mutual labels:  gmod, garrys-mod, garrysmod, garrysmod-module, gmod-module
gmod luasocket
Modules for Garry's Mod that add bindings for OS sockets through luasocket.
Stars: ✭ 21 (-72.37%)
Mutual labels:  gmod, garrys-mod, garrysmod, garrysmod-module, gmod-module
sourcesdk-minimal
A compact and Garry's Mod compatible SourceSDK (don't use in other Source engine games).
Stars: ✭ 34 (-55.26%)
Mutual labels:  gmod, garrys-mod, garrysmod, garrysmod-module, gmod-module
Half-Life-Resurgence
Recreation & expansion of NPCs, entities, and weapons from the Half-Life series into Garry's Mod!
Stars: ✭ 52 (-31.58%)
Mutual labels:  gmod, garrys-mod, garrysmod
Autorun-rs
Undetectable scripthook with lua execution and filesteal. Modern replacement for gluasteal and most lua executors
Stars: ✭ 63 (-17.11%)
Mutual labels:  gmod, garrys-mod, garrysmod
BadCoderz
Find unoptimized gmod addons and KILL the devs who made them
Stars: ✭ 66 (-13.16%)
Mutual labels:  gmod, garrys-mod, garrysmod
Fun
Small fun scripts
Stars: ✭ 22 (-71.05%)
Mutual labels:  gmod, garrys-mod, garrysmod
TrackAssemblyTool
A Garry's mod tool for assembing a prop-segmented track
Stars: ✭ 17 (-77.63%)
Mutual labels:  garrys-mod, garrysmod
VJ-Base
An addon for Garry's mod that contains bunch of bases to make many different types of addons.
Stars: ✭ 57 (-25%)
Mutual labels:  gmod, garrysmod
zombie-escape
🏃 Gamemode for Garry's Mod based on the popular Counter-Strike: Source server mod
Stars: ✭ 17 (-77.63%)
Mutual labels:  gmod, garrysmod
3D2D-Textscreens
3D2D Textscreens Garry's Mod Workshop Addon
Stars: ✭ 26 (-65.79%)
Mutual labels:  gmod, garrysmod
helix
A Garry's Mod roleplaying framework developed by nebulous for the people. Helix IS open-source - the code can be used as you wish.
Stars: ✭ 123 (+61.84%)
Mutual labels:  gmod, garrysmod
XPGUI
A modern VGUI framework.
Stars: ✭ 15 (-80.26%)
Mutual labels:  gmod, garrysmod
gmod-medialib
Media playback library for Garry's Mod.
Stars: ✭ 28 (-63.16%)
Mutual labels:  gmod, garrys-mod
glua-docs
🔍 Quick documentation lookup for Garry's Mod Lua
Stars: ✭ 14 (-81.58%)
Mutual labels:  gmod, garrysmod
ACF-3
ACF
Stars: ✭ 37 (-51.32%)
Mutual labels:  gmod, garrysmod
gmodws
GMPublish functionality without graphical steam
Stars: ✭ 23 (-69.74%)
Mutual labels:  gmod
map-compiling-toolkit
Tools for map compiling in Source Engine, tailored for Garry's Mod (and metastruct, sorry)
Stars: ✭ 17 (-77.63%)
Mutual labels:  gmod
3d2d-imgui
Immediate mode 3D2D UI for Garry's Mod
Stars: ✭ 41 (-46.05%)
Mutual labels:  gmod
Pointshop2
Next-Gen Garrysmod shop system https://discord.gg/N9DmwwX
Stars: ✭ 37 (-51.32%)
Mutual labels:  gmod

garrysmod_common

A repository of common bits for compilation projects based on Garry's Mod.

The include directory has all the required headers for building modules for Garry's Mod (LuaJIT and Garry's Mod headers) with C++.

There's common code for premake on the premake directory for faster development. premake5 is required to generate projects.

Warning

As a rule of thumb, avoid diverging too much from these rules:

  • On Windows, compile with Visual Studio 2015, Visual Studio 2017 or Visual Studio 2019.
  • On Linux, use GCC (the more up to date, the better, tested up to GCC 9, older versions like GCC 4 and GCC 5 might throw C++ compilation errors).
  • On macOS, any Xcode (using the GCC compiler) version MIGHT work.

Do not use internal classes/structures (like the GameDepot::System class or the IGamemodeSystem::Information structure) unless (these rules are in addition to the previous ones):

  • On Windows and Linux, compile in release mode.
  • On macOS, use the Mac OSX 10.7 SDK, in release mode.

These restrictions are not random; they exist because of ABI compatibility reasons.

If stuff starts erroring or fails to work, be sure to check the correct line endings (\n and such) are present in the files for each OS.

Usage

In your project's premake5.lua (or whatever you named it) you should include your local copy of this repository, for example:

PROJECT_GENERATOR_VERSION = 2

newoption({
    trigger = "gmcommon",
    description = "Sets the path to the garrysmod_common (https://github.com/danielga/garrysmod_common) directory",
    value = "path to garrysmod_common directory"
})

local gmcommon = assert(_OPTIONS.gmcommon or os.getenv("GARRYSMOD_COMMON"),
	"you didn't provide a path to your garrysmod_common (https://github.com/danielga/garrysmod_common) directory")
include(gmcommon)

Creates the workspace with the provided workspace_name, optional workspace_add_debug for including a debug compilation mode (default is true) and optional workspace_path for files (can also be set by premake option (--workspace=path) and by default uses the value in the config file). Must be called at least once before the following functions.

CreateWorkspace({
    name = workspace_name,
    allow_debug = workspace_add_debug, -- optional
    path = workspace_path -- optional
})

Creates the project for the provided state on project_serverside (it's a boolean), optional project_manual_files (allows you to add the source/header files manually through the function files and default is false) and optional project_source_path for source files path (can also be set by premake option --source=path and by default uses the value in the config file, but beware it will be used by all projects).

CreateProject({
    serverside = project_serverside,
    manual_files = project_manual_files, -- optional
    source_path = project_source_path -- optional
})

Call the following functions as needed. The Source SDK based projects do not need a path to the SDK anymore, as it is provided through this git repository as a submodule.

IncludeLuaShared() -- uses this repo path
IncludeDetouring() -- uses this repo detouring submodule
IncludeScanning() -- uses this repo scanning submodule

IncludeSDKCommon()
IncludeSDKTier0()
IncludeSDKTier1()
IncludeSDKTier2()
IncludeSDKTier3()
IncludeSDKMathlib()
IncludeSDKRaytrace()
IncludeSteamAPI()

You can also request the project to auto-install the compiled files to a directory selected by you or automatically found on your system. Use one of the following:

  • Append the --autoinstall flag to your command to either use the GARRYSMOD_LUA_BIN environment var, automatic path finder or the DEFAULT_GARRYSMOD_LUA_BIN_DIRECTORY config (which you have to define yourself in config.lua).
  • Append the --autoinstall=path config to your command to use the path you want.

Using specific MacOSX SDKs is also supported, by using either the premake config --macosx_sdkroot or the preferred SDKROOT environment variable when calling make.

Relevant URLs

https://github.com/ValveSoftware/source-sdk-2013
https://github.com/danielga/sourcesdk-minimal

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].