Skip to main content

Capping and Route Recording

Stopwatch

TAMods offers a built-in stopwatch feature, useful for timing capping routes.

Configuration Variables

VariableTypeDefaultDescription
stopwatchStopOnCapbooleanfalseWhether the stopwatch should stop when the flag is capped
stopwatchStopOnDeathbooleantrueWhether the stopwatch should stop when the player dies
stopwatchNotificationsbooleantrueWhether to show dropdown notifications for the stopwatch on flag pickup etc.

Functions

These functions in the stopwatch namespace correspond to console commands, accessible via the Lua API to allow for keybinding.

stopwatch.start()

Start (and reset) the stopwatch.

stopwatch.stop()

End the stopwatch.

stopwatch.toggle()

Start the stopwatch if it is stopped; stop it otherwise.

stopwatch.isRunning(): boolean

Returns true if the stopwatch is running.

stopwatch.time(): float

Get the time on the stopwatch in seconds.

stopwatch.timeStr(): string

Get the time on the stopwatch as a formatted string.

State Saving

The state functions allow for the saving of specific locations on the map, and recalling / teleporting to them (in roam map only).

Configuration Variables

VariableTypeDefaultDescription
showSavedLocationsbooleantrueWhether to display markers for saved state locations in roam map

Functions

These functions in the state namespace correspond to console commands, accessible via the Lua API to allow for keybinding.

state.save()

Save the current player position into the default (first) save slot.

state.saveTo(slot: integer)

Save the current player position into the given slot (1 <= slot <= 9).

state.tp()

Teleport to the default (first) saved state, restoring position only, and refilling health and ammo.

state.tpTo(slot: integer)

Teleport to the given saved state, restoring position only, and refilling health and ammo.

state.recall()

Recall to the default (first) saved state, restoring not just position but complete state at that time (e.g. health, energy, velocity, flag status).

state.recallTo(slot: integer)

Recall to the given saved state, restoring not just position but complete state at that time (e.g. health, energy, velocity, flag status).

state.reset()

Remove all saved states.

state.setToSpawns()

Set saved states to the team's spawn locations.

Route Recording

Configuration Variables

VariableTypeDefaultDescription
routeDrawIntervalinteger500How frequently to draw markers on recorded routes, in milliseconds
routeDrawETAIntervalinteger5How frequently to draw route times, in seconds
routeDrawTransparencyfloat0.8The transparency of route markers
routeReplayRotationbooleantrueWhether to rotation the player/bot view during route replay
routeCinematicModebooleanfalseWhether to adjust route replay to be smoother

Functions

These functions in the route namespace correspond to console commands, accessible via the Lua API to allow for keybinding.

Recording

route.record()

Toggle route recording (aliased to route.rec()).

route.recStart()

Start route recording.

route.recStop()

End route recording.

route.reset()

Reset the current route. Stops any on-going recording.

Replay

Route replay is only available in roam map.

route.replay()

Toggle in-game replay of the current route.

route.replayStart(startTime: float)

Start in-game replay of the current route at the given time in the route.

route.replayStop()

Stop replay of the current route.

route.enableBot(on: boolean)

Enable or disable bot replay. If bot replay is off, replaying a route will replay from the player's perspective.

Loading / Saving

route.getAll()

Load all route files for the current map into the game.

route.getTeam()

Load only route files for the player's current team on the current map.

route.getEnemy()

Load only route file for the opposing team on the current map.

route.getTable(): List<string>

Get a Lua table containing all currently loaded route names (in the form of a 0-indexed list).

route.save(description: string)

Save the current route, with the given route name / description. Details about the map, team, player class, player name, route length etc. will be automatically saved.

route.load(routeNumber: integer)

Set the current route to the given numbered route in the listings for the current map.

route.find(regex: string)

Find loaded routes matching the given regex, and print them to the console. Aliased to route.search(regex: string).

route.list()

List all loaded routes to the console.