The online racing simulator
LFS Script System
(189 posts, started )
Quote from lurendrejer :..

The only thing this script system does is send commands, there's already a way of automating commands issued on a server (Insim).
maybe a command like /combo_setup would be usefull when joniing a server.
for the first it would be enough to specify the right set for a vertain combo in a text file.
a next possible stage would be to have a button like "assign to track" or similiar.
you select an setup, click that button, and lfs ask, on which combo(s) you want to use that set.

was just an idea and has not a very high priority. though it would be nice for people like me, having 30 sets for one car.

edit:

when the command is called, the next time you join the race the setup will automaticly be chosen without having been in the garage.
maybe the setupname should be displayed as a message then?
#53 - SamH
bLaCk VaMpIrE, following on from that, perhaps LFS could look for car_track.lfs when one makes a car selection while a track is loaded. The script runs if it finds that combo setup.

Eg: I join a server running AS National and GTRs, I choose to drive the XRR and on that event, the LFS exe checks for the script combo_as3_xrr.lfs. If it finds it, it runs it. Is that what you mean? If so, then a +1 for me for that idea.
yup, thats what i meant.
but i think there should be only one file per car.
in this you can explain, on which track you want a certain setup be loaded.
maybe a default setup for tracks you didnt specify would also be usefull.
#55 - SamH
Quote from bLaCk VaMpIrE :yup, thats what i meant.
but i think there should be only one file per car.
in this you can explain, on which track you want a certain setup be loaded.
maybe a default setup for tracks you didnt specify would also be usefull.

With only one file per car, you would then need conditional arguments to set setups on a per-track basis, which if I didn't misunderstand Scawen, is more complicated or deep in than he wanted to get for the moment. With a matrix of car and track files, the only condition that needs checking is if the script file exists or not. At least.. for now
#56 - SamH
I think I've grasped the concept, considered possible events, and come up with 4 (or 5) I'd like to be able to capture.

1) "last_lap". The race leader begins his last lap. It's a pit notice, really, and would help during races where a pit is required. It's an extra bit of warning, to help avoid being disqualified. I've been disqualified a couple of times, being metres behind the race leader, who clears the finish just ahead of me when I'm a lap or 2 down. Advance warning of the imminent race end would be a bonus.

2) "car_left" and "car_right". Essentially a pit-spotter event. In cars where peripheral vision is limited, or if you drive with a narrow field of view, knowing a car is adjascent to you would help very much.

3) "low_fuel", plus value. I suppose this might be better placed as a low fuel warning light on the dash, and actually my friend has used OutGage to provide this feedback. I don't have the money that he has for an LCD panel, nor the wiring expertise or programming knowledge he has in order to author it, so capturing a low fuel event would be nice.

4) "pit_at", plus value/s. Another pitlane shout, really. Probably could be covered by #3, I mostly drive longer league races, and my fuel and pit strategies vary. It would be really useful if before beginning a race, I could programmatically plot my race as far as pit strategies are concerned. I already plot them, but to be able to program my own RCMs to warn me that a pitstop is due would be great.
You asked for ideas, and these are mine
/exit on client side does not return "You do not admin admin rights" but EXITS THE CLIENT.
Serverside scripting.
If the topic is scripting, this is ON topic.
If the topic is "which actions should cause script runs" (which it is) - this is off topic, so first things first: Sorry, but!

One thing i've really been missing is serverside scripting, eg. If somebody does something -> then do this action. Like lfslapper. Lfs-lapper does need a lot more work, but it's great.

Maybe the possibility to force setups, etc. - I'm really into these "just for kicks"-servers, like city life (cops and robbers) - but why not make it possible to do an action, like change user1's skin to bright red, if he brakes the law? (100km/h+ / hits someone / does burnouts)

A true scripting tool, serverside, would even make the Soccer-idea possible - just by running a "script" on the server.

I wouldn't want the server component to be too Call of duty'ish (YUCK!) - but their gamestate-scripting-thingie really add a lot of possibilties. And still restricts true mod'ing - but come on, please give us the possibility to spawn an AI UF1 ball on the soccerfields

But to get this post a little bit back on track, maybe i should just add, i hope we will be able to use these actions serverside too!

/kind regards, JH
Enter pit lane event, exit pit lane event (as in crossing the white / yellow line)
Then it would be awsome to have a command that can turn off or on the pit lane speed limiter.
@speed limiter command: this would make things a bit too easy I think...
Quote from St4Lk3R :@speed limiter command: this would make things a bit too easy I think...

Shh.
Quote from Dygear :Shh.

lol.
Quote from SamH :With only one file per car, you would then need conditional arguments to set setups on a per-track basis, which if I didn't misunderstand Scawen, is more complicated or deep in than he wanted to get for the moment. With a matrix of car and track files, the only condition that needs checking is if the script file exists or not. At least.. for now

I would love a wait command
please forgive me for asking this, but how do i assign the following to buttons on a DFP

any f (function) key eg f9
& shift s

thanks

Andrew
Quote from mrfell :please forgive me for asking this, but how do i assign the following to buttons on a DFP

any f (function) key eg f9
& shift s

With U13, you can assign shift S by looking at the Text Keys section in controls screen. Assign the text "/shift s" to one of those text keys, then assign that to your button. Then pressing that button will run the command "/shift s" which simulates a SHIFT+S keypress.

You can't assign F9 yet but you will in U14 I expect, you would then be able to use the command "/shift f9" to simulate a F9 press.
#66 - clp
Would it be possible to trigger a script at a prespecified time? (or a script to call another script at a specified time) or is that beyond the scope of the system (and/or possibly more suited to an insim application)?

the application i'm thinking of is in a league setting and would be used to generate race control messages at the appropriate times. eg

@7:30pm
/rcm 30 minutes until qualifying
/rcm_all

@7:45pm
/rcm 15 minutes until qualifying
/rcm_all

etc....

Cheers,
CLP
Quote from Scawen :With U13, you can assign shift S by looking at the Text Keys section in controls screen. Assign the text "/shift s" to one of those text keys, then assign that to your button. Then pressing that button will run the command "/shift s" which simulates a SHIFT+S keypress.

You can't assign F9 yet but you will in U14 I expect, you would then be able to use the command "/shift f9" to simulate a F9 press.

MANY THANKS!!
Quote from clp :Would it be possible to trigger a script at a prespecified time?

Yes. I'm pleased I didn't rush into the events with the original plan of calling specified filenames on precoded events. Because I think most events should be initialised by a script.

To take your example - a script (or text box) should be able to set using a /event command like this :

/event time 14:00 /run my_script

or

/event time 18:55 /say World Cup Final starts in 5 minutes!

So there's a /event command, and the word after that specifies what kind of even is to be initialised. Some predefined scripts should be automatically loaded, like the CAR.lfs ones, and probably an entry.lfs and a start_host.lfs which themselves can set up the /event commands.
About the / character at the start of each line.
I'm starting to think I should remove the need for the slash because it's pointless that every line needs to start with a slash. I originally thought that non slash lines could be for certain reserved keywords but it's starting to look like the /commands really are the keywords themselves.

So taking the time event example from the previous post, it would look more readable if it looked like this :

event time 18:55 say World Cup Final starts in 5 minutes!

The only time the / character would be needed is when you are typing into a text box, and that's to differentiate between a command and standard text.

I thought I'd better post this here in case you think of a good reason for every line to start with a slash. I don't want to regret that decision and have to change it further down the line when there are hundreds of scripts around.
#70 - SamH
On car setups, I wonder if this is possible:
When you load a car, LFS checks for a default car setup for that track and loads it if it's there. We could set our own default setups on a per-track basis. For example, if I'm on Blackwood and pick the XRR, LFS looks for the setup file xrr_bl1.set. If it's there, it's loaded by default.

Then, if we have a setup that we always want to run on a particular combo, we just name the setup with the track name.

I think that'd compatible. Please correct if wrong.
#71 - SamH
Quote from Scawen :I'm starting to think I should remove the need for the slash because it's pointless that every line needs to start with a slash. I originally thought that non slash lines could be for certain reserved keywords but it's starting to look like the /commands really are the keywords themselves.

So taking the time event example from the previous post, it would look more readable if it looked like this :

event time 18:55 say World Cup Final starts in 5 minutes!

The only time the / character would be needed is when you are typing into a text box, and that's to differentiate between a command and standard text.

I thought I'd better post this here in case you think of a good reason for every line to start with a slash. I don't want to regret that decision and have to change it further down the line when there are hundreds of scripts around.

Would that make it impossible to say "say"? I presume everything after the first say is treated as something to say rather than to say something... urgh, too early!

[edit] I actually like the /convention. I understand it, because it does help me to distinguish between components. It's like line-breaks in code, to me. It's just my feeling on it.
Quote from Vain :
This is a really handy way of assigning multiple actions to one button. The button sequentially triggers the function of the cycle one after another with each time I press the assigned button. This works well for indicators and the F9-F10-F12-F12 cycle.

Vain

Quote from St4Lk3R :You have cut a part out of Vains script. He suggests to overload the /button command a bit so you can make a button run different commands in a fixed order each time you press it. This could make a button run a F9 F10 F11 F12 F12 cycle.

just read this thread, here is my solution to "cycling" with current scripting implementation http://www.lfsforum.net/showthread.php?p=163767#post163767
-
(thisnameistaken) DELETED by thisnameistaken
Quote from SamH :
[edit] I actually like the /convention. I understand it, because it does help me to distinguish between components. It's like line-breaks in code, to me. It's just my feeling on it.

i'm with SamH on this one, I know very little about this sort of thing, but I know where I stand with the / commands

Andrew
Quote from Scawen :
I thought I'd better post this here in case you think of a good reason for every line to start with a slash. I don't want to regret that decision and have to change it further down the line when there are hundreds of scripts around.

i cannot think of specific situations, but imo is better to keep the "/" sign for two reasons:
1) less programming skilled people who start to learn lfs scripts, may be higly confused and make a lot of mistakes putting the slash where is not needed and skipping it when they shouldn't -> i guess it will be the top reason for issues and make forum full of threads asking why their script with correct sintax is not working
2) in principle having two different sintaxes in two different contexes is not good, let's just imagine hypotetical situations where people are developing/debugging own scripts with lfs and notepad side by side, and coping/pasting from one to another -> when i copy from notepad i must remember to add a "/" at start of the line, when doing the contrary i must add...to me, different sintaxes are only an evil source of many little problems, otherwise i don't think there will be major issues.

what i feel to suggest is to replace the "/" sign with another one (i.e. "^" wich is already an lfs special character used for colours), because is not uncommon to use the "/" when talking and since "//" is already used for comments, to type a "/" it would need to type "///" or even a more complex sintax.
maybe a sintax like <command> could be more clean and robust, but also means more typing.

btw, thanks for the scripting system! it would be very useful for us and i guess for you too
This Command Needs 2 Parameters
Just been setting up the scripts for DFP and notice this everytime i start a single player game. The only thing i can think of is i have 2 axis not calibrated, mainly because i dont know what they are.


Any ideas?

thanks

Andrew

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