Logo135.png We're building a new wiki, so information on this page may be out of date.

We'd love for you to help us out!

Source Pause Tool

From SourceRuns
Jump to: navigation, search

Source Pause Tool is a plugin for OrangeBox Engine games that automatically pauses the game on loads and level transitions thus allowing the player to take control of the game and start recording a demo as soon as possible (or stop a demo in the level transition case). It also contains other helpful speedrunning-related commands and tools for TASing the game.

Download

Grab the latest release from here. You can find the source code there as well. If something utterly breaks, that is also the place to complain by reporting issues.

Installation

  • Place spt.dll into the your game's directory (hl2, portal, ep2, etc.).
    For Old Engine, put spt-oe.dll in the bin directory of Source SDK Base.
    For Portal 2, put spt-p2.dll in the portal2 directory of Portal 2.
  • Enter plugin_load spt into the game console.
    For Old Engine and Portal 2, put in plugin_load spt-oe and plugin_load spt-p2 respectively.
  • Unless there are some warnings (which you can report here in case you need the functionality), everything should work!
  • Note that for plugin loading to be enabled your game should be running in insecure mode. To launch the game in insecure mode add -insecure to the launch parameters. Singleplayer games are usually not VAC-protected so launch in insecure mode by default.

Console variables and commands

Pausing

Command Parameters Default params Flags Description
y_spt_pause 0 | 1 | 2 0 FCVAR_ARCHIVE
y_spt_pause_demo_on_tick <value> 0 Invokes the demo_pause command on the specified demo tick.

Zero means do nothing.
x > 0 means pause the demo at tick number x.
x < 0 means pause the demo at <demo length> + x, so for example -1 will pause the demo at the last tick.
Demos ending with changelevels report incorrect length you can obtain the correct demo length using listdemo and then set this CVar to <demo length> - 1 manually.

y_spt_on_slide_pause_for <value> 0 Whenever sliding occurs in DMoMM, pause for this many ticks.

Movement

Command Parameters Default params Flags Description
y_spt_autojump 0 | 1 0 FCVAR_ARCHIVE
_y_spt_autojump_ensure_legit 0 | 1 1 FCVAR_ARCHIVE
y_spt_additional_jumpboost 0 | 1 0 1 = Add in ABH movement mechanic, 2 = Add in OE movement mechanic.
y_spt_canjb <height> Tests if player can jumpbug on a given height, with the current position and speed.
_y_spt_getvel Outputs the current player velocity into the console.
+y_spt_duckspam Along with its "-" counterpart presses +duck every other frame when enabled.

Looking

Command Parameters Default params Flags Description
_y_spt_setpitch <pitch> Sets the pitch.
_y_spt_setyaw <yaw> Sets the yaw.
_y_spt_anglesetspeed <value> 360 FCVAR_TAS_RESET Determines how fast the view angle can move per tick while doing _y_spt_setyaw/_y_spt_setpitch.
_y_spt_resetpitchyaw Resets pitch/yaw commands.
_y_spt_setangles <pitch> <yaw>
_y_spt_pitchspeed <value> 0 FCVAR_TAS_RESET
_y_spt_yawspeed <value> 0 FCVAR_TAS_RESET
_y_spt_force_90fov 0 | 1 0
_y_spt_getangles Outputs the view angles of the player.
y_spt_find_seam_shot <pitch1> <yaw1> <pitch2> <yaw2> <epsilon> Tries to find a seam shot on a "line" between viewangles (pitch1 yaw1) and (pitch2 yaw2) with binary search. Decreasing epsilon will result in more viewangles checked. A default value is 0.00001. If no arguments are given, first invocation selects the first point, second invocation selects the second point and searches between them.


SPT Hud

Command Parameters Default params Flags Description
y_spt_hud_velocity 0 | 1 0 FCVAR_CHEAT Turns on the velocity hud.
y_spt_hud_flags 0 | 1 0 FCVAR_CHEAT Turns on the flags hud.
y_spt_hud_moveflags 0 | 1 0 FCVAR_CHEAT Turns on the move type hud.
y_spt_hud_movecollideflags 0 | 1 0 FCVAR_CHEAT Turns on the move collide hud.
y_spt_hud_collisionflags 0 | 1 0 FCVAR_CHEAT Turns on the collision group hud.
y_spt_hud_accel 0 | 1 0 FCVAR_CHEAT Turns on the acceleration hud.
y_spt_hud_script_length 0 | 1 0 FCVAR_CHEAT Turns on the script progress hud.
y_spt_hud_portal_bubble 0 | 1 0 FCVAR_CHEAT Turns on portal bubble index hud.
y_spt_hud_decimals <value> 2 FCVAR_CHEAT Determines the number of decimals in the SPT HUD.
y_spt_hud_vars 0 | 1 0 FCVAR_CHEAT Turns on the movement vars HUD.
y_spt_hud_ag_sg_tester <value> 0 FCVAR_CHEAT Tests if angle glitchwill save glitch you.
y_spt_hud_ent_info [ent index],[prop regex],[prop regex],...,[prop regex][ent index],...,[prop regex],… FCVAR_CHEAT Display entity info on HUD.
y_spt_hud_left 0 | 1 0 FCVAR_CHEAT When set to 1, displays SPT HUD on the left.
y_spt_hud_hops 0 | 1 0 FCVAR_CHEAT When set to 1, displays the hop practice HUD.
y_spt_hud_hops_x <value> -85 FCVAR_CHEAT Hops HUD x offset
y_spt_hud_hops_y <value> 100 FCVAR_CHEAT Hops HUD y offset
y_spt_hud_oob 0 | 1 0 FCVAR_CHEAT Is the player OoB?


SPT Overlay

Command Parameters Default params Flags Description
_y_spt_overlay 0 | 1 0 FCVAR_CHEAT Enables the overlay camera in the top left of the screen.
_y_spt_overlay_type 0 | 1 | 2 0 FCVAR_CHEAT Overlay type. 0 = save glitch body, 1 = angle glitch simulation, 2 = rear view mirror.
_y_spt_overlay_portal auto | <blue | orange portal index> auto FCVAR_CHEAT Chooses the portal for the overlay camera. Valid options are blue/orange/portal index. For the SG camera this is the portal you save glitch on, for angle glitch simulation this is the portal you enter.
_y_spt_overlay_width <20 ≤ value ≤ 3840> 480 FCVAR_CHEAT Determines the width of the overlay. Height is determined automatically from width.
_y_spt_overlay_fov <5 ≤ value ≤ 140> 90 FCVAR_CHEAT Determines the FOV of the overlay.
_y_spt_overlay_crosshair_size <value> 10 FCVAR_CHEAT Overlay crosshair size.
_y_spt_overlay_crosshair_thickness <value> 1 FCVAR_CHEAT Overlay crosshair thickness.
_y_spt_overlay_crosshair_color <r> <g> <a> 0 255 0 255 FCVAR_CHEAT Overlay crosshair RGBA color.


Cvar-related

Command Parameters Default params Flags Description
y_spt_cvar <name> <value> Obtains the info about the specified convar, or sets it if the value is present. The value is the rest of the argstring, so for example y_spt_cvar name Sample Name will set the "name" cvar to Sample Name, and y_spt_cvar name "Sample Name" will set the cvar to "Sample Name".
y_spt_cvar_random <name> <min> <max> Randomize CVar value.
y_spt_cvar2 <name> <value> CVar manipulation, sets the CVar value to the rest of the argument string.


Indexing

Command Parameters Default params Flags Description
y_spt_print_ents Prints all client entity indices and their corresponding classes.
y_spt_print_portals Prints all portal indexes, their position and angles.
y_spt_find_portals <index>
y_spt_print_ent_props <index> Prints all props for a given entity index.


Experimental timer

Command Parameters Default params Flags Description
y_spt_timer_start Starts the SPT timer.
y_spt_timer_stop Stops the SPT timer and prints the current time.
y_spt_timer_reset Stops and resets the SPT timer.
y_spt_timer_print Prints the current time of the SPT timer.


Other

Command Parameters Default params Flags Description
_y_spt_tickrate <value> Gets or sets the tickrate.
_y_spt_findangle Finds the yaw/pitch angle required to look at the given position from player's current position.
y_spt_disable_fade 0 | 1 0 FCVAR_ARCHIVE When enabled disables all fades.

TAS Console variables and commands

Script commands

Command Parameters Default params Flags Description
tas_script_load <script path> [tick] Loads and executes an .srctas script. If an extra ticks argument is given, the script is played back at maximal FPS and without rendering until that many ticks before the end of the script.
tas_script_search <script> Starts a variable search for an .srctas script.
tas_script_onsuccess <command> Commands to be executed when a search concludes.
tas_script_result_success Signals a successful result in a variable search.
tas_script_result_fail Signals an unsuccessful result in a variable search.
tas_script_result_stop Signals a stop in a variable search.
tas_script_printvars 0 | 1 1 Prints variable information when running .srctas scripts.
tas_script_savestates 0 | 1 1 Enables/disables savestates in .srctas scripts.

Testing

Command Parameters Default params Flags Description
tas_test_generate Generates test data for given test.
tas_test_validate Validates a test.
tas_test_automated_validate Validates a test, produces a log file and exits the game.
tas_print_movement_vars Prints movement vars.


Strafing

Command Parameters Default params Flags Description
tas_strafe 0 | 1 0 FCVAR_TAS_RESET
tas_strafe_type 0 | 1 | 3 | 4 0 FCVAR_TAS_RESET TAS strafe types:

0 - To the left.
1 - Max angle strafing.
3 - Equivalent to holding w in a direction.
4 - Eax accel strafing with a speed cap.

tas_strafe_dir 0 | 1 | 3 3 FCVAR_TAS_RESET TAS strafe dirs:

0 - to the left,
1 - to the right,
3 - to the yaw given in tas_strafe_yaw.

tas_strafe_yaw <value> FCVAR_TAS_RESET Yaw to strafe to with tas_strafe_dir = 3.
tas_strafe_buttons <string> FCVAR_TAS_RESET Sets the strafing buttons. The format is 4 digits: "<AirLeft> <AirRight> <GroundLeft> <GroundRight>". The default (auto-detect) is empty string: "".

Table of buttons:
0 - W
1 - WA
2 - A
3 - SA
4 - S
5 - SD
6 - D
7 - WD

tas_strafe_lgagst 0 | 1 0 FCVAR_TAS_RESET If enabled, jumps automatically when it's faster to move in the air than on ground. Incomplete, intended use is for tas_strafe_jumptype only.
tas_strafe_lgagst_minspeed <value> 30 FCVAR_TAS_RESET Prevents LGAGST from triggering when the player speed is below this value. The default should be fine.
tas_strafe_lgagst_fullmaxspeed 0 | 1 0 FCVAR_TAS_RESET If enabled, LGAGST assumes the player is standing regardless of the actual ducking state. Useful for when you land while crouching but intend to stand up immediately.
tas_strafe_lgagst_min <value> 150 FCVAR_TAS_RESET Fixed lower thresholds for jumping (for Portal Glitchless.)
tas_strafe_lgagst_max <value> 270 FCVAR_TAS_RESET Fixed upper thresholds for jumping (for Portal Glitchless.)
tas_strafe_jumptype 0 | 1 | 2 | 3 1 FCVAR_TAS_RESET TAS jump strafe types:

0 - Does nothing,
1 - Looks directly opposite to desired direction (for games with ABH),
2 - Looks in desired direction (games with speed boost upon jumping but no ABH),
3 - Looks in direction that results in greatest speed loss (for glitchless TASes on game with ABH).

tas_strafe_capped_limit <value> 299.99 FCVAR_TAS_RESET Determines the speed cap while using capped strafing(type 4).
tas_strafe_hull_is_line 0 | 1 0 FCVAR_TAS_RESET Treats the collision hull as a line for ground checks. A hack to fix ground detections while going through portals.
tas_strafe_use_tracing 0 | 1 1 FCVAR_TAS_RESET Use tracing for detecting the ground and whether or not the player can unduck. Only turn off to enable backwards compability with old scripts.
tas_strafe_autojb 0 | 1 0 FCVAR_TAS_RESET ONLY JUMPBUGS WHEN POSSIBLE. IF IT DOESN'T JUMPBUG IT'S NOT POSSIBLE.
tas_strafe_afh 0 | 1 0 FCVAR_TAS_RESET Enables AFH for TASing.
tas_strafe_afh_length <value> 0.000000000
0000000001
FCVAR_TAS_RESET Magnitude of AFHs

Other

Command Parameters Default params Flags Description
tas_pause <value> 0 Does a pause where you can look around when the game is paused.
tas_force_airaccelerate <value> 0 Sets the value of airaccelerate used in TAS calculations. If empty, uses the value of sv_airaccelerate. Should be set to 15 for Portal.
tas_force_wishspeed_cap <value> Sets the value of the wishspeed cap used in TAS calculations. If empty, uses the default value: 30. Should be set to 60 for Portal.
tas_reset_surface_friction 0 | 1 1 If enabled, the surface friction is assumed to be reset in the beginning of CategorizePosition(). Should be set to 0 for Portal.
tas_force_onground 0 | 1 0 FCVAR_TAS_RESET If enabled, strafing assumes the player is on ground regardless of what the prediction indicates. Useful for save glitch in Portal where the prediction always reports the player being in the air.
tas_log 0 | 1 0 If enabled, dumps a whole bunch of different stuff into the console.
_y_spt_afterframes_await_legacy 0 | 1 0 Set to 1 for backwards compatibility with old TASes.
Personal tools