Resource icon

[Open Assets] sloperollangle: Character Rotation on Slopes

This content may be freely modified and/or maintained by anyone.

Golden

local source code mangler
Code:
[10:56 PM] Jimita: NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
[10:58 PM] Tatsuru: Do you wanna play god? Is that what you want?
[11:04 PM] Kitoko: golden this is illegal
The name is pretty self-explanatory. This Lua rotates the sprites of players against the angle of the slope they're on. Note that this only rotates characters using the roll angle; this doesn't require new sprites.

srb20236.gif

This is also 100% compatible with multiplayer!

srb20117.gif

Download today!

Commands:
Code:
cameraroll <on/off>: Whether the camera rolling feature is enabled or not.
(Exclusive to 2.2.2 and above). Default OFF. 

cam_rollspeed <decimal>: How quickly the camera fully rolls to the slope you stand on. Default 0.1.
 

Attachments

  • srb20405.gif
    srb20405.gif
    5.3 MB · Views: 4,833
  • VL_sloperollangle-v9.1.lua
    5.6 KB · Views: 10,716
Last edited:
I'm so glad that sprite rotation is in the game now. This is awesome!

Welcome to releases!
 
Neat. I wonder how it's going to look like for ceiling slopes with flipped gravity on, or if slope physics even apply to those.
 
I've updated the script to version 2!

Changelog:
- Fixed problems with characters being incorrectly angled on slopes when vertically flipped. Thank you DerpyBubblez!
 
Last edited:
obviously this was going to be the next step in slope development. now all we need is angles facing forward/backward from the camera but that's obviously going to require way too much spriting work.
 
Honestly, once UDMF drops, this should be vanilla. It's gonna be weird to have angled scenery yet not have player sprite rotation to match.
 
cFYDk0I.png


Doesn't work quite right in splitscreen. The angles seems to be based on player 2's perspective or something.

Not a huge deal or anything, but it's worth pointing out.
 
Unfortunately this is, from my understanding, unfixable. The way this script works is modifying a variable called "mo.rollangle" to rotate everyone against the slope they stand on based on where the camera is viewing them from. This bug is unfixable (in Lua) because characters can have only one "mo.rollangle" per instance, or window of SRB2. This means that Sonic will always be angled the same on splitscreen, regardless if on Player 1's view or Player 2's view. The reason this script works within netgames is because each player in a (vanilla) SRB2 netgame is a different instance of SRB2, so each player in a netgame can be angled correctly for each player in it.

Also, the reason it shows Player 2's angled perspective is because Player 2 is processed after Player 1 within SRB2 itself, so it calculates the angles for Player 2 and shows the result on both screens.

If, however, someone were to find a way to fix this, either within sloperollangle, or within SRB2 itself, be my guest. If you fix it within sloperollangle, please send a PM so I can update it here and credit you for your work!

EDIT: Added some more contextual info.
EDIT: Correct some wording.
 
Last edited:
I've updated the script to version 3!

Changelog:
- Added support for camera rolling. Thank you Fickle!
- Added command "cameraroll"; to toggle camera rolling! (Default OFF).
- Added command "cam_rollspeed": to adjust the rolling speed of the camera. (Default 0.1).
 
Got one problem.

While trying to do an cameraroll command i noticed an error that it needs an EXE file which supports the view rolling.

I tried to use fickle's EXE file. Still got the same result
 
Got one problem.

While trying to do an cameraroll command i noticed an error that it needs an EXE file which supports the view rolling.

I tried to use fickle's EXE file. Still got the same result

You mean the latest from the mb? theres an updated file on the kart discord
i dont think you need that though, idk what you need
(wish i knew how to delete my own comment)
 
Last edited:

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top