The online racing simulator
pit control script
(15 posts, started )
pit control script
Hi guys... I'm not sure if this is the right place for this request, as I haven't delved into LFS scripting at all. I'm a programmer by trade but I don't have a clue regarding LFS. I'm going to ask here just incase it has already been done, and if not, just a quick push in the right direction would be great.

What I'm after is this (two things):
1) When I turn on the pit limiter, the F12 menu opens. Turn it off, F12 menu closes.

2) When the F12 menu opens, I want to re-assign some buttons, and assign them back when it closes. Specifically, the d-pad & buttons on my gamepad are currently set to text macros. I want them to change to allow control of the F12 menu, but to revert back once it's closed.

Thoughts?

Thanks
Well...
X is the button on your pad with which you want to enable the pit limiter and open F12.
DPAD_'s are the button numbers of your d-pad.

Replace them through the correct numbers lfs displays in the controller settings when you press the button.

Then put the following scripts in the scripts folder and change the "what you want" parts to what you want ^^

autoexec.lfs:
Quote :/ctrlf 8 /run openF12
/button X ctrl_f8

now the openF12.lfs:
Quote :/button DPAD_U ctrl_f12
/ctrlf 12 /press up
/button DPAD_D ctrl_f11
/ctrlf 11 /press down
/button DPAD_L ctrl_f10
/ctrlf 10 /press left
/button DPAD_R ctrl_f9
/ctrlf 9 /press right
/press F12
/press l
/ctrlf 8 /run closeF12
/button X ctrl_f8

and the closeF12.lfs:
Quote :/press F12
/press l
/button DPAD_U "what you want"
/button DPAD_D "what you want"
/button DPAD_L "what you want"
/button DPAD_R "what you want"
/ctrlf 8 /run openF12
/button X ctrl_f8

too easy, thanks

That single post tells me a lot about how to "script" in LFS. Thanks again
#4 - Dumpy
Good idea, and a good answer, thanks both of yous.

EDIT: This is just off the top of my head without trying it, but won't it get a little wonky when you enter the pits from the garage with pit limiter on by default, especially after entering the garage with the pit limiter off? You know, since you'll press the button and it will turn the limiter off but open the menu?
Hmm yeah probably

But that's a problem which cannot be solved throug scripting as you have no conditions and such in the system.

You could however write an insim app with outgauge and... :chairfall
would this work with say road cars that dont have a pit lane speed limiter?
sure.

And if your car has a pit limiter you have to disable it once manually if you leave the pits
#8 - Dru
Quote from DANDAMAN05 :would this work with say road cars that dont have a pit lane speed limiter?

as long as LFS recognises the pit limiter button is pressed (which it does becuase it says 'this car does not have a pit limiter' then i don't see why is should not.

However you have all these things on your dfp profile don't you dan? if not give me a buzz and i'll send you a profile through
#10 - Dru
yeah you're right about the pit thing... the logic would get flipped... i.e pressing it after pitting would turn the pit limiter off but load open F12 and the DPAD would be assigned incorrectly. hmmmmzies

I'll write the script anyway and see what can be done.
#12 - troy
I've got it working more or less, but "/press L" (upper or lowercase) does not work.
ok I'm starting to think it's not such a good idea afterall... you really don't get enough time to adjust things as you're navigating your way to the pit box.

however, the script basically does what Vain's script does... reconfigures the dpad only when in F12 mode. I think i'll extend it a bit and make my own modes much like vain's...

"race mode" dpad and buttons for simple chat emotes (default)
"setup mode" dpad for ARB, brake balance etc, with F9-12 views bound to buttons
"strategy mode" F12 view on, dpad is for altering pit strategy, plus maybe some pit chat emotes

using modes will free up some buttons so I'll use one to toggle modes, echoing them to the screen so I'm not lost.

as for these getting confused when you pit whilst under a mode... it shouldn't matter now that the pit limiter isn't being used. You can swap modes at any time.

ok so in the end no new ideas here, but I'll release the script when I'm done. Should be handy for gamepad users but useable by wheel users too.
sounds like a handy little tool

pit control script
(15 posts, started )
FGED GREDG RDFGDR GSFDG