Difference between revisions of "Category:Utility functions"
From Fortress Forever Wiki
Jump to navigationJump to search (New page: These lua functions are useful for getting your scripts working. Category:Lua_Commands) |
|||
| (10 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | These | + | {{Infobox manual/Header}} |
| + | {{Infobox mapping}} | ||
| + | These global functions are useful for getting your scripts working. | ||
| + | {| border="1" cellspacing="2" cellpadding="2" | ||
| + | ! General Technical Functions !! Description | ||
| + | |- | ||
| + | | [[Lua:IncludeScript|IncludeScript]](string) || This function loads the contents of another lua file, located in FortresForever\maps\includes. | ||
| + | |- | ||
| + | | [[Lua:ConsoleToAll|ConsoleToAll]]( message ) || sends a message to server console. Inaccurately named--players will not see this. | ||
| + | |- | ||
| + | | [[Lua:PrecacheModel|PrecacheModel]]( modelfile ) || loads a given model into memory for use later. | ||
| + | |- | ||
| + | | [[Lua:PrecacheSound|PrecacheSound]]( soundfile ) || as above. | ||
| + | |- | ||
| + | | PrintBool , &FFLib::PrintBool || | ||
| + | |- | ||
| + | | [[Lua:RandomFloat|RandomFloat]]( min, max ) || generates a random float. | ||
| + | |- | ||
| + | | [[Lua:RandomInt|RandomInt]]( min, max ) || generates a random integer | ||
| + | |- | ||
| + | | [[Lua:RemoveEntity|RemoveEntity]]( ent_id ) || removes entity. | ||
| + | |- | ||
| + | | [[Lua:OutputEvent|OutputEvent]]( entity, input, parameter, delay, x ) || Triggers any named entity in the map using Source's [http://developer.valvesoftware.com/wiki/Inputs_and_Outputs#Inputs I/O system]. | ||
| + | |- | ||
| + | | [[Lua:SetConvar|SetConvar]]( player, var, value ) || sets a player's [http://developer.valvesoftware.com/wiki/Console_Command_List console variable] to a specified value. | ||
| + | |- | ||
| + | ! Player information !! | ||
| + | |- | ||
| + | | [[Lua:GetPacketloss|GetPacketloss]]( playerentity ) || gets a player's packet loss. Woo? | ||
| + | |- | ||
| + | | [[Lua:GetPing|GetPing]]( playerentity ) || | ||
| + | |- | ||
| + | | [[Lua:GetSteamID|GetSteamID]]( playerentity ) || | ||
| + | |- | ||
| + | ! Server Info !! | ||
| + | |- | ||
| + | | float [[Lua:GetServerTime|GetServerTime]]() || Returns the number of seconds the map has been running. | ||
| + | |- | ||
| + | | [[Lua:AreTeamsAllied|AreTeamsAllied]]( team1, team2 ) || Returns true if they are. | ||
| + | |- | ||
| + | | [[Lua:GetEntitiesByName|GetEntitiesByName]](entname) || returns a Lua table containing the matching entities. | ||
| + | |- | ||
| + | | [[Lua:NumPlayers|NumPlayers]]() || gets the number of players. | ||
| + | |- | ||
| + | | [[Lua:GetPlayers|GetPlayers]]() || returns a table (array) of all players on the server. | ||
| + | |- | ||
| + | | [[Lua:GetConvar|GetConvar]]( cvar ) || returns the value of a [http://developer.valvesoftware.com/wiki/Console_Command_List console variable] on the server(cvar). | ||
| + | |- | ||
| + | | string [[Lua:GetGameDescription|GetGameDescription]] | ||
| + | |- | ||
| + | ! Server Effects !! | ||
| + | |- | ||
| + | | [[Lua:SetGameDescription|SetGameDescription]]( name ) || Changes what appears in the game column of the server browser (it is appended to "FF ") | ||
| + | For use in [[Lua:startup]](). | ||
| + | |- | ||
| + | | [[Lua:RespawnAllPlayers|RespawnAllPlayers]]( ) || Respawns everyone immediately. | ||
| + | |- | ||
| + | | [[Lua:KillAndRespawnAllPlayers|KillAndRespawnAllPlayers]]() || obvious! | ||
| + | |- | ||
| + | | [[Lua:GoToIntermission|GoToIntermission]]( ) || Sends all players to the info_intermission entity and shows them the scoreboard. Then, the map ends. | ||
| + | |- | ||
| + | | [[Lua:ResetMap|ResetMap]]() || resets map. | ||
| + | |- | ||
| + | | [[Lua:set_cvar|set_cvar]](cvar, value) || Sets a [http://developer.valvesoftware.com/wiki/Console_Command_List console variable] on the server | ||
| + | |- | ||
| + | | [[Lua:ApplyToAll|ApplyToAll]]( effect ) || pass this a list of [[Lua:Flags#AT | AT flags]] to apply global effects to the server. | ||
| + | |- | ||
| + | | [[Lua:ApplyToTeam|ApplyToTeam]]( effect, team ) || pass this a team id and a list of [[Lua:Flags#AT | AT flags]] to apply effects to players on a team. | ||
| + | |- | ||
| + | | [[Lua:ApplyToPlayer|ApplyToPlayer]]( effect, player ) || pass this a player id and a list of [[Lua:Flags#AT | AT flags]] to apply effects to a player. | ||
| + | |- | ||
| + | | [[Lua:HasGameStarted|HasGameStarted]]( ) || Returns false if the map is in prematch mode. | ||
| + | |- | ||
| + | | [[Lua:LogLuaEvent|LogLuaEvent]](int, int, string) || Sends a message to the servers logs. | ||
| + | |- | ||
| + | ! Game Rules !! | ||
| + | |- | ||
| + | | [[Lua:SetGlobalRespawnDelay|SetGlobalRespawnDelay]]( time ) || enforces a respawn delay. | ||
| + | |- | ||
| + | | [[Lua:SetPlayerLimit|SetPlayerLimit]]( team , # ) || used to set player limit per team. | ||
| + | |- | ||
| + | | [[Lua:SetPlayerLimits|SetPlayerLimits]]( #, # ) || | ||
| + | |- | ||
| + | | [[Lua:SmartClassLimits|SmartClassLimits]]( team, #scout, #sniper, #soldier, #demoman, #medic, #hwguy, #pyro, #spy, #engineer, #civilian ) || sets class limits for the entire team. | ||
| + | |- | ||
| + | | [[Lua:SetTeamAllies|SetTeamAllies]]( team , bits ) || used to ally one team to another. | ||
| + | |- | ||
| + | | [[Lua:SetTeamClassLimit|SetTeamClassLimit]]( team, class, limit ) || | ||
| + | |- | ||
| + | | [[Lua:SetTeamName|SetTeamName]]( team, name ) || Set a custom name for a team: appears on the scoreboard and team selection screen. | ||
| + | |- | ||
| + | | [[Lua:SetTeamPlayerLimit|SetTeamPlayerLimit]]( team, limit ) || | ||
| + | |} | ||
| + | [[Category:Lua]] | ||
[[Category:Lua_Commands]] | [[Category:Lua_Commands]] | ||
| + | {{Infobox manual/Footer}} | ||
Latest revision as of 16:42, 30 March 2015
|
These global functions are useful for getting your scripts working.
|
Pages in category "Utility functions"
The following 7 pages are in this category, out of 7 total.