How to know if locomotive is trying to accelerate in manual control?
Posted: Sun Aug 01, 2021 11:34 am
I mean, there is "unreliable" method to check if train was moving and if it is moving now. But the problem is with for example 40 wagons this method won't work. It will think train is not trying to accelerate, because game will change train speed from 0 to 0.
How do I reliably know if train is trying to accelerate? I even thought of making key bindings to same as movement, but they are only sent once and there's no on_release event, so I wouldn't know when button is pressed anyway..
I also thought of method *is locomotive consuming fuel, compared to last frame* , but it won't give me information about direction of acceleration.
Perhaps if key was just pressed and in last frame fuel amount was bigger, then I can force train to start moving from halt, but it's very hacky way. I rely on 2 inputs to do one thing.
How do I reliably know if train is trying to accelerate? I even thought of making key bindings to same as movement, but they are only sent once and there's no on_release event, so I wouldn't know when button is pressed anyway..
I also thought of method *is locomotive consuming fuel, compared to last frame* , but it won't give me information about direction of acceleration.
Perhaps if key was just pressed and in last frame fuel amount was bigger, then I can force train to start moving from halt, but it's very hacky way. I rely on 2 inputs to do one thing.