Page 1 of 1

[1.1.30] Movement input reset when entering spidertron

Posted: Sat Mar 27, 2021 3:23 pm
by Xorimuth
As far as I know this has been the same since 1.0.

To reproduce:

- Hold left walking towards a spidertron
- Press enter under the spidertron whilst still holding left
- Observe that the spidertron is not moving even though you are still holding left

Furthermore if you then tap up or down whilst still holding left, it will start to move left.

This behaviour is different to:
- Holding down a direction key whilst exiting the spidertron: you will continue to move in that direction
- Holding any key whilst entering or exiting a car or tank: the input will be applied to your new state immediately.

The same behaviour can be observed in my mods:
Spidertron Weapon Switcher: Spidertron stops moving when you 'switch weapons' (which is internally fast-replacing a spidertron and transferring you to the new one)
Spidertron Enhancements: Using the 'Quick toggle spidertron (U)' feature, it behaves the same as pressing enter described above (works coming out of spidertron, not going in)



From Roker on discord, referring to non-spidertron vehicles:
I am trying to transfer a player between two vehicles without the change being noticed. I've figured out everything except for the fact that the player's input is forgotten until they input something different. Ie, when the swap happens the vehicle starts coasting until the player turns/brakes/accelerates.
Since this is not referring to spidertrons, it doesn't match up with the vanilla behaviour of pressing 'enter' that I've observed above, but presumably the issue is similar but only occurs when going vehicle -> vehicle.

Re: [1.1.30] Movement input reset when entering spidertron

Posted: Sat Mar 27, 2021 6:30 pm
by Roker
Current workaround tested with cars is to check riding_state every tick and set the value to whatever it was before entering the vehicle. The values reset to neutral every tick so you can stop manually setting them once they are no longer neutral when you make the check.

This behaviour of resetting each tick appears to contradict a change made in 0.15 as per this thread.

Re: [1.1.30] Movement input reset when entering spidertron

Posted: Sat Mar 27, 2021 9:46 pm
by Xorimuth
Roker wrote:
Sat Mar 27, 2021 6:30 pm
Current workaround tested with cars is to check riding_state every tick and set the value to whatever it was before entering the vehicle. The values reset to neutral every tick so you can stop manually setting them once they are no longer neutral when you make the check.

This behaviour of resetting each tick appears to contradict a change made in 0.15 as per this thread.
Ah this isn't actually possible with spidertron because they have neither `riding_state` nor `walking_state`. It seems that they are missing `walking_state` for this purpose.

Edit: They actually use the player’s `walking_state`...

Re: [1.1.30] Movement input reset when entering spidertron

Posted: Wed Mar 31, 2021 1:28 pm
by Klonan
I don't really think this is worth looking into

Re: [1.1.30] Movement input reset when entering spidertron

Posted: Thu Apr 01, 2021 12:36 am
by Xorimuth
Oh how very peculiar, if you set LuaPlayer :: walking_state once then that is enough to keep it going in that direction as long as that key is being held down. No on_tick shenanigans are needed for spidertrons, but presumably they are still for vehicles, and the vanilla inconsistent behaviour is, of course, still observable.

Understandable if you don't feel like investigating though.