Difference between revisions of "Category:Lua Callbacks"

From Fortress Forever Wiki
Jump to navigationJump to search
m
m
Line 2: Line 2:
 
{{Infobox mapping}}
 
{{Infobox mapping}}
 
Callbacks are user-defined functions which are activated by events in the game. The lua script can change the outcome of these events, or simply use the event as a cue to run some other code.
 
Callbacks are user-defined functions which are activated by events in the game. The lua script can change the outcome of these events, or simply use the event as a cue to run some other code.
 +
Access to events is typically in the following format:
 +
 +
function ''entity'':'''eventname'''( ''parameters'' )
 +
  --What to do when this method is called
 +
  --return anything, if necessary
 +
end
 +
 +
Different methods may provide data by passing on a number of parameters.  The types of these parameters, returned values and examples of usage can be found on their respective pages.
 
[[Category:Lua]]
 
[[Category:Lua]]
 
{{Infobox manual/Footer}}
 
{{Infobox manual/Footer}}

Revision as of 09:27, 5 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

Callbacks are user-defined functions which are activated by events in the game. The lua script can change the outcome of these events, or simply use the event as a cue to run some other code. Access to events is typically in the following format:

function entity:eventname( parameters )
  --What to do when this method is called
  --return anything, if necessary
end

Different methods may provide data by passing on a number of parameters. The types of these parameters, returned values and examples of usage can be found on their respective pages.