The online racing simulator
LFS Script System
(189 posts, started )
It would be nice to be able to set a repeat rate for increasing/decreasing settings, maybe a good way would be to actually have a /press menuincrease <rate here> to prevent against people using it to program the perfect lap time?
I've got a couple of questions about the scripting system and how it's used with the cars. I'm 99% sure Scawen has answered these before, but I've searched like mad and can't for the life of me find any answers.

Firstly, do any of the cars actually use the sequential.txt file right now? I setup the road/sequential/paddle script files for my G25 last night, but couldn't actually find a sequential car. All of the GTR cars seem to use the road (H-shift) setup. Which cars use which transmission type?

Secondly, I remember Scawen saying something about sequential and paddle cars using driver aids like auto-blip and auto-clutch without these things being user selectable. It seems this is not the case in U20 or U22. Is this something that's supposed to be upcoming in an uncompatible patch?
The scripts paddle.lfs, sequential.lfs and road.lfs are actually not executed automatically - the only ones which does that are autoexec.lfs and CAR.lfs (replace car with the corresponding car shortcut, like XFG.lfs). But, IN these CAR.lfs you find the line "run paddle/sequential/road.lfs", so you can look into each CAR.lfs and see what shifter type that specific car is supposed to have.

Road:
XFG, XFR, XRG, XRT, XRR, RB4, FXO, FXR, FZ5, FZR, LX4, LX6, RAC, UF1, UFR

Sequential:
FOX, MRT

Paddle:
BF1, FO8
edit: nevermind my original post. I misread what you had said, Android.

So, I could basically tell ALL the cars to use paddle.txt if I wanted to, by editing the individual car files? That seems very odd. I would think that each car would have a set transmission type and that would be the end of it.
No, well... yes, the plan is that these cars have a fixed transmission type at some point. This is not yet the case, but from the current lists you can already see what car will have what transmission type.
This won't force the player to physically use that shifter type though, so you will still be able to shift a H-gate car with the paddles. The only thing it will limit is the helper-options, like some types will have auto-blip and throttle-cut enabled all the time (because you couldn't turn them off IRL).
Quote from Scawen :... So in fact, the script system is only client side at the moment (unless you have access to the host via a keyboard or InSim).

I've added it to my list.

And delivered in U23. Many thanks.
I've got two questions:

As I'm getting (hopefully soon) a G25 with a clutch pedal, how could I define a button-clutch, as I'm not intending on using the clutch for every shift (in neither sequential nor paddle-mode)... Because the autoclutch-function doesn't work with an axis-clutch... Or would it change automatically if I define a button as clutch?

And how would I delete a bind to a button/key?
I have a thought too. It's probably rubbish, but I'll leave you to be the judge of that.

As a new G25 owner, I am getting to the stage where I will want to have unique settings for some/most/all cars, but I'm far too lazy to do it all manually.

My scripts would be to configure controls, so that paddles, sequential shifters, h-shifters, TC, limiter, horn etc values are optimised for each car I drive. Would it be possible therefore to have a basic 'export controls to script' function.

Thus: I get in the XFG and setup what I consider to be my perfect control options (including auto clutch, steering linerarity, horn button etc etc). I then click 'export to script' and this is then saved into XFG.lfs. This basic file can then be editted by hand to remove unrequired commands, or to add extra functions that you have been adding recently. Then I can get in the FXO and do the same, click export, and hey presto, that car is done too forever more.

Would save some of us lazy/stupid types a lot of work, but if it's a lot of work for you then I'll understand you might not consider it.
wasn't sure if this is where i should post this, but since it seems to be with the script system, i figured this was as good as any...

so, i'm also a new g25 owner, and i set up my initial script with everything that i want defined (at least everything that i can think of right now, and get around to doing each car individually).

but anyways, when i start LFS up (U28 btw), i get an error message "autoexec: line 19 - Unknown btn function".

So, i open up my script, count to line 19, and this is the code...

button 14 reverse

if i go into a race, reverse is correctly defined. just a bug, or am i doing something incorrectly?

if it matters, here is my whole script...
// This script is run when you first reach the main entry screen
// You can use it for initialisations, running scripts, etc.

button 0 ctrl_f1
button 3 handbrake

button 4 shift_up
button 5 shift_down

button 6 right_view
button 7 left_view

button 8 gear_1
button 9 gear_2
button 10 gear_3
button 11 gear_4
button 12 gear_5
button 13 gear_6
button 14 reverse

button 15 horn
button 16 flash
button 17 rear_view
button 18 pit_speed

axis 0 steer
axis 1 throttle
axis 2 brake
axis 4 clutch

wheel_turn 900

fov 75
ff 65
view driver

Quote from glyphon :if i go into a race, reverse is correctly defined. just a bug, or am i doing something incorrectly?

OK. There's a space after reverse. Just delete that space at the end of the line.

That is a bug, the space should be ignored. Thanks, and I've made a note of the bug.
Quote from bbman :As I'm getting (hopefully soon) a G25 with a clutch pedal, how could I define a button-clutch, as I'm not intending on using the clutch for every shift (in neither sequential nor paddle-mode)... Because the autoclutch-function doesn't work with an axis-clutch... Or would it change automatically if I define a button as clutch?

Just leave autoclutch on. Autoclutch doesn't stop you using the clutch when you want to.

Quote from bbman :And how would I delete a bind to a button/key?

You can remove button or axis binds by assigning -1 to the function.
Quote from Scawen :OK. There's a space after reverse. Just delete that space at the end of the line.

That is a bug, the space should be ignored. Thanks, and I've made a note of the bug.

that took care of it. Thanks!
Quote from Scawen :Just leave autoclutch on. Autoclutch doesn't stop you using the clutch when you want to.

Well, my bad... I tested my suggestion, but forgot to actually assign an axis to the clutch, so it stayed half-depressed all the time and I didn't thought that the unassigned clutch was the reason why... Sorry...

Quote from Scawen :You can remove button or axis binds by assigning -1 to the function.

Thanks for that info! Will come in handy for my scripts...
Can this be done?

Im pressing down a button wich will mute the sound of LFS and when im pressing it again it will set the sound back

btn_press 32 mute
btn_press 32 muteoff
You should program a text key (CTRL+F1 to F12 or ALT+F1 to F12) to :

/shift N

And assign that to one of your wheel buttons. Then you will have a button that presses SHIFT+N
Quote from Scawen :You should program a text key (CTRL+F1 to F12 or ALT+F1 to F12) to :

/shift N

And assign that to one of your wheel buttons. Then you will have a button that presses SHIFT+N

sorry but thats to complicated for me ^^. Could some one write it for me? would really awsome.
Quote from zmbi :sorry but thats to complicated for me ^^. Could some one write it for me? would really awsome.

write what? a tutorial?

download patch U30 from here and then just go to the control options page ingame and click on the "alt +" button in the middle. then you choose one of the free fields on the left klick on it and enter "/shift n". after that you click on the corresponding field on the right side and press your wheel button.

what was the problem?
Quote from GeForz :write what? a tutorial?

download patch U30 from here and then just go to the control options page ingame and click on the "alt +" button in the middle. then you choose one of the free fields on the left klick on it and enter "/shift n". after that you click on the corresponding field on the right side and press your wheel button.

what was the problem?

I was tired when i wrote that. i solved it. but thanks anyway (:>*
I read the Test Patch notes and while reading through the scripts commands, something came to my head very quickly. What about a script-command to change the "Wheel/Driver"-View setting?

I mean the option in the View menu where you can set DRIVER on WHEEL on, DRIVER off WHEEL on, DRIVER off WHEEL off. I got it set to off/off (because the wheel is always partially hiding the dashboard) except for the forumula chars with the displays on the steering wheels, then I switch it from off/off to off/on all the time
The formula cars show the dash whether you have the wheel on or not.
By any chance could we have an option to export the current contol system to a script?
Pressing Shift+G i think Gearbox changes between auto/sequential/shifter, but if i change it, i have to remap 1st and 2nd gears in shifter, and gear up and down in sequential.

How can I change between seq and shifter without remaping this keys ???.

What is the sense of Shift+G if it doesn't remap this buttons ?.

Thanks
Quote from Pumuky :Pressing Shift+G i think Gearbox changes between auto/sequential/shifter, but if i change it, i have to remap 1st and 2nd gears in shifter, and gear up and down in sequential.

How can I change between seq and shifter without remaping this keys ???.

If your sequential shifter shares buttons with your H-pattern shifter then you must remap the keys. And you can do this with a script to reassign the buttons.

For example you could have an F key, say CTRL+F1 run a script like this : /run test_1

And in the file test_1.lfs (in the scripts folder) you could have something like :

/shifter sequential
/button 5 shift_up
/button 6 shift_down

And you'd do similar for CTRL+F2 : /run test_2

And a file test_2.lfs something like this

/shifter shifter
/button 5 gear_1
/button 6 gear_2

Now you can select between sequential and shifter by using CTRL+F1 and CTRL+F2 (which are assignable to a button if you like).


Quote from Pumuky :What is the sense of Shift+G if it doesn't remap this buttons ?.

Many people use the paddles for sequential and the shifter for shifter - so there is no conflict. Or maybe they have a sequential stick that doesn't conflict with the shifter "buttons".
hi me and sum friends runnin a server where we have safety car (1 player), and racecontrol.

now it is so that rc has 3 keys,

f1: "Safety Car"
f2: "Safety Car goes in pit this round" (sumthin like this lol)
f3: "Green Flag" (shortly shown)
f4: clear rcm
is it possible with script system to make the rcm blink?

like a time script? [on] [500ms pause] [off] [500ms pause] ???

couz i didnt found time stuff for scripts
Quote from MoonForce :...is it possible with script system to make the rcm blink? like a time script? [on] [500ms pause] [off] [500ms pause] ???

There isn't a timer in the scripting system and it has been requested by others.

A possible workaround - you can find macro recorders that assign keypress combinations to keys and often they allow the storing of pauses as well (the Logitech G15 kbd does this extremely well).

HTH

LFS Script System
(189 posts, started )
FGED GREDG RDFGDR GSFDG