Category:Buildable functions

From Fortress Forever Wiki
Revision as of 16:07, 5 May 2010 by Crazycarl (talk | contribs)
Jump to navigationJump to search


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 are functions that can be applied to machines built by players, such as sentry guns.

Usage

CFFBuildableObject:function(parameters)

or

CFFSentryGun:function(parameters)

or

CFFDispener:function(parameters)

Probably mancannons and detpacks would apply here as well

Example

function player_killed ( player_victim, damageinfo )

	-- if no damageinfo do nothing
	if not damageinfo then return end

	-- Entity that is attacking
	local attacker = damageinfo:GetAttacker()
  
	-- If no attacker do nothing
	if not attacker then return end

	elseif IsSentrygun(attacker) then
		attacker = CastToSentrygun(attacker)
		--attacker now refers to a CFFSentryGun object;
		--we can do sentry specific stuff, as well as general buildable stuff.
		player_attacker = attacker:GetOwner()
		--We now know who owns the sentry who killed this player
	end
end

CFFBuildableObject -- The basic form of buildable

Command Description
GetTeamId() returns teamid of the buildable.
GetOwner() returns the player that built it. Not sure if this is a player object or entity.
GetTeam() returns the team of the buildable.

CFFSentryGun -- Sentrygun is a type of buildable, and inherits all of the above.

Command Description
GetLevel() Returns the level of the sentry.

This category currently contains no pages or media.