Record in-game [bugfix]

Problem:
Sof1 crashing soon after you type ‘demo filename’ due to an unknown error

Solution:
A simple SofPlus script that starts recording a demo as soon as you enter a server, which seems to prevent crashing 🙂

 

1 – Put this line in your autoexec:

sp_sc_on_change _sp_cl_info_state “sp_sc_exec_file record_if.cfg”

 

2 – Save this as record_if.cfg and place it in your base folder

sp_sc_flow_if N cvar record == val “1” “exec record_on_connect.cfg” “echo Set record 1 and reconnect to start demo”

 

3 – Save this as record_on_connect.cfg and place it in your base folder

//this file executes each time state changes

//reset cvars
zero year
zero month
zero day
zero hour
zero min
zero sec

//refresh values
sp_sc_info_time

set filename #_sp_sc_info_time_datetime

//split+appand

sp_sc_cvar_substr year filename 0 4
sp_sc_cvar_substr month filename 5 2
sp_sc_cvar_substr day filename 8 2
sp_sc_cvar_substr hour filename 11 2
sp_sc_cvar_substr min filename 14 2
sp_sc_cvar_substr sec filename 17 2

//We have our filename YYYY-MM-DD HH.MM.SS
sp_sc_cvar_append year “-” #month “-” #day ” ” #hour “.” #min “.” #sec
set filename #year

sp_sc_flow_if N cvar _sp_cl_info_state == val 8 “record #filename; clear; echo recording” “echo Not connected yet”

Usage:
Join a server, type in console ‘set record 1’ and reconnect. You will now demo every game you play, and the files will be named automatically for you in YYYY-MM-DD HH.MM.SS format 🙂
To stop making demos each time you join a server, just ‘set record 0’ and (if already recording, type ‘stop)

Issues/bugs:
You may be required to type ‘stop’ at the end of each game, because sometimes demos overlap, which means you will lose the next games demo.
It needs people to test it, to see if it is really a fix 🙂