Difference between revisions of "Category:Buildable functions"
From Fortress Forever Wiki
Jump to navigationJump to search (New page: These are functions that can be applied to machines built by players, such as sentry guns. ===Usage=== CFFBuildableObject:''function''(''parameters) or CFFSentryGun:''function''(''param...) |
m |
||
| Line 1: | Line 1: | ||
| + | {{Infobox manual/Header}} | ||
| + | {{Infobox_mapping}} | ||
These are functions that can be applied to machines built by players, such as sentry guns. | These are functions that can be applied to machines built by players, such as sentry guns. | ||
| Line 38: | Line 40: | ||
CFFBuildableObject -- The basic form of buildable | CFFBuildableObject -- The basic form of buildable | ||
| − | + | {| border="1" cellspacing="2" cellpadding="5" | |
| − | + | ! 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 | + | CFFSentryGun -- Sentrygun is a type of buildable, and inherits all of the above. |
| − | + | {| border="1" cellspacing="2" cellpadding="5" | |
| + | ! Command !! Description | ||
| + | |- | ||
| + | | GetLevel() Returns the level of the sentry. | ||
| + | |} | ||
[[Category:Lua]] | [[Category:Lua]] | ||
[[Category:Lua_Commands]] | [[Category:Lua_Commands]] | ||
| + | {{Infobox manual/Footer}} | ||
Revision as of 16:06, 5 May 2010
|
These are functions that can be applied to machines built by players, such as sentry guns. UsageCFFBuildableObject:function(parameters) or CFFSentryGun:function(parameters) or CFFDispener:function(parameters) Probably mancannons and detpacks would apply here as well Examplefunction 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
CFFSentryGun -- Sentrygun is a type of buildable, and inherits all of the above.
|
This category currently contains no pages or media.