Artificially induced spin height problems

Status
Not open for further replies.

742mph

My work is never done yet
Whenever I send the player into a spin on the ground using Lua, they look like they're spinning normally, but they can't roll through narrow crevices. It's as if the game doesn't really recognize that they're spinning and sets their height to what it would be if they were standing/running. Even when I try to force the player's height to what it should be with something like:
Code:
player.mo.height = P_GetPlayerSpinHeight(player)
the game sets it right back to normal the next tic, often crushing the player while they're in the crevice. I've looked at the code in p_user that handles spinning and spindashing, and even tried mimicking it almost exactly, but to no avail. Does anyone know how to fix this?
 

toaster

トースタちゃん
Kart Krew™️
Have you set player flag PF_SPINNING, or are you just setting the state to S_PLAY_ATKn?
 
Does anyone know how to fix this?
Use an earlier version of Sonic Robo Blast 2 (2.1.0 definitely doesn't set the player object height every tic). An update for some (unknown?) reason changed the player object's height to be corrected every single tic... sadly after Lua was handled. But if you want it in 2.1.14... no idea. Try looking at what that Modern Sonic Lua thing does for sliding.
 

742mph

My work is never done yet
Try looking at what that Modern Sonic Lua thing does for sliding.

As far as I can tell, Modern Sonic uses the PF_SLIDING player flag, which normally indicates that the player is on a waterslide and therefore isn't what I want. The real problem seems to be that there's something SRB2 itself does when the player enters a spin that Lua doesn't do automatically.
 

fickleheart

ms reflec beat stan
https://github.com/STJr/SRB2/blob/2b2b23efab8d5932eb31f864e11f5305fbdd54fd/src/p_user.c#L6876

Here's the exact code that determines what to set the player's height to. What's most likely happening is your character doesn't have CA2_SPINDASH, so setting on PF_SPINNING won't change their height. Maybe consider giving them that ability when you send them into a spin, and removing it when they do anything to get out of it. (If you want to be really crazy, you might be able to use code in the player hook that modifies mobjinfo[MT_PLAYER].height for every player every frame to set custom heights. On the other hand, that could also break really horribly.)

Use an earlier version of Sonic Robo Blast 2
Never give advice like this again. (Also, you're wrong. A blame on the source code shows the height setting hasn't been changed since 2.1's release or earlier.)
 
Last edited:

742mph

My work is never done yet
Unfortunately, setting CA2_SPINDASH whenever PF_SPINNING was set didn't work, so I just replaced my character's spin move with a slide and they were able to get through narrow spaces just fine. Thanks for the help anyway.
 

TelosTurntable

How the turns have tel- tab-
Use an earlier version of Sonic Robo Blast 2 (2.1.0 definitely doesn't set the player object height every tic). An update for some (unknown?) reason changed the player object's height to be corrected every single tic... sadly after Lua was handled. But if you want it in 2.1.14... no idea. Try looking at what that Modern Sonic Lua thing does for sliding.

That's fucking terrible help... you're not assisting anyone by telling them to take the easy way.
 

Sapheros

Member
That's not even the easy way... I mean, 2.1.10 is completely different from 2.1.14, and considering whatever he is doing revolves around the latest version of srb2, its not very helpful at all.
 

Mystic

Member
He was already reprimanded by a developer, not to mention he's apparently not even correct. Don't beat a dead horse into oblivion, no matter how stupid what he said is.
 
Status
Not open for further replies.

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

Top