Difference between revisions of "Lua:Flags"
From Fortress Forever Wiki
Jump to navigationJump to searchLine 1: | Line 1: | ||
+ | {{Infobox mapping}} | ||
{{Lua:FlagType | {{Lua:FlagType | ||
|prefix=Team | |prefix=Team | ||
Line 157: | Line 158: | ||
{{Lua:Flag|AT.kForceThrowItems|}} | {{Lua:Flag|AT.kForceThrowItems|}} | ||
{{Lua:Flag|AT.kReturnCarriedItems|}} | {{Lua:Flag|AT.kReturnCarriedItems|}} | ||
− | {{Lua:Flag|AT.kReturnDroppedItems|}} | + | {{Lua:Flag|AT.kReturnDroppedItems|ApplyToAll only?}} |
− | {{Lua:Flag|AT.kRemoveRagdolls|}} | + | {{Lua:Flag|AT.kRemoveRagdolls|ApplyToAll only?}} |
− | {{Lua:Flag|AT.kRemovePacks|}} | + | {{Lua:Flag|AT.kRemovePacks|ApplyToAll only?}} |
{{Lua:Flag|AT.kRemoveProjectiles|}} | {{Lua:Flag|AT.kRemoveProjectiles|}} | ||
{{Lua:Flag|AT.kRemoveBuildables|}} | {{Lua:Flag|AT.kRemoveBuildables|}} | ||
− | {{Lua:Flag|AT.kRemoveDecals|}} | + | {{Lua:Flag|AT.kRemoveDecals|ApplyToAll only?}} |
− | {{Lua:Flag|AT.kEndMap|}} | + | {{Lua:Flag|AT.kEndMap|ApplyToAll only}} |
{{Lua:Flag|AT.kReloadClips|}} | {{Lua:Flag|AT.kReloadClips|}} | ||
{{Lua:Flag|AT.kAllowRespawn|}} | {{Lua:Flag|AT.kAllowRespawn|}} | ||
Line 191: | Line 192: | ||
<code><pre> | <code><pre> | ||
ApplyToAll({ AT.kRemovePacks, AT.kRemoveProjectiles, AT.kRespawnPlayers, AT.kRemoveBuildables, AT.kRemoveRagdolls, AT.kStopPrimedGrens, AT.kReloadClips }) | ApplyToAll({ AT.kRemovePacks, AT.kRemoveProjectiles, AT.kRespawnPlayers, AT.kRemoveBuildables, AT.kRemoveRagdolls, AT.kStopPrimedGrens, AT.kReloadClips }) | ||
+ | </pre></code> | ||
+ | }} | ||
+ | |||
+ | {{Lua:FlagType | ||
+ | |prefix=CF | ||
+ | |usage=Returns a specific "collection filter" ID;. Use with [[Lua:Collection|Collection()]] functions to add certain entities to a list. | ||
+ | |flags= | ||
+ | |||
+ | {{Lua:Flag|CF.kNone|No filter}} | ||
+ | |||
+ | {{Lua:Flag|CF.kPlayers|}} | ||
+ | {{Lua:Flag|CF.kHumanPlayers|Meaning bots are excluded.}} | ||
+ | {{Lua:Flag|CF.kBotPlayers|FF does not support bots at this time.}} | ||
+ | {{Lua:Flag|CF.kPlayerScout|}} | ||
+ | {{Lua:Flag|CF.kPlayerSniper|}} | ||
+ | {{Lua:Flag|CF.kPlayerSoldier|}} | ||
+ | {{Lua:Flag|CF.kPlayerDemoman|}} | ||
+ | {{Lua:Flag|CF.kPlayerMedic|}} | ||
+ | {{Lua:Flag|CF.kPlayerHWGuy|}} | ||
+ | {{Lua:Flag|CF.kPlayerPyro|}} | ||
+ | {{Lua:Flag|CF.kPlayerSpy|}} | ||
+ | {{Lua:Flag|CF.kPlayerEngineer|}} | ||
+ | {{Lua:Flag|CF.kPlayerCivilian|}} | ||
+ | |||
+ | {{Lua:Flag|CF.kTeams|Not sure if the team filters work on just players or on any team-aligned object.}} | ||
+ | {{Lua:Flag|CF.kTeamSpec|Spectators}} | ||
+ | {{Lua:Flag|CF.kTeamBlue|}} | ||
+ | {{Lua:Flag|CF.kTeamRed|}} | ||
+ | {{Lua:Flag|CF.kTeamYellow|}} | ||
+ | {{Lua:Flag|CF.kTeamGreen|}} | ||
+ | |||
+ | {{Lua:Flag|CF.kProjectiles|Applies to non-hitscan projectile weapons like rockets.}} | ||
+ | {{Lua:Flag|CF.kGrenades|}} | ||
+ | {{Lua:Flag|CF.kInfoScipts|Applies to any info_ff_script}} | ||
+ | |||
+ | {{Lua:Flag|CF.kInfoScript_Carried| Use the following on info_ff_scripts to determine their status}} | ||
+ | {{Lua:Flag|CF.kInfoScript_Dropped|}} | ||
+ | {{Lua:Flag|CF.kInfoScript_Returned|}} | ||
+ | {{Lua:Flag|CF.kInfoScript_Active|}} | ||
+ | {{Lua:Flag|CF.kInfoScript_Inactive|}} | ||
+ | {{Lua:Flag|CF.kInfoScript_Removed|}} | ||
+ | |||
+ | {{Lua:Flag|CF.kTraceBlockWalls|This flag must be used if you are using the [[Lua:Collection#GetInSphere|Collection:GetInSphere]] function.}} | ||
+ | |||
+ | {{Lua:Flag|CF.kBuildables|}} | ||
+ | {{Lua:Flag|CF.kDispenser|}} | ||
+ | {{Lua:Flag|CF.kSentrygun|}} | ||
+ | {{Lua:Flag|CF.kDetpack|}} | ||
+ | |||
+ | |||
+ | |example= | ||
+ | <code><pre> | ||
+ | local col = Collection() | ||
+ | |||
+ | -- get all blue snipers | ||
+ | col:GetByFilter( { CF.kPlayers, CF.kPlayerSniper, CF.kTeamBlue } ) | ||
</pre></code> | </pre></code> | ||
}} | }} | ||
[[Category:Lua]] | [[Category:Lua]] |
Revision as of 09:51, 28 July 2009
|
Team
Returns a specific team's ID
|
Example
local player = CastToPlayer( touch_entity )
if player:GetTeamId() == Team.kRed then
...
end
Grenade
Returns a specific grenade's ID
|
Example
local grenade = CastToGrenade( explode_entity )
if grenade:Type() == Grenade.kNormal then
...
end
Damage
Returns a specific damage type's ID; predominately used to detect fall damage
|
Example
local damagetype = damageinfo:GetDamageType()
if damagetype == Damage.kFall then
...
end
Ammo
Returns a specific ammo type's ID; predominately used to add or remove ammo from a player
|
Example
local player = CastToPlayer( player_entity )
player:AddAmmo( Ammo.kNails, 400 )
player:AddAmmo( Ammo.kShells, 400 )
player:AddAmmo( Ammo.kRockets, 400 )
player:AddAmmo( Ammo.kCells, 400 )
player:AddAmmo( Ammo.kDetpack, 1 )
player:AddAmmo( Ammo.kManCannon, 1 )
EF
Returns a specific status effect's ID
|
Example
local player = CastToPlayer( player_entity )
SPEED_MULTIPLIER = 2.0
EFFECT_DURATION = -1 -- Infinite duration
ICON_DURATION = 0
player:AddEffect( EF.kSpeedlua1, EFFECT_DURATION, ICON_DURATION, SPEED_MULTIPLIER )
AT
Returns a specific "apply to" ID; Applies various commands to players, or to the entire server. Use with ApplyToAll(ApplyToFlags), ApplyToTeam(team, ApplyToFlags), or ApplyToPlayer(player, ApplyToFlags) (not all flags are suitable for all functions).
|
Example
ApplyToAll({ AT.kRemovePacks, AT.kRemoveProjectiles, AT.kRespawnPlayers, AT.kRemoveBuildables, AT.kRemoveRagdolls, AT.kStopPrimedGrens, AT.kReloadClips })
CF
Returns a specific "collection filter" ID;. Use with Collection() functions to add certain entities to a list.
|
Example
local col = Collection()
-- get all blue snipers
col:GetByFilter( { CF.kPlayers, CF.kPlayerSniper, CF.kTeamBlue } )