Cars ‐ Extra Replay Data - ac-custom-shaders-patch/acc-extension-config GitHub Wiki

Car scripts can write extra replay data via controller inputs. This feature was added in the 0.2.3 update. Simply define a schema in the car.ini file, and then use script controller inputs to read/write data that will get stored as replay data. Try and keep the number of replay inputs low.

car.ini:

[_EXTENSION]
SCRIPT_INPUTS_REPLAY = 100:uint8, 101:unorm8, 102:half
[_EXTENSION]
SCRIPT_INPUTS_REPLAY = 100:uint8, unorm8, half, unint8 ;INDEX == 100, INDEX == 101, INDEX == 102, INDEX == 103

Replay inputs can be added in the form of <INDEX>:<TYPE>. You can also define inputs with just <TYPE>, and their INDEX will be incremented from the last explicitly defined INDEX value.

If your defined schema ever changes, any replays that were saved with the previous schema, will no longer replay the extra data that was recorded.

Car physics script.lua:

function script.update(dt)
  local data = ac.accessCarPhysics()

  -- Data written to these controllers is stored in the replay data
  data.controllerInputs[100] = 1
  data.controllerInputs[101] = 2
  data.controllerInputs[102] = 3
end
⚠️ **GitHub.com Fallback** ⚠️