The online racing simulator
Script issue [fixed in 0.6B5]
(6 posts, started )
Script issue [fixed in 0.6B5]
Hope I'm not making a fail because of some silly mistake


Little index:
1) Introduction
2) Bug explanation
3) The bug itself


1)
I have a G25, and always had the sequential and road scripts configured to redefine the shiftmode and assign the correct shifter buttons.
As I don't like using the shifter, I usually edited road cars to use sequential, like this

//run road
run sequential

that will run this to set it up
/button 9 shift_up
/button 8 shift_down

/shifter sequential
/autoclutch 1

/echo Shiftmode: Sequential


/button 6 horn

/button 5 left_view
/button 4 right_view

So far, so good.

2)
Today, I had the brilliant idea of just modify the road script. So road car will run the road.lfs script, that now has a new line added.

/button 8 gear_1
/button 9 gear_2

/shifter shifter
/autoclutch 0

/echo Shiftmode: H-Gate


/button 6 horn

/button 5 left_view
/button 4 right_view


[B]/run sequential[/B]

The idea is that after LFS runs this script, it will continue executing the sequential.lfs script and everything would be fine, right? No.

3)
- Open LFS, single player, FXO, go to track
- LFS displays "Shiftmode: H-Gate" and after that "Shiftmode: Sequential"
- BUT, controls are not updated.
- Go to garage, choose another road car (must switch car)
- LFS displays "Shiftmode: H-Gate" and after that "Shiftmode: Sequential"
- Controls are now updated.



I attach my scrips just in case they are necessary to test this.

And yes, sorry for this huge post, but I hope I've explained it well enough for anyone reading this
#2 - Mauni
Good report

I could reproduce this with your instructions, expect for me buttons and shifter type were updated, but clutch wasn't. Clutch too was updated by going to garage and back to track instantly with no car change.

Adding duplicate "/run sequential" to your road.lfs script seemed to fix the problem.

I also noticed that if there are any layout objects on track, clutch wasn't updated even with out script run inside script (i.e. just by changing from paddle shifted auto clutch car to H-gated manual clutch).
You are right, going to garage without changing car seems to solve the problem. Checking the clutch I discovered another weird thing.

- Choose XFR and exit game
- Open LFS and go on track
- Go to garage and select XRT
- You are not able to change gear
- Go to options -> Driver (MUST be driver, other menus does not update the clutch setting, though it already says it is automatic)
- Clutch updates magically and you are able to change gear
Thanks for this report. I've been tackling some of the bugs including this one. The code that handles this is a lot cleaner now.

A very simple way to reproduce the bug is to have a script like this :

/autoclutch 1
/autoclutch 0

A road car is a suitable test vehicle. Auto gear shift must not be selected. What will happen each time you run the script is that the autoclutch option will be switched on one time, off the next, on the next, and so on.

What is happening is that only the option that is different from your car's current state is causing a packet to be sent. Entering the driver options screen later sends a packet that updates the car to the correct options.

The fix now is that these option changes don't send a packet immediately on that line of code, but at the end after all the interface clicks, keys and commands have been processed.

I'll post here (and on all the other bug threads that I did a fix for) when B5 is released so you can try it out.
Nice, I'll be waiting to test this


I'm proud of myself for quoting my scripts so I don't have to rewrite them
Thank you - fixed in 0.6B5

Script issue [fixed in 0.6B5]
(6 posts, started )
FGED GREDG RDFGDR GSFDG