[0.15.10] Weird behaviour using "LuaControl.riding_state"

Bugs that are actually features.
Post Reply
User avatar
Arcitos
Inserter
Inserter
Posts: 38
Joined: Sat Dec 03, 2016 1:50 pm
Contact:

[0.15.10] Weird behaviour using "LuaControl.riding_state"

Post by Arcitos »

Hello devs,

i'm not sure if this is a bug or just the outcome of an undocumented change in the lua api, but in version 0.15.10 i suddenly experienced problems with my mod that sets LuaControl.riding_state to achieve automated acceleration of the player's vehicle.

Until 0.15.9 it was necessary to set the riding_state property each tick using

Code: Select all

riding_state(acceleration = defines.riding.acceleration.accelerating; direction = player.vehicle.direction)
Therefore it was unnecessary to set riding_state to nothing, as the vehicle would reset its state on its own the tick after.
Apparently this has changed: It seems that there is no longer a reset of the acceleration state to "defines.riding.acceleration.nothing" per tick, resulting in ongoing acceleration until i press one of the WASD keys (this seems to reset the riding_state). Is this behaviour intended?

How to reproduce:

- Start a sandbox world with the attached mod and give all techs
- Set "Mod-Settings/Per Player/Alternative toggle mode for cruise control" to true (this makes it easier to show the differences)
- Place a car and get in, make sure there is enough space for the car to accelerate
- Press [CTRL+O] to set the cruise control speed to 200
- Press [W] one time, the car will accelerate now
- Press [O] to disable cruise control:

-> In 0.15.9, the car will now slowly decelerate
-> in 0.15.10, the car will continue to accelerate until one of the WASD keys is pressed
Attachments
PavementDriveAssist_2.1.0.zip
affected mod (experimental release)
(109.91 KiB) Downloaded 52 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.10] Weird behaviour using "LuaControl.riding_state"

Post by Rseding91 »

That's by design. The behavior pre 0.15.10 was broken.

The riding state stays to what ever the script sets it unless the player intervenes and changes it.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Arcitos
Inserter
Inserter
Posts: 38
Joined: Sat Dec 03, 2016 1:50 pm
Contact:

Re: [0.15.10] Weird behaviour using "LuaControl.riding_state"

Post by Arcitos »

Oh ok, thanks for this information.

Post Reply

Return to “Not a bug”