Difference between revisions of "Lua:Flags"
Squeek-10494 (talk | contribs) |
|||
(15 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Infobox manual/Header}} | ||
+ | {{Infobox mapping}} | ||
+ | {{Lua:FlagType | ||
+ | |prefix=Class | ||
+ | |usage=Returns a specific class ID | ||
+ | |flags= | ||
+ | {{Lua:Flag|Player.kScout | Scout Class }} | ||
+ | {{Lua:Flag|Player.kSniper | Sniper Class}} | ||
+ | {{Lua:Flag|Player.kSoldier | Soldier Class}} | ||
+ | {{Lua:Flag|Player.kDemoman | Demoman Class}} | ||
+ | {{Lua:Flag|Player.kMedic | Medic Class}} | ||
+ | {{Lua:Flag|Player.kHwGuy | Heavy Weapons Class}} | ||
+ | {{Lua:Flag|Player.kPyro | Pyro Class}} | ||
+ | {{Lua:Flag|Player.kSpy | Spy Class}} | ||
+ | {{Lua:Flag|Player.kEngineer | Engineer Class}} | ||
+ | |example= | ||
+ | <code><pre> | ||
+ | local player = CastToPlayer( touch_entity ) | ||
+ | if player:GetClass() == Player.kSniper then | ||
+ | ... | ||
+ | end | ||
+ | </pre></code> | ||
+ | }} | ||
{{Lua:FlagType | {{Lua:FlagType | ||
|prefix=Team | |prefix=Team | ||
Line 25: | Line 48: | ||
{{Lua:Flag|Grenade.kCaltrop|Caltrop grenades are no longer in the game}} | {{Lua:Flag|Grenade.kCaltrop|Caltrop grenades are no longer in the game}} | ||
{{Lua:Flag|Grenade.kNail|Nail Grenade (Soldier)}} | {{Lua:Flag|Grenade.kNail|Nail Grenade (Soldier)}} | ||
− | {{Lua:Flag|Grenade.kMirv|Mirv grenade ( | + | {{Lua:Flag|Grenade.kMirv|Mirv grenade (Demoman)}} |
− | {{Lua:Flag|Grenade.kMirvlet|The four mini-grenades that come out of the Mirv grenade ( | + | {{Lua:Flag|Grenade.kMirvlet|The four mini-grenades that come out of the Mirv grenade (Demoman)}} |
{{Lua:Flag|Grenade.kConc|Concussion grenade (Scout and Medic)}} | {{Lua:Flag|Grenade.kConc|Concussion grenade (Scout and Medic)}} | ||
{{Lua:Flag|Grenade.kNapalm|Napalm grenade (Pyro)}} | {{Lua:Flag|Grenade.kNapalm|Napalm grenade (Pyro)}} | ||
Line 33: | Line 56: | ||
|example= | |example= | ||
<code><pre> | <code><pre> | ||
− | local grenade = | + | local grenade = CastToGrenade( explode_entity ) |
if grenade:Type() == Grenade.kNormal then | if grenade:Type() == Grenade.kNormal then | ||
... | ... | ||
Line 39: | Line 62: | ||
</pre></code> | </pre></code> | ||
}} | }} | ||
+ | |||
+ | {{Lua:FlagType | ||
+ | |prefix=Damage | ||
+ | |usage=Returns a specific damage type's ID; predominately used to detect fall damage | ||
+ | |flags= | ||
+ | {{Lua:Flag|Damage.kGeneric|Generic damage}} | ||
+ | {{Lua:Flag|Damage.kCrush|Crushing damage (as in by an elevator or door)}} | ||
+ | {{Lua:Flag|Damage.kBullet|Bullet damage}} | ||
+ | {{Lua:Flag|Damage.kSlash|Unknown}} | ||
+ | {{Lua:Flag|Damage.kBurn|Burn damage (maybe by pyro, maybe by trigger_hurt)}} | ||
+ | {{Lua:Flag|Damage.kVehicle|Vehicle damage}} | ||
+ | {{Lua:Flag|Damage.kFall|Fall damage}} | ||
+ | {{Lua:Flag|Damage.kBlast|Blast damage, DamageID 64}} | ||
+ | {{Lua:Flag|Damage.kClub|Unknown}} | ||
+ | {{Lua:Flag|Damage.kShock|Shock damage}} | ||
+ | {{Lua:Flag|Damage.kSonic|Unknown}} | ||
+ | {{Lua:Flag|Damage.kEnergyBeam|Unknown}} | ||
+ | {{Lua:Flag|Damage.kPreventPhysForce|Unknown}} | ||
+ | {{Lua:Flag|Damage.kNeverGib|Unknown}} | ||
+ | {{Lua:Flag|Damage.kAlwaysGib|Unknown}} | ||
+ | {{Lua:Flag|Damage.kDrown|Drowning damage}} | ||
+ | {{Lua:Flag|Damage.kTimeBased|Unknown}} | ||
+ | {{Lua:Flag|Damage.kParalyze|Unknown}} | ||
+ | {{Lua:Flag|Damage.kNerveGas|Unknown}} | ||
+ | {{Lua:Flag|Damage.kPoison|Unknown}} | ||
+ | {{Lua:Flag|Damage.kRadiation|Unknown}} | ||
+ | {{Lua:Flag|Damage.kDrownRecover|Unknown}} | ||
+ | {{Lua:Flag|Damage.kAcid|Unknown}} | ||
+ | {{Lua:Flag|Damage.kSlowBurn|Unknown}} | ||
+ | {{Lua:Flag|Damage.kRemoveNoRagdoll|Unknown}} | ||
+ | {{Lua:Flag|Damage.kPhysgun|Unknown; likely not applicable}} | ||
+ | {{Lua:Flag|Damage.kPlasma|Unknown}} | ||
+ | {{Lua:Flag|Damage.kAirboat|Likely not applicable}} | ||
+ | {{Lua:Flag|Damage.kDissolve|Can be dealt by a trigger_hurt}} | ||
+ | {{Lua:Flag|Damage.kBlastSurface|Unknown}} | ||
+ | {{Lua:Flag|Damage.kDirect|Unknown}} | ||
+ | {{Lua:Flag|Damage.kBuckshot|Unknown}} | ||
+ | {{Lua:Flag|Damage.kGibCorpse|Unknown}} | ||
+ | {{Lua:Flag|Damage.kShownHud|Unknown}} | ||
+ | {{Lua:Flag|Damage.kNoPhysForce|Unknown}} | ||
+ | |example= | ||
+ | <code><pre> | ||
+ | local damagetype = damageinfo:GetDamageType() | ||
+ | if damagetype == Damage.kFall then | ||
+ | ... | ||
+ | end | ||
+ | </pre></code> | ||
+ | }} | ||
+ | |||
+ | {{Lua:FlagType | ||
+ | |prefix=Ammo | ||
+ | |usage=Returns a specific ammo type's ID; predominately used to add or remove ammo from a player | ||
+ | |flags= | ||
+ | {{Lua:Flag|Ammo.kShells|[[Reference:Ammo#Shell|Shell]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kCells|[[Reference:Ammo#Cell|Cell]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kNails|[[Reference:Ammo#Nail|Nail]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kRockets|[[Reference:Ammo#Rocket|Rocket]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kDetpack|[[Reference:Ammo#Detpack|Detpack]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kManCannon|[[Reference:Ammo#Jump Pad|Jump Pad]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kGren1|[[Reference:Grenades|Primary grenade]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kGren2|[[Reference:Grenades|Secondary grenade]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kInvalid|Unknown}} | ||
+ | |example= | ||
+ | <code><pre> | ||
+ | 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 ) | ||
+ | </pre></code> | ||
+ | }} | ||
+ | |||
+ | {{Lua:FlagType | ||
+ | |prefix=EF | ||
+ | |usage=Returns a specific status effect's ID | ||
+ | |flags= | ||
+ | {{Lua:Flag|EF.kOnfire|[[:Category:Status_Effects#On_Fire|On Fire]] status effect}} | ||
+ | {{Lua:Flag|EF.kConc|[[:Category:Status_Effects#Concussed|Concussed]] status effect}} | ||
+ | {{Lua:Flag|EF.kGas|[[:Category:Status_Effects#Hallucinations|Hallucinati ons]] status effect}} | ||
+ | {{Lua:Flag|EF.kInfect|[[:Category:Status_Effects#Infected|Infected]] status effect}} | ||
+ | {{Lua:Flag|EF.kRadiotag|[[:Category:Status_Effects#Transmitting|Transmitting]] status effect}} | ||
+ | {{Lua:Flag|EF.kHeadshot|Headshot status effect}} | ||
+ | {{Lua:Flag|EF.kLegshot|[[:Category:Status_Effects#Crippled|Crippled]] status effect}} | ||
+ | {{Lua:Flag|EF.kTranq|[[:Category:Status_Effects#Tranquilized|Tranquilized]] status effect}} | ||
+ | {{Lua:Flag|EF.kCaltrop|Defunct}} | ||
+ | {{Lua:Flag|EF.kACSpinup|Assault Cannon spinup status effect}} | ||
+ | {{Lua:Flag|EF.kSniperrifle|Unknown}} | ||
+ | {{Lua:Flag|EF.kSpeedlua1|Custom speed effect 1}} | ||
+ | {{Lua:Flag|EF.kSpeedlua2|Custom speed effect 2}} | ||
+ | {{Lua:Flag|EF.kSpeedlua3|Custom speed effect 3}} | ||
+ | {{Lua:Flag|...|...}} | ||
+ | {{Lua:Flag|EF.kSpeedlua10|Custom speed effect 10}} | ||
+ | |example= | ||
+ | <code><pre> | ||
+ | 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 ) | ||
+ | </pre></code> | ||
+ | }} | ||
+ | |||
+ | {{Lua:FlagType | ||
+ | |prefix=AT | ||
+ | |usage=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). | ||
+ | |flags= | ||
+ | {{Lua:Flag|AT.kKillPlayers|}} | ||
+ | {{Lua:Flag|AT.kRespawnPlayers|}} | ||
+ | {{Lua:Flag|AT.kDropItems|}} | ||
+ | {{Lua:Flag|AT.kForceDropItems|}} | ||
+ | {{Lua:Flag|AT.kThrowItems|}} | ||
+ | {{Lua:Flag|AT.kForceThrowItems|}} | ||
+ | {{Lua:Flag|AT.kReturnCarriedItems|}} | ||
+ | {{Lua:Flag|AT.kReturnDroppedItems|ApplyToAll only?}} | ||
+ | {{Lua:Flag|AT.kRemoveRagdolls|ApplyToAll only?}} | ||
+ | {{Lua:Flag|AT.kRemovePacks|ApplyToAll only?}} | ||
+ | {{Lua:Flag|AT.kRemoveProjectiles|}} | ||
+ | {{Lua:Flag|AT.kRemoveBuildables|}} | ||
+ | {{Lua:Flag|AT.kRemoveDecals|ApplyToAll only?}} | ||
+ | {{Lua:Flag|AT.kEndMap|ApplyToAll only}} | ||
+ | {{Lua:Flag|AT.kReloadClips|}} | ||
+ | {{Lua:Flag|AT.kAllowRespawn|}} | ||
+ | {{Lua:Flag|AT.kDisallowRespawn|}} | ||
+ | |||
+ | {{Lua:Flag|AT.kChangeClassScout|}} | ||
+ | {{Lua:Flag|AT.kChangeClassSniper|}} | ||
+ | {{Lua:Flag|AT.kChangeClassSoldier|}} | ||
+ | {{Lua:Flag|AT.kChangeClassDemoman|}} | ||
+ | {{Lua:Flag|AT.kChangeClassMedic|}} | ||
+ | {{Lua:Flag|AT.kChangeClassHWGuy|}} | ||
+ | {{Lua:Flag|AT.kChangeClassPyro|}} | ||
+ | {{Lua:Flag|AT.kChangeClassSpy|}} | ||
+ | {{Lua:Flag|AT.kChangeClassEngineer|}} | ||
+ | {{Lua:Flag|AT.kChangeClassCivilian|}} | ||
+ | {{Lua:Flag|AT.kChangeClassRandom|}} | ||
+ | |||
+ | {{Lua:Flag|AT.kChangeTeamBlue|}} | ||
+ | {{Lua:Flag|AT.kChangeTeamRed|}} | ||
+ | {{Lua:Flag|AT.kChangeTeamYellow|}} | ||
+ | {{Lua:Flag|AT.kChangeTeamGreen|}} | ||
+ | {{Lua:Flag|AT.kChangeTeamSpectator|}} | ||
+ | |||
+ | {{Lua:Flag|AT.kStopPrimedGrens|}} | ||
+ | |||
+ | |example= | ||
+ | <code><pre> | ||
+ | ApplyToAll({ AT.kRemovePacks, AT.kRemoveProjectiles, AT.kRespawnPlayers, AT.kRemoveBuildables, AT.kRemoveRagdolls, AT.kStopPrimedGrens, AT.kReloadClips }) | ||
+ | </pre></code> | ||
+ | }} | ||
+ | |||
+ | {{Lua:FlagType | ||
+ | |prefix=ClipFlags | ||
+ | |usage=Used with [[Lua:trigger_ff_clip]] to determine what types of entities are allowed to pass through the trigger. | ||
+ | |flags= | ||
+ | {{Lua:Flag|ClipFlags.kClipTeamBlue|Use in conjunction with "ByTeam" flags.}} | ||
+ | {{Lua:Flag|ClipFlags.kClipTeamRed|Use in conjunction with "ByTeam" flags.}} | ||
+ | {{Lua:Flag|ClipFlags.kClipTeamYellow|Use in conjunction with "ByTeam" flags.}} | ||
+ | {{Lua:Flag|ClipFlags.kClipTeamGreen|Use in conjunction with "ByTeam" flags.}} | ||
+ | {{Lua:Flag|ClipFlags.kClipAllPlayers|}} | ||
+ | {{Lua:Flag|ClipFlags.kClipAllGrenades|}} | ||
+ | {{Lua:Flag|ClipFlags.kClipAllProjectiles|projectiles such as nails and rockets.}} | ||
+ | {{Lua:Flag|ClipFlags.kClipAllBullets|hitscan weapons such as shotguns.}} | ||
+ | {{Lua:Flag|ClipFlags.kClipAllBuildables|Can buildables be placed?}} | ||
+ | {{Lua:Flag|ClipFlags.kClipAllBuildableWeapons|Can sentries fire through?}} | ||
+ | {{Lua:Flag|ClipFlags.kClipAllBackpacks|Thrown/dropped ammo.}} | ||
+ | {{Lua:Flag|ClipFlags.kClipAllInfoScripts|Flags, balls, etc. These currently cannot be filtered by team.}} | ||
+ | {{Lua:Flag|ClipFlags.kClipAllSpawnTurrets|}} | ||
+ | {{Lua:Flag|ClipFlags.kClipAllNonPlayers|}} | ||
+ | {{Lua:Flag|ClipFlags.kClipPlayersByTeam or ClipFlags.kClipPlayers|The following pairs behave identically; the first form is preferred, but the second form is for backwards-compatibility.}} | ||
+ | {{Lua:Flag|ClipFlags.kClipGrenadesByTeam or ClipFlags.kClipGrenades|}} | ||
+ | {{Lua:Flag|ClipFlags.kClipProjectilesByTeam or ClipFlags.kClipProjectiles|}} | ||
+ | {{Lua:Flag|ClipFlags.kClipBulletsByTeam or ClipFlags.kClipBullets|}} | ||
+ | {{Lua:Flag|ClipFlags.kClipBuildablesByTeam or ClipFlags.kClipBuildables|}} | ||
+ | {{Lua:Flag|ClipFlags.kClipBuildableWeaponsByTeam or ClipFlags.kClipBuildableWeapons|}} | ||
+ | {{Lua:Flag|ClipFlags.kClipBackpacksByTeam or ClipFlags.kClipBackpacks|}} | ||
+ | {{Lua:Flag|ClipFlags.kClipSpawnTurretsByTeam or ClipFlags.kClipSpawnTurrets|}} | ||
+ | {{Lua:Flag|ClipFlags.kClipNonPlayersByTeam or ClipFlags.kClipNonPlayers|}} | ||
+ | |||
+ | |example= | ||
+ | This clip brush will be solid to everything except blue players. | ||
+ | <code><pre> | ||
+ | clip_example = trigger_ff_clip:new({ clipflags = { | ||
+ | ClipFlags.kClipPlayersByTeam, ClipFlags.kClipTeamRed, | ||
+ | ClipFlags.kClipTeamYellow, ClipFlags.kClipTeamGreen, | ||
+ | ClipFlags.kClipAllNonPlayers} }) | ||
+ | </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> | ||
+ | }} | ||
+ | {{Lua:FlagType | ||
+ | |prefix=Color | ||
+ | |usage=Shorthand for some common colors | ||
+ | |flags= | ||
+ | |||
+ | {{Lua:Flag|Color.kInvalid|}} | ||
+ | {{Lua:Flag|Color.kDefault|}} | ||
+ | {{Lua:Flag|Color.kBlue|}} | ||
+ | {{Lua:Flag|Color.kRed|}} | ||
+ | {{Lua:Flag|Color.kYellow|}} | ||
+ | {{Lua:Flag|Color.kGreen|}} | ||
+ | {{Lua:Flag|Color.kWhite|}} | ||
+ | {{Lua:Flag|Color.kBlack|}} | ||
+ | {{Lua:Flag|Color.kOrange|}} | ||
+ | {{Lua:Flag|Color.kPink|}} | ||
+ | {{Lua:Flag|Color.kPurple|}} | ||
+ | {{Lua:Flag|Color.kGrey|}} | ||
+ | |example= | ||
+ | <code><pre> | ||
+ | BroadCastMessage( "Goal!", 5, Color.kBlue ) | ||
+ | </pre></code> | ||
+ | }} | ||
+ | [[Category:Lua]] | ||
+ | {{Infobox manual/Footer}} |
Latest revision as of 19:13, 23 April 2015
ClassReturns a specific class ID
Example
TeamReturns a specific team's ID
Example
GrenadeReturns a specific grenade's ID
Example
DamageReturns a specific damage type's ID; predominately used to detect fall damage
Example
AmmoReturns a specific ammo type's ID; predominately used to add or remove ammo from a player
Example
EFReturns a specific status effect's ID
Example
ATReturns 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
ClipFlagsUsed with Lua:trigger_ff_clip to determine what types of entities are allowed to pass through the trigger.
ExampleThis clip brush will be solid to everything except blue players.
CFReturns a specific "collection filter" ID;. Use with Collection() functions to add certain entities to a list.
Example
ColorShorthand for some common colors
Example
|