Skip to content

Game Types

Knoxed edited this page Apr 11, 2020 · 7 revisions

Lambda comes with a few default gametypes but it also offers the ability to define a custom game type, this allows you to create your own campaign with the framework.

Structure

A game type typically describes a list of maps in which order the maps are played. There are also a bunch of tables where you can control many aspects such as invincible NPCs per name or class, round rules, enemy classes, etc.

Name Description
Name Gametype name (string)
Base Base gametype (string)
MapScript Mapscript data (table)
MapList A table with the gametype maplist (table)
PlayerSpawnClass Entity class for spawning players (string)
UsingCheckpoints Checkpoint based gametype (boolean)
WaitForPlayers Game starts when everyone is fully joined (boolean)
ClassesEnemyNPC A list of enemy NPCs (table)
ImportantPlayerNPCNames A list of important NPC names (table)
ImportantPlayerNPCClasses A list of important NPC classes (table)
Settings A list of settings available in the gametype (table)
* CampaignNames A list of campaign titles (table)

*Not included in gametype_base

Functions/Hooks

Game type provides us with some hooks to work with.

Name Description
GetPlayerRespawnTime() Returns the player respawn time set by gametype setting
ShouldRestartRound() If the game should restart the round
PlayerCanPickupWeapon(ply, wep) GM:PlayerCanPickupWeapon
PlayerCanPickupItem(ply, item) GM:PlayerCanPickupItem
GetWeaponRespawnTime() Returns the weapon respawn time setting
GetItemRespawnTime() Returns the item respawn time set by setting
ShouldRespawnWeapon(ent) If the game should respawn a weapon
PlayerDeath(ply, inflictor, attacker) GM:PlayerDeath
PlayerShouldTakeDamage(ply, attacker, inflictor) GM:PlayerShouldTakeDamage
CanPlayerSpawn(ply, spawn) Return if player can spawn
ShouldRespawnItem(ent) If the game should repawn an item
GetPlayerLoadout() Gets the players loadout
LoadMapScript(path, name) Loads the mapscript
AllowPlayerTracking() See other players through walls
IsPlayerEnemy(ply1, ply2) Is a player enemy to a player
GetDifficultyData() Return difficulty metrics
InitSettings() Initialize gametype settings
GetScoreboardInfo() Set gametype defined information to show on scoreboard

Examples & Setting up

Official gametypes are located in Lambda/gamemode/gametypes along with it's mapscripts as can be seen here.

Custom created gametypes can be added through addons. Here is an example addon setup for a gametype.

Clone this wiki locally