Skip to content

Expose loop variables to Lua (get only)

Summary

This MR exposes the loop (sonicloopvars_t) member from player_t to Lua, its variables, and subsequently the camera (sonicloopcamvars_t) member from the loop member and its variables.

This was originally something I wrote for !111 (merged) to help me figure out why loops were desyncing between players, but I figured it could just be in the game outright so scripters can know when a player is on a loop.

  • Exposes the following variables:
    • sonicloopvars_t object:
      • get: radius, revolution, min_revolution, max_revolution, yaw, origin_x, origin_y, origin_z, origin_shift_x, origin_shift_y, shift_x, shift_y, flip, camera
    • sonicloopcamvars_t object:
      • get: enter_tic, exit_tic, zoom_in_speed, zoom_out_speed, dist, pan, pan_speed, pan_accel, pan_back
    • player_t object:
      • get: loop

Testing

Demonstration: ringracers0627

Testing environment: ringracers_exposeLoopVars.exe -console -skipintro -warp RR_TESTRUN +addfile loopvars_mr.lua

I used a script, loopvars_mr.lua, to display the exposed variables.

Changelog

  • Lua: Exposed loop member from player_t as get only.

Merge request reports

Loading