Difference between revisions of "Lua:Flags"
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Infobox manual/Header}} | {{Infobox manual/Header}} | ||
{{Infobox mapping}} | {{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 27: | 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 53: | Line 74: | ||
{{Lua:Flag|Damage.kVehicle|Vehicle damage}} | {{Lua:Flag|Damage.kVehicle|Vehicle damage}} | ||
{{Lua:Flag|Damage.kFall|Fall damage}} | {{Lua:Flag|Damage.kFall|Fall damage}} | ||
− | {{Lua:Flag|Damage.kBlast|Blast damage}} | + | {{Lua:Flag|Damage.kBlast|Blast damage, DamageID 64}} |
{{Lua:Flag|Damage.kClub|Unknown}} | {{Lua:Flag|Damage.kClub|Unknown}} | ||
{{Lua:Flag|Damage.kShock|Shock damage}} | {{Lua:Flag|Damage.kShock|Shock damage}} | ||
Line 291: | Line 312: | ||
{{Lua:FlagType | {{Lua:FlagType | ||
|prefix=Color | |prefix=Color | ||
− | |usage=Shorthand for some common colors | + | |usage=Shorthand for some common colors |
|flags= | |flags= | ||
Line 306: | Line 327: | ||
{{Lua:Flag|Color.kPurple|}} | {{Lua:Flag|Color.kPurple|}} | ||
{{Lua:Flag|Color.kGrey|}} | {{Lua:Flag|Color.kGrey|}} | ||
− | + | |example= | |
+ | <code><pre> | ||
+ | BroadCastMessage( "Goal!", 5, Color.kBlue ) | ||
+ | </pre></code> | ||
}} | }} | ||
[[Category:Lua]] | [[Category:Lua]] | ||
{{Infobox manual/Footer}} | {{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
|