====== Interactive Logic Tutorial ====== This page shows how to wire common TTT map interactions with map I/O. The examples are intentionally small. Once the patterns make sense, you can combine them into larger traps, puzzle rooms, traitor testers, elevators, secret doors, and environmental events. ===== The map IO mental model ===== A sender fires an output. Each output contains one or more map links. A map link finds one or more receivers, then sends an input name and optional payload. The receiver decides what that input means. Example: TTT Button TargetsOnActivated TargetName = secret_door_1 Input = Open When the button activates, the object named ''door_secret'' receives ''Open''. ===== Map link fields ===== ^ Field ^ What it does ^ When to use it ^ | ''Target'' | Direct component reference. | Best for scene-authored maps, because Facepunch's dropper tool actually works. | | ''TargetName'' | Finds GameObjects by exact name. All matching names receive the signal. Matching is case-insensitive and trims whitespace. | Made with Hammer in mind but works either way. | | ''TargetTag'' | Sends the signal to all GameObjects with the authored tag. | Best for broad one-to-many events. | | ''Input'' | Input name sent to the receiver. Blank usually forwards the sender's default input. | Use when you want ''Open'', ''Start'', ''Stop'', ''GoTo'', etc. | | ''Payload'' | Optional string data. | Required for some path-mover commands such as ''GoTo'' or ''CallOrDepart''. | | ''DelaySeconds'' | Delays delivery of this link. | Use for timed sequences. | ===== Input Names ===== ^ Input ^ Typical meaning ^ | ''Activate'' | Generic action or default behavior for that object, if it has one (For example, DoorRotating will open when sent this). | | ''Press'' / ''Release'' | Button-style press state. | | ''Start'' / ''Stop'' | Generic on/off behavior. Preferred for lights, effects, triggers, and state receivers. | | ''Open'' / ''Close'' | Door and mover-friendly aliases for start/stop-style behavior. | | ''Toggle'' | Flip the current state. | | ''Lock'' / ''Unlock'' | Prevent or allow future activation. | | ''GoTop'' / ''GoBottom'' | Binary mover aliases for open/close-style movement. | | ''GoTo'' | Move a path mover to a named point or zero-based point index. Uses ''Payload''. | | ''CallOrDepart'' | Elevator-style call/send-away behavior. Uses ''Payload''. | | ''Next'' / ''Previous'' | Move a path mover to a neighboring path point. | | ''Pause'' / ''Resume'' / ''Reverse'' / ''Reset'' | Path mover runtime controls. | | ''Enter'' / ''Exit'' / ''Occupied'' / ''Empty'' | Trigger occupancy outputs. | | ''Pass'' / ''Fail'' | Role tester outputs. | ===== Tutorial: button opens a sliding door ===== Use this for ordinary sliding doors, secret panels, trap shutters, or lifts that only need two positions. ==== Door setup ==== 1. Select the door object. 2. Add TTT Linear Mover. {{::linearmover.png?600|}} 3. Set MoveDelta to the local-space offset from closed to open. {{::sbox-dev_haj4aw5a5x.gif?800|}} 4. Set OpenDuration and CloseDuration (Or don't, for default speed). {{::openclose.png?800|}} 5. Decide whether it should StartsOpen or StartsLocked. 6. Give the object a unique name (like secret_door_1, so on and so forth). This process works similarly for rotating doors. ==== Button setup ==== 7. Select the button object. 8. Add TTT Button. 9. Set Mode to Press, Hold, or Toggle. {{::pressmode.png?800|}} 10. Set HintText for the prompt shown to players (Or ignore for default). 11. Add a link under TargetsOnActivated: {{::targets.png?800|}} ==== You should not use all 3 Target fields like in the example above. We are demonstrating that the GameObject can be identified by name directly, with a tag or by using the dropper tool. ==== {{::tagname.png?600|}} ==== Optional polish ==== * Use ''CooldownSeconds'' on the button to prevent spam. * Use ''FireDelaySeconds'' to delay the main activation while still letting pressed/released outputs happen immediately. * Use ''AutoReset'' and ''ResetTime'' on the mover to close the door after a delay. * Add a paired mover or partner name for double doors. ===== Tutorial: traitor button activates a trap ===== Use ''TTT Role Button'' for traitor/detective-only buttons. These will display a floating panel to that role. {{::rolebutton.png?400|}} ==== Role button setup ==== - Add ''TTT Role Button'' to the button object. - Set ''RoleName'' to ''Traitor'', ''Detective'', or another allowed display team. - Set ''Description'' and optional ''SubText'' (The top and bottom fields on the image above). - Use ''StartsLocked'' for traps that should be armed later. - Use ''RemoveOnUse'' for one-shot traps. ==== Trap receiver examples ==== To start a hurt volume: TTT Role Button TargetsOnActivated TargetName = trap_hurt_volume Input = Start To fire a timed hurt trigger, set the hurt trigger's ''ActivateMode'' to ''Timed'' and wire the button with ''Input'' = ''Activate''. To teleport players in a room: TTT Role Button TargetsOnActivated TargetName = trap_teleport_volume Input = Activate A role button activated through map IO still needs a real player activator who passes the same role and range checks as direct use. ===== Tutorial: trigger turns on a light ===== Use ''TTT Trigger Box'' for simple occupancy logic, then use ''TTT Enable Target'' as the receiver. ==== Receiver setup ==== - Add ''TTT Enable Target'' near the light, particle system, sound emitter, component, or GameObject you want to control. - Set ''TargetKind'' to ''Component'' or ''GameObject''. - Assign ''TargetComponent'' or ''TargetObject''. - Name the receiver object ''light_room_warning_enable''. ==== Trigger setup ==== - Add ''TTT Trigger Box'' to a trigger volume. - Leave ''Include'' as ''player'' for ordinary player occupancy logic. - Add a link under ''TargetsOnOccupied'': * ''TargetName'' = ''light_room_warning_enable'' * ''Input'' = ''Start'' - Add a link under ''TargetsOnEmpty'': * ''TargetName'' = ''light_room_warning_enable'' * ''Input'' = ''Stop'' **Important:** Avoid disabling the same GameObject, or an ancestor of the GameObject, that contains the ''TTT Enable Target''. Once the receiver disables itself, later signals may not reach it. It's alright to disable Components on the same GameObject. ===== Tutorial: elevator with call buttons ===== Use path tools when movement has more than two positions (e.g. Elevator with 3+ floors). ==== Build the path ==== - Create a GameObject for ''TTT Path Track''. - Add child objects for each floor and give each one a ''TTT Path Point''. - Set each point's ''PointName'', for example ''basement'', ''lobby'', and ''roof''. - Use ''Order'' when hierarchy order is not enough. - Enable ''ClosedLoop'' on the track only when the last point should connect back to the first. ==== Build the platform ==== - Add ''TTT Path Mover'' to the elevator platform. - Assign ''Track'' directly or use ''TrackName''. - Set ''StartPoint'' if it should begin somewhere other than the first point. - Set ''MoveSpeed'' and ''MovementCurve''. - Decide whether ''QueueRequestedStops'' should queue calls while the elevator is busy. ==== Add floor call buttons ==== For a button that always sends the platform to the roof: TTT Button TargetsOnActivated TargetName = elevator_platform Input = GoTo Payload = roof For a call/send-away button at the lobby: TTT Button TargetsOnActivated TargetName = elevator_platform Input = CallOrDepart Payload = lobby On a two-point track, ''CallOrDepart'' means “come here if away, go to the other point if already here.” On tracks with three or more points, set ''DepartureTarget'' or ''DepartureTargetName'' on the path point. ===== Tutorial: role tester room ===== Use ''TTT Trigger Role Tester'' for traitor testers, filtered chambers, or trap logic that branches by occupant role. - Add ''TTT Trigger Role Tester'' to the chamber volume. - Set ''MatchRole'' to the role/team considered a pass. - Keep ''RequireAlive'' enabled when only alive players should count. - Wire ''TargetsOnPassed'' to a green light, safe door, sound, or relay. - Wire ''TargetsOnFailed'' to a red light, alarm, trap, or lock. Mixed-role occupancy can fire both pass and fail outputs, so design tester rooms with that behavior in mind. ===== Common mistakes ===== * Forgetting the payload for ''GoTo'' or ''CallOrDepart''. * Using duplicate ''TargetName'' values unintentionally. All matches receive the signal. * Disabling the object that contains the receiver needed to turn it back on. * Testing only as host. Client-originated use should be verified too. * Forgetting collision on directly used buttons, doors, and movers. * Using a role button for generic logic when a normal ''TTT Button'' would be simpler. * Wiring spawners as receivers. Spawners are placement/reset tools, not map IO receivers. ===== Useful debug commands ===== ^ Command or ConVar ^ Use ^ | ''t.db.use 1'' | Logs direct-use rejection and activation details for pressable objects. | | ''t.db.triggers 1'' | Logs trigger occupant filtering and behavior. | | ''t.db.resetregistry 1'' | Logs reset capture and reset behavior. |