Sauerworld Forum

Slow motion script (useful for recording demos)

pix

  • **
  • 86
  • +9/-1
    • A Cube 2: Sauerbraten Knowledge Base by pix
Slow motion script (useful for recording demos)
« on: February 05, 2015, 12:24:22 PM »
Provides a command that uses gamespeed to increasingly slow down a game from 100 to 10 in steps of 10, and another command that speeds it back up from 10 to 100.

Use /slowmo_rate to set the rate at which to slow down: the first change in gamespeed will occur immediatly, the second change after 1 * slowmo_rate milliseconds, the next after 2 * slowmo_rate milliseconds, and so on. This means: high slowmo_rate → slow down will take long, low slowmo_rate → slowdown will be done very quickly.

/slowmo goes from gamespeed 100 to 10, /slowmo_end goes from 10 to 100.

Disable "important information" in the console options for the small console to avoid the top left console getting spammed by "gamespeed is X" messages.

Code: [Select]
_slowmo_rate = 50

alias slowmo_rate [
if (= $numargs 0) [
echo $_slowmo_rate
] [
_slowmo_rate = $arg1
]
]

alias slowmo [
loop i 10 [
sleep (* $i $_slowmo_rate) [
gamespeed (- 100 (* @i 10))
]
]
]

alias slowmo_end [
loop i 10 [
sleep (- (* 9 $_slowmo_rate) (* $i $_slowmo_rate)) [
gamespeed (- 100 (* @i 10))
]
]
]

Suicizer

  • ***
  • 141
  • +6/-5
Re: Slow motion script (useful for recording demos)
« Reply #1 on: February 06, 2015, 12:35:21 AM »
We use "=" instead of "alias" on Sauerbraten nowadays.

Next to that, nice script.
« Last Edit: February 06, 2015, 12:37:08 AM by Suicizer »