ttt_logic_role

From Valve Developer Community
Jump to: navigation, search

ttt_logic_role is a point entity available in Garry's Mod Garry's Mod.This point entity is used to test the role of the !activator. You set what role to test for. If the !activator of the ttt_logic_role is the specified role, then the entity will fire a OnPass output, if it is not the correct role it will fire OnFail. It is VERY important to note that you do not want to set a button to start the test because that will test whoever presses the button. Instead, use a button to enable a trigger_multiple that will in turn fire the test output. This ensures that whoever is in the specific zone is the !activator. It is recommended to use this entity rather than the brush entity ttt_traitor_check, but may not work depending on some tester designs.

Keyvalues

Player role to test for (???) <integer>
What role the entity will fire OnPass for. Can be either Innocent, Detective, Traitor, or Any Role.

Base:
Name (targetname) <string>
The name that other entities use to refer to this entity.
Parent (parentname) <targetname>
Maintain the same initial offset to this entity. An attachment point can also be used if separated by a comma at the end. (parentname [targetname],[attachment])
Tip.pngTip:Entities transition to the next map with their parents
Tip.pngTip:phys_constraint can be used as a workaround if parenting fails.
Origin (X Y Z) (origin) <coordinates>
The position of this entity's center in the world. Rotating entities typically rotate around their origin.
Note.pngNote:Hammer does not move the entities accordingly only in the editor.
Pitch Yaw Roll (X Y Z) (angles) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
Note.pngNote:This works on brush entities, although Hammer doesn't show the new angles.
Classname (classname) <string> !FGD
Determines the characteristics of the entity before it spawns.
Tip.pngTip:Changing this on runtime still has use, like making matching an entry in S_PreserveEnts will persist the entity on new rounds!
Spawnflags (spawnflags) <flags> !FGD
Toggles exclusive features of an entity, its specific number is determined by the combination of flags added.
Effects (effects) <flags> !FGD
Combination of effect flags to use.
Entity Scripts (vscripts) <scriptlist> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions. Scripts executed on the worldspawn entity will be placed in root scope.
Think function (thinkfunction) <string> (in all games since Left 4 Dead 2) (also in Team Fortress 2)
Name of the function within this entity's script that'll be called automatically every 100 milliseconds, or a user-defined interval if the function returns a number. Avoid expensive operations in this function, as it may cause performance problems.
Lag Compensation (LagCompensate) <boolean> (in all games since Left 4 Dead 2) !FGD
Set to Yes to lag compensate this entity. Should be used very sparingly!
Is Automatic-Aim Target (is_autoaim_target) <boolean> (in all games since Counter-Strike: Global Offensive) !FGD
If set to 1, this entity will slow down aiming movement for consoles and joystick controllers when the entity is under the crosshairs.

Inputs

TestActivator
Test the activator for the given Role (ie. if it's a traitor/detective/etc) and fires OnPass or OnFail output. If activator is not a valid player it will always fail.

Outputs

OnPass
Fired in response to TestActivator input if the activator player is of the role set in this ent.
OnFail
Fired in response to TestActivator input if the activator player is NOT of the role set in this ent.