Difference between revisions of "Category:Lua Commands"

From Fortress Forever Wiki
Jump to navigationJump to search
m
m (2.42)
 
(3 intermediate revisions by the same user not shown)
Line 28: Line 28:
 
Objective icons help guide the player to where they are supposed to be.
 
Objective icons help guide the player to where they are supposed to be.
  
==Other Commands==
+
==[[:Category:Utility functions | Utility]]==
Other misc commands not lumped into any group as of yet.
+
These lua functions are useful for getting your scripts working.
 
 
{| border="1" cellspacing="0"
 
! LUA Command !! Description
 
|-
 
| [[Lua:ConsoleToAll|ConsoleToAll]]( message ) || sends a message to server console. Inaccurately named--players will not see this.
 
|-
 
| [[Lua:SetGameDescription|SetGameDescription]]( name ) || Changes what appears in the game column of the server browser (it is appended to "FF ")
 
For use in [[startup]]().
 
|-
 
| [[Lua:HasGameStarted|HasGameStarted]]( ) || Returns false if the map is in prematch mode.
 
|-
 
| [[Lua:GetConvar|GetConvar]]( cvar ) || checks the value of a console variable (cvar)
 
|-
 
| [[Lua:GetEntity|GetEntity]]( index ) || gets an entity by its index.
 
|-
 
| [[Lua:GetEntityByName|GetEntityByName]]( name ) || obvious?
 
|-
 
| [[Lua:GetInfoScriptById|GetInfoScriptById]]( id ) || gets an info_ff_script's information by its id.
 
|-
 
| [[Lua:GetInfoScriptByName|GetInfoScriptByName]]( name ) || obvious?
 
|-
 
| [[Lua:GetGrenade|GetGrenade]]() || ??
 
|-
 
| [[Lua:GetPacketloss|GetPacketloss]]( playerentity ) || gets a player's packet loss. Woo?
 
|-
 
| [[Lua:GetPing|GetPing]]( playerentity ) ||
 
|-
 
| [[Lua:GetPlayer|GetPlayer]]( playerentity ) ||
 
|-
 
| [[Lua:GetPlayerByID|GetPlayerByID]]( id ) ||
 
|-
 
| [[Lua:GetServerTime|GetServerTime]]()  ||
 
|-
 
| [[Lua:GetSteamID|GetSteamID]]( playerentity ) ||
 
|-
 
| [[Lua:GetTeam|GetTeam]]( playerentity ) ||
 
|-
 
| [[Lua:GetTriggerScriptByName|GetTriggerScriptByName]]( name ) ||
 
|-
 
| [[Lua:GoToIntermission|GoToIntermission]]( ) || ???
 
|-
 
| [[Lua:IncludeScript|IncludeScript]]( luafile ) || used to include Lua files found in /includes/ such as base_teamplay or base_ctf.
 
|-
 
| [[Lua:ApplyToAll|ApplyToAll]]( effect ) ||
 
|-
 
| [[Lua:ApplyToTeam|ApplyToTeam]]( effect, team ) ||
 
|-
 
| [[Lua:ApplyToPlayer|ApplyToPlayer]]( effect, player ) ||
 
|-
 
| [[Lua:AreTeamsAllied|AreTeamsAllied]]( team1, team2 ) || obvious?
 
|-
 
| [[Lua:KillAndRespawnAllPlayers|KillAndRespawnAllPlayers]]() || obvious!
 
|-
 
| [[Lua:NumPlayers|NumPlayers]]() || gets the number of players.
 
|-
 
| [[Lua:OutputEvent|OutputEvent]]( event, ent_id[, param1, param2, etc.] ) || tells an entity to fire the given output.
 
|-
 
| OutputEvent , void * const char* , const char* , const char* , float , unsigned int &FFLib::FireOutput  ||
 
|-
 
| [[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:RespawnAllPlayers|RespawnAllPlayers]]( ) || respawns everyone.
 
|-
 
| [[Lua:ResetMap|ResetMap]]() || resets map.
 
|-
 
| [[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 smart class limits instead of using individual commands.
 
|-
 
| [[Lua:SetConvar|SetConvar]]( player, var, value ) || sets a players cvar to set value
 
|-
 
| [[Lua:SetTeamAllies|SetTeamAllies]]( team , bits ) || used to ally one team to another.
 
|-
 
| [[Lua:SetTeamClassLimit|SetTeamClassLimit]]( team, class, limit ) ||
 
|-
 
| [[Lua:SetTeamName|SetTeamName]]( team, name ) ||
 
|-
 
| [[Lua:SetTeamPlayerLimit|SetTeamPlayerLimit]]( team, limit ) ||
 
|-
 
| [[Lua:SetTeamPlayerLimit|SetTeamPlayerLimit]]( team, limit ) ||
 
|}
 
  
 
=Object functions=
 
=Object functions=
 
Each class of entity will have its own set of functions. These are listed in the links below:
 
Each class of entity will have its own set of functions. These are listed in the links below:
 +
* [[:Category:Damageinfo functions|Damageinfo]]-- An object that is created every time someone/something gets hurt in the game.
 +
* [[:Category:Entity_Functions|Entity]] --A generic game entity from which all of the below are derived.
 
* [[:Category:Buildable_functions|Buildable]] -- Sentries, dispensers, etc.
 
* [[:Category:Buildable_functions|Buildable]] -- Sentries, dispensers, etc.
* [[:Category:Damageinfo functions|Damageinfo]]-- An object that is created every time someone/something gets hurt in the game.
+
* [[Lua:info_ff_script|info_ff_script]] -- A FF game object. These are most often used as flags or other objectives.
* [[Lua:info_ff_script|info_ff_script]] -- A generic game object. These are most often used as flags or other objectives.
 
 
* [[:Category:Player functions|Player]] -- Anyone that's connected to a server.
 
* [[:Category:Player functions|Player]] -- Anyone that's connected to a server.
 
* [[:Category:Team functions|Team]] -- A team is a group of folks who don't like other groups of folks.
 
* [[:Category:Team functions|Team]] -- A team is a group of folks who don't like other groups of folks.

Latest revision as of 22:06, 25 June 2011


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

LUA commands that are specific for Fortress Forever. This list is incomplete and will be replaced eventually, and everything put into categories.

Global Functions

Global functions are not confined to any object type. They can be called alone, from just about anywhere in the script.

Example:

local player = CastToPlayer( player_entity )
AddHudTimer(player, "timer", 300, -1, 0, 70, 4)

This global function is not a player function, though it takes a player object as a parameter.

Casting Commands

These functions cast game objects into different data types. See Lua:Entity_typing.

Entity Checks

These commands are used to check if the specified entity is a game entity of a specific type. See Lua:Entity_typing.

Player messaging and sounds

These are used to send text messages and sounds to players.

Schedules

Schedules are a way to delay the effects of a script for a specific length of time.

HUD Items

Through Lua, a map can display information on a player's screen.

Objective Icons

Objective icons help guide the player to where they are supposed to be.

Utility

These lua functions are useful for getting your scripts working.

Object functions

Each class of entity will have its own set of functions. These are listed in the links below:

  • Damageinfo-- An object that is created every time someone/something gets hurt in the game.
  • Entity --A generic game entity from which all of the below are derived.
  • Buildable -- Sentries, dispensers, etc.
  • info_ff_script -- A FF game object. These are most often used as flags or other objectives.
  • Player -- Anyone that's connected to a server.
  • Team -- A team is a group of folks who don't like other groups of folks.