Official TF2C VIPR Logic Prefab v2a
The Official VIPR Logic used in 2Bridge and Drizzle
VIP Race is a new, original, exclusive gamemode for Team Fortress 2 Classic. This version of the mode, which we call "4cp VIPR" internally, was designed by @Another Bad Pun with input from @14bit, with the logic built by 14bit.
This prefab is for Team Fortress 2 Classic! This logic will NOT work in Live (normal) TF2!!!
In VIP Race (VIPR), both teams have a VIP. Official VIPR Maps contain four points: a midpoint owned by Red (labeled A), a midpoint owned by Blu (labeled B), and two Escape Zones (one owned by each team, containing the Escape Vehicle). Each team's VIP must capture the enemy mid point and Escape Zone in a single life to win; if a VIP dies, any points they captured are lost. If neither team manages to escape before time is up, Sudden Death begins. In Sudden Death, teams can win by either capturing the points like normal, or by killing the enemy VIP.
Example:
In
This prefab is for Team Fortress 2 Classic! This logic will NOT work in Live (normal) TF2!!!
VIPR HISTORY:
VIPR was first conceived on September 20th, 2017 by EMINOMA team member Magnus, with the first map being created for it by Rad on October 18th, 2017. After many attempts by many people over the years, the iteration that eventually shipped (this version) started planning by abp in early 2023, and entered development by abp and 14bit on July 16th, 2023. VIPR was first officially shown on September 15th, 2023 as part of the 2023 TF2Maps 72hr Charity Jam, and finally released with the Double Down Update (2.2.0) on January 24th, 2025.2.2 VIPR CREDITS:
- 14bit: Mode design, mode logic, HUD design, HUD programming, VIPR intro video, Civ voice line writing, VIPR Drizzle
- abp: Mode design, original prototype map, VIPR 2Bridge
- azzy: HUD programming, mode programming
- Benjamoose: Civ voice lines
- hunterbunney: Escape Zone icon, Civ voice line writing
- MaartenS11: HUD programming
- Ventrici: Civ HUD icon
HOW VIPR WORKS:
Check out this video for an overview on how the mode plays (turn on subtitles!):In VIP Race (VIPR), both teams have a VIP. Official VIPR Maps contain four points: a midpoint owned by Red (labeled A), a midpoint owned by Blu (labeled B), and two Escape Zones (one owned by each team, containing the Escape Vehicle). Each team's VIP must capture the enemy mid point and Escape Zone in a single life to win; if a VIP dies, any points they captured are lost. If neither team manages to escape before time is up, Sudden Death begins. In Sudden Death, teams can win by either capturing the points like normal, or by killing the enemy VIP.
NOTES ABOUT THE LOGIC:
- Control points resetting is handled entirely through map logic, using the OnRedVIPDeath and OnBlueVIPDeath outputs
- Civ death popups are also handled entirely through map logic
- There is a visgroup for additional logic that shows the "wrong point" warnings used on 2Bridge, if desired
- Sudden Death is also handled by this map logic, and requires the spawn door triggers to have specific names
- For the Civilian to say his "wrong car" voice lines, the Escape Zones need to have Final Capture Point Warnings enabled
- If neither team has captured mid, spawns are 7-7
- If one team has captured mid, spawns are 9-5 (in favor of who owns mid)
- If both teams own mid, spawns are 2-2 (called TURBO MODE internally)
- If a VIP dies and no points change hands, the team that killed the VIP gets a spawn time reduction
- -2 second spawn adjustment on 2Bridge, -1 second spawn adjustment on Drizzle
- VIP death spawn adjustments stack on repeated kills, but reset when any points change hands, through either capture or a VIP dying causing a reset
logic_branch_listener
and logic_branch
s in the middle of the logic to edit these values.SETTING UP THE HUD:
The new VIPR HUD can be enabled using the new "Use VIP Race HUD" keyvalue, and set the VIP Race Layout for each team, similar to how thecaplayout
keyvalue works on team_control_point_master
. The string is a list of control point indexes separated by spaces and commas that follow these rules:- Points are represented by their indexes.
- Commas leave gaps between points
- Spaces do not leave gaps between points
InputSet<team>VIPRLayout
inputs, which also works for changing the layout between stages in multistage. In the future we are planning to support having multiple teams on a single line, but that will be in a future patch. There can only be one copy of each point on the HUD at once.Example:
In
vipr_2bridge
, point 0 is Red’s point at mid that Blu must capture, and point 1 is the Escape zone for Blu in Red’s base. Likewise, point 2 is Blu’s mid point, and 3 is the Escape Zone for Red in Blu’s base. Since Red is trying to capture points 2 and 3, and we want there to be a gap left between the base and mid and for the Civ to occupy after capping point 2, the string for red_vipr_hud_layout <string>
is ,2,3
HOW THE HUD WORKS:
The Civ icon on the HUD always starts at the "Home," and attempts to move forwards. Civ icon movement is based on these rules:- The Civ icon always tries to move as far forward as possible
- The Civ icon is blocked from moving forward by any control point they do not own
- The Civ icon is moved to (and placed in front of) the point they are currently capturing, bypassing anything that would block them
- KNOWN BUG: The Civ icon cannot currently pass locked points to reach an unlocked one, we will try to fix this soon
- If a Civ finishes capping a point and cannot move any further forward, it remains on the captured point
- If the Civ is dead, the Civ Icon moves back to Home, then moves forwards based on all the above rules when the Civ spawns