Difference between revisions of "Category:Utility functions"

From Fortress Forever Wiki
Jump to navigationJump to search
m
Line 1: Line 1:
 
{{Infobox manual/Header}}
 
{{Infobox manual/Header}}
 
{{Infobox mapping}}
 
{{Infobox mapping}}
These lua functions are useful for getting your scripts working.
+
These global functions are useful for getting your scripts working.
{| border="0" cellspacing="0"
+
{| border="1" cellspacing="0"
 
! General Technical Functions !! Description
 
! General Technical Functions !! Description
 
|-
 
|-
Line 47: Line 47:
 
|-
 
|-
 
| [[Lua:ResetMap|ResetMap]]() || resets map.
 
| [[Lua:ResetMap|ResetMap]]() || resets map.
|-
 
| [[Lua:SetGlobalRespawnDelay|SetGlobalRespawnDelay]]( time ) || enforces a respawn delay.
 
 
|-
 
|-
 
| [[Lua:SetConvar|SetConvar]]( player, var, value ) || sets a players console variable to set value
 
| [[Lua:SetConvar|SetConvar]]( player, var, value ) || sets a players console variable to set value
Line 63: Line 61:
 
|-
 
|-
 
! Game Rules !!
 
! Game Rules !!
 +
|-
 +
| [[Lua:SetGlobalRespawnDelay|SetGlobalRespawnDelay]]( time ) || enforces a respawn delay.
 
|-
 
|-
 
| [[Lua:SetPlayerLimit|SetPlayerLimit]]( team , # ) || used to set player limit per team.
 
| [[Lua:SetPlayerLimit|SetPlayerLimit]]( team , # ) || used to set player limit per team.
Line 75: Line 75:
 
|-
 
|-
 
| [[Lua:SetTeamName|SetTeamName]]( team, name ) ||  
 
| [[Lua:SetTeamName|SetTeamName]]( team, name ) ||  
|-
 
| [[Lua:SetTeamPlayerLimit|SetTeamPlayerLimit]]( team, limit ) ||
 
 
|-
 
|-
 
| [[Lua:SetTeamPlayerLimit|SetTeamPlayerLimit]]( team, limit ) ||
 
| [[Lua:SetTeamPlayerLimit|SetTeamPlayerLimit]]( team, limit ) ||
 
|}
 
|}
 
{{Infobox manual/Footer}}
 
{{Infobox manual/Footer}}

Revision as of 11:04, 5 May 2010


Mapping for FF
The Basics

Setting up Hammer
Getting Started With Lua
Releasing a map

FF-specific Entities

Lua location system

Map Templates
FF Lua Documentation

Entity Typing
Entity Collections

Commands
Callbacks

These global functions are useful for getting your scripts working.

General Technical Functions Description
ConsoleToAll( message ) sends a message to server console. Inaccurately named--players will not see this.
PrecacheModel( modelfile ) loads a given model into memory for use later.
PrecacheSound( soundfile ) as above.
PrintBool , &FFLib::PrintBool
RandomFloat( min, max ) generates a random float.
RandomInt( min, max ) generates a random integer
RemoveEntity( ent_id ) removes entity.
Player information
GetPacketloss( playerentity ) gets a player's packet loss. Woo?
GetPing( playerentity )
GetSteamID( playerentity )
Server Info
GetServerTime()
AreTeamsAllied( team1, team2 ) Returns true if they are.
NumPlayers() gets the number of players.
Server Effects
SetGameDescription( name ) Changes what appears in the game column of the server browser (it is appended to "FF ")

For use in startup().

RespawnAllPlayers( ) Respawns everyone immediately.
KillAndRespawnAllPlayers() obvious!
GoToIntermission( ) Sends all players to the info_intermission entity and shows them the scoreboard. Then, the map ends.
ResetMap() resets map.
SetConvar( player, var, value ) sets a players console variable to set value
ApplyToAll( effect )
ApplyToTeam( effect, team )
ApplyToPlayer( effect, player )
HasGameStarted( ) Returns false if the map is in prematch mode.
GetConvar( cvar ) checks the value of a console variable (cvar)
Game Rules
SetGlobalRespawnDelay( time ) enforces a respawn delay.
SetPlayerLimit( team , # ) used to set player limit per team.
SetPlayerLimits( #, # )
SmartClassLimits( team, #scout, #sniper, #soldier, #demoman, #medic, #hwguy, #pyro, #spy, #engineer, #civilian ) sets class limits for the entire team.
SetTeamAllies( team , bits ) used to ally one team to another.
SetTeamClassLimit( team, class, limit )
SetTeamName( team, name )
SetTeamPlayerLimit( team, limit )

Pages in category "Utility functions"

The following 7 pages are in this category, out of 7 total.