The online racing simulator
LFS Script System
(189 posts, started )
I hope we'll be able to change all control settings via scripts. It would be very useful if I could set wheel rotation for every car.
Quote :-1 for the "automatic" live settings changing

Ok, ok, I was just thinking aloud. Real F1 IS driven in that way, so it seemed logical to possibly have it in LFS only for BF1 some time in the future. It won't be in this patch, so, end of story (for now).
sry double post
If you will had script when we will need absolutely

a /bind command

for assigning the execution of a script (anyone, from fox.lfs to sayhello.lfs or rollingstart.lfs) to the pressure of a key

And maybe u can convert the F1-8 messages in F1-8 scripts where u can bind messages or another script.

Something with a sintax like

/bind key /execute this

/bind F6 /write hello

or

/bind F6 /execute hello.lfs

and in the hello.lfs file

<lfsscript>
/scriptname hello
//this is my first script!!! Woohoo!! Scawen is a noob! lol xD
/write Hi all
/write Ciao a tutti
//was joking, don't bann me lol!!! xD
<lfsscriptend>

(i mean with /write something like writeln in pascal, the cursor automatically go to the next like)
Quote from Misko :Ok, ok, I was just thinking aloud. Real F1 IS driven in that way, so it seemed logical to possibly have it in LFS only for BF1 some time in the future. It won't be in this patch, so, end of story (for now).

Sorry if I seem rude wasn't my intention. I just agree with thisnameistaken explanation of it
-
(thisnameistaken) DELETED by thisnameistaken
Having a /say command may make it too easy for people to spam other racers. For example, someone could just copy and paste the line "/say Hello world!" 500 times in one script file.
Quote from Peptis :Having a /say command may make it too easy for people to spam other racers. For example, someone could just copy and paste the line "/say Hello world!" 500 times in one script file.

And u can spam /ban command one time or 2, it will have the same effect
Quote from thisnameistaken :Well no, F1 cars aren't driven in that way. Yes they do adjust the car during the lap, but the driver does it manually. What you're suggesting would be like a two-way telemetry system, where data received at the pit wall could be used to adjust the car remotely without requiring any action from the driver (it was famously used to stop Coulthard's engine dying at Monaco one year, when it started smoking in the early laps). That was banned in F1 a couple of years ago, after only being legal for one season.

Hm ok, but I remember I read somewhere that systems in F1 cars had the ability to know on which part of the track they were and have different engine mappings for different track sections. That doesn't seem to use telemetry, but of course I don't know exactly how that works, maybe it measures distance and combines that with timing information. Hmmm I guess the same thing in LFS could be acheved already with Insim and keyboard macros if someone had knowledge and patience to try that.

@Eldanor, sorry I quoted you, your reply was just the most concise to quote, but I was actually replying mostly to Scawen's request not to request complex things at this time. This is already off-topic.
Would it be possible with this "script" to bind F1 with command "/run greenflag.lfs" to let it run commando's in sequence from greenflag.lfs which should contains something like:

/rcm GREEN FLAG !
/rcm_all
/say GREEN FLAG !

Ifso \o/ if not, might be nice

Secondly, what i would really like is to make a script that would remap buttons on my wheel the minute im in the F12 screen. To reconfigure my directional-button on my wheel to simulate the arrow keys so i could control the pit-menu (f12) with my directional-button only. Would be nice if F9-F12 would be configurable to wheel-buttons anyway from within LFS so i wouldnt have to use profiler (but perhaps this is already configurable with the /btn command).

So basicly to add "events" like "pit-menu" altho it might not really be an event trigger.

Other events like "pit-in", "pit-out", "low-fuel" would be nice aswell.
Quote from SpaceMarineITA :/bind F6 /write hello

Quote from kaspur :Would it be possible with this "script" to bind F1 with command "/run greenflag.lfs"

Setting commands on the chat-keys already works, i can't see how /run would be any different.
Quote from Scawen :Hmm, this is getting too complicated. The requests are going much too far.

"K.I.S.S"
on the topic of file extensions ... i think you should go with standard extensions like .cfg or .ini ... basically extensions people most likely will have associated to notepad

the only even ito trigger a script i can think of is pit stops (would require the ability to change the pit strategy from a script though)

Quote from Vain :Then I understood it right.

I want the line
/btn indicateleft noindicators 8
to assign controllerbutton 8 to a cycle-command so that upon the first buttonpress the left indicators start (like when we currently press "7"), upon the second buttonpress the indicators stop (like when we currently press "0") and upon the third time I press controllerbutton 8 the car starts indicating left again and so on.

the problem with this is what happens when you override the indicateleft command with a indicateright command ... the effect will be that you have 2 buttons currently assigned to noindicators
youd need ifs to make it really work
Quote from SpaceMarineITA :we will need absolutely a /bind command

/bind key /execute this

You can use /btn for this, but I dont know in how far it will work with more than 2 spacers in one line.
Maybe it's a good idea to use quotations for commands with spacers.

/bind key "/execute this"


I would like to see a command that loads a keyboard settings file when exiting pits, or when selcting the car in the carselect screen.


[EDIT]
as we have seen someone suggesting a "bind" command, its likely someone else could suggest an "alias" comment, which is often used to define a row or commands as one command (like a function).
/alias /do_something "/echo hello; echo world"

This isnt really needed because we have the /run command, so you could create a new file instead of an alias, resulting in Scawen having to do less work
I'm not really sure why we need /bind ... you can already assign any F key to "/run xxx" in Options...Game.

Or are you saying we really need a /bind command to edit the F key assignments so that a script can change the F key assignments?
Well I should have written "/btn" instead of "/bind"

My question was rather: Is it possible to use commands within a /btn assignment?

Yes, it could be used for the F keys, but you could also use it for other commands, Im specially thinking of admin commands. If you are admin, you could for example modify the event from "Shift+R" (vote restart) to the admin command "/restart".

[EDIT]
Im sorry my explanations are a bit strange, but if you knew how hot it is in my uni room here, you would understand
#41 - Vain
As I understand it the plan is to have about every function of lfs bindable via "/btn functionkeyword button". Also, if you want to issue a series of commands you can still use a btn-line like "/btn dosomething.lfs 5" and have dosomething.lfs contain the manual instructions to start what you want.
Even in a basic form the script system is very powerful.

While I'm thinking about it... Is it possible to issue ("virtual") buttonpresses from a script? Let's just imagin there is a functionkeyword missing for the suspension-view (shift+L). Then the user would want to make LFS believe that shift+L is pressed when he presses a button on his controler to toggle the suspension view.
....Just brainstorming...

Vain
@Vain: Example:
Quote from Scawen :/btn shift_up 5

is shift_up really a command, or just a "keyword"?
My thought, is it possible to be able to adjust the downforce on the fly. Press a button to increase or decrease while driving.
Quote from Hotdogxx60 :My thought, is it possible to be able to adjust the downforce on the fly. Press a button to increase or decrease while driving.

Press < or > (the less than and greater than keys)

And by the way - there is also a /ff command for controlling ff by scripts, as already detailed in a recent patch.
Quote from ORION :@Vain: Example:

is shift_up really a command, or just a "keyword"?

It's not a command, it is just a way to refer to the action of shifting up. It is not used anywhere in LFS yet apart from in the /key and /btn commands, which bind a key or a controller button to an action.
Hotdog was talkin about downforce not force feedback.

And that can be adjusted in pit stop (change from F12 menu). But all that is off-topic again... :/
What do exactly the /btn command?
SpaceMarineITA:

ATM, we can do 3 things:
/btn
assign a keyword to a button, which will do certain things, like /btn shift_up 5, which will shift up when you press button 5 on your wheel. The "shift_up" and others are predefined keywords assigned to a function, which will do certain things in LFS, which are NOT typical LFS commands you can enter in the chat. This can't be done manually - Scawen has to implement this in the code (= you cant put your own events in there).

/key
the same just with keys on the keyboard (at least I guess so)

lalala.lfs
create a file, which can excecute many different commands.

events+files
When certain events are fired in LFS, Scawen can trigger a function that will execute a file, for example "start_race.lfs", which will be executed - guess what - when the race starts. Those must be hard coded either.



Quote from Scawen :It's not a command, it is just a way to refer to the action of shifting up. It is not used anywhere in LFS yet apart from in the /key and /btn commands, which bind a key or a controller button to an action.

This was what I expected, and thus my suggestion is not senseless.
Imo it would be really nice and very powerful to assign one or more functions to one key, and not just the F-keys.

Anyway, it would be even nicer if it was possible to freely assign ALL keys on the keyboard, because with just 2 or 3 more default keys, it might become impossible for a keyboard driver to find a ergonomic way how to assign all the keys he needs.
#49 - Vain
Quote from ORION :/btn
assign a keyword to a button, which will do certain things, like /btn shift_up 5, which will shift up into 5th gear or by 5 gears. The "shift_up" and others are predefined keywords assigned to a function, which will do certain things in LFS, which are NOT typical LFS commands you can enter in the chat. This can't be done manually - Scawen has to implement this in the code (= you cant put your own events in there).

The syntax works differently:
/btn functionkeyword button
That means:
/btn shift_up 5
will make LFS shift up when you press the 5th button on your controller (e.g. wheel).

In theory
/btn horn n
would make the horn start when you press the key n. But I'm not too sure about that because Scawen made only examples where he used controllerbuttons (1,2,3,4,5...)

Vain
Ahhh now it makes sense hehe
But thats really confusing :P

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