Create a Garry's Mod TTT Rewrite with focus on clientside customization, extendability and ease of modding.
The base TTT gamemode has long been overdue for a complete overhaul, with the lack of customization and lack of proper features such as prediction on weapons (properly and done right) as well as the growing demand for customizing roles.
- This gamemode is completely written from the ground up with a small amount of developers, making it easy to read and section off code properly.
- Having a role system allows developers to add their own roles with own logic and new teams and have role selection be all overwritten easily and maintainably.
- Clientside customization.
- Built for performance around x64 branch of Garry's Mod.
use this to set up custom teams and roles. see: sh_roles.lua
use this to set up who sees what role in custom teams and roles. see: sh_roles.lua
adds a multiplier to player speed
add a entry to data
with a value of a multiplier to change the speed of the player.
hook.Add("TTTUpdatePlayerSpeed", "slow_down", function(ply, data)
local sloweduntil = ply:GetSlowedUntil()
if (sloweduntil > CurTime() and ply:GetSlowedStart() < CurTime()) then
data.SlowMultiplier = 0.5
end
end)
TTTGetHiddenPlayerVariables
(variable_list
) -> no value
adds hidden variables for players that are predicted, adds accessors Player.Get and Set
calls hook OnPlayer<Name>Change
(ply
, old value
, new value
)
hook.Add("TTTGetHiddenPlayerVariables", "slowed_value", function(vars)
table.insert(vars, {
Name = "SlowedUntil",
Type = "Float",
Default = -math.huge
})
table.insert(vars, {
Name = "SlowedStart",
Type = "Float",
Default = -math.huge
})
end)
todo: document (variables = tabs in the body menu)
todo
todo
see: TTTPrepareNetworkingVariables
internal, do not use
todo
hook.Add("TTTPrepareNetworkingVariables", "RoundState", function(vars)
table.insert(vars, {
Name = "RoundState",
Type = "Int",
Enums = {
Ended = 0,
Preparing = 1,
Active = 2,
Waiting = 3
},
Default = 3
})
end)
called in SWEP:SetupDatatables
hook.Add("TTTInitWeaponNetVars", "example", function(e)
e:NetVar("HowCool", "Int", 0)
end)
called in SWEP:Initialize
todo
fake:NetworkVar("Karma", "Int")
TTTRWPlayerInspectBody
(ply
, body
, pos
, hidden
)
called when player looks at a different player
passed to second argument of game.CleanupMap
called in HUDPaint
called in HUDPaint
called in HUDPaintBackground
just adds it via game_event to client for ease
just adds it via game_event to client for ease
just adds it via game_event to client for ease
just adds it via game_event to client for ease
just adds it via game_event to client for ease
just adds it via game_event to client for ease
just adds it via game_event to client for ease
just adds it via game_event to client for ease
listener hook only
listener hook only
todo: document
returns if round should start