The online racing simulator
LFS Script System
(189 posts, started )
LFS doesn't save the size and postition in windowed mode -
how about some script commands to set size/position of lfs-window? (or save these after quitting)

I always have to resize and move LFS windows after start - I don't use full screen, because I use a second window on bottom of desktop to display outgauge data.
Quote from -Willi- :LFS doesn't save the size and postition in windowed mode -
how about some script commands to set size/position of lfs-window? (or save these after quitting)

I always have to resize and move LFS windows after start - I don't use full screen, because I use a second window on bottom of desktop to display outgauge data.

if u use nvidia driver thats usually taken care by nview
Scawen,
I don't know if you're aware of, or are currently using, Lex and Yacc but they maybe tools of use to you, if you're considering developing a sophisticated language at some point in the future.

I also have a question;
It hasn't been implicitly said that these commands are/will be supported via "chat input", however I presume that this is the case as with all others, or are you envisaging some form of other interaction via InSim?
Quote from the_angry_angel :I also have a question;
It hasn't been implicitly said that these commands are/will be supported via "chat input", however I presume that this is the case as with all others, or are you envisaging some form of other interaction via InSim?

Hmm. I'm not sure what you mean.

The only command that differs at the moment, between its function in a script and its function in a chat box, is the double slash // - in scripts it is a comment and in a chat box it is short for /run

All script commands will work in the chat box whenever possible unless it's something script specific like a loop.
also got a question: is it now that slashes are no longer needed possible to write a command like "button 5 run myscript"?
Quote from KiDCoDEa :if u use nvidia driver thats usually taken care by nview

I use nvidia, nview V105.32 - but can't find any way to save the size/position of an applicationwindow. Any new version needed? Are u sure that this will work with lfs?
Quote from Scawen :Hmm. I'm not sure what you mean.

The only command that differs at the moment, between its function in a script and its function in a chat box, is the double slash // - in scripts it is a comment and in a chat box it is short for /run

All script commands will work in the chat box whenever possible unless it's something script specific like a loop.

You've kind of answered my question tbh. I was thinking about outsourcing some of the logic in a test program I've been playing with to an embedded lua engine, and then communicating commands to and from LFS via InSim.

Basically my train of thought has been; a lua script registers a lua function to listen for a specific event / insim packet, my program calls the lua function when it receives the relevent packet it's registered for, and then communicates back the results via insim using the InSim MsgTypePack; be it a command or normal text.
so how would it be possible to run a triggered event after a say command like in the case sam posted ?

Quote from SamH :For example: "at 19:00 say World cup final is starting! : end_race"

if i understand you correctly it should be impossible with the "everthing after a say command gets sent to the chatbox" rule

Quote from Honey :i like that goldie oldie

i guess were talking about two completely different things here
Quote from Shotglass :so how would it be possible to run a triggered event after a say command like in the case sam posted ?



if i understand you correctly it should be impossible with the "everthing after a say command gets sent to the chatbox" rule



i guess were talking about two completely different things here

At the moment you could use another script as a function, example:

//script1.lfs
at 19:00 run script2

//script2.lfs
say World cup final is starting!
end_race

Quote from -Willi- :I use nvidia, nview V105.32 - but can't find any way to save the size/position of an applicationwindow. Any new version needed? Are u sure that this will work with lfs?

you kiddin? thats what nview is for (and a whole lot more), what u mean u cant find it?
nview is a desktop management layer.
all u need is to have it activated and u can define anything PER APP.
in the nview desktop manager click the applications tab and add lfs. then define anything for it. from color profiles to window position and behaviours, monitors etc etc.
good luck
Isn't there a script like, hold light button, so that your light stays on...?
Quote from KiDCoDEa :you kiddin? thats what nview is for (and a whole lot more), what u mean u cant find it?
nview is a desktop management layer.
all u need is to have it activated and u can define anything PER APP.
in the nview desktop manager click the applications tab and add lfs. then define anything for it. from color profiles to window position and behaviours, monitors etc etc.
good luck

did u ever tested it - which version do u use?

installed version 110.27 of nview - windows 2000:
nview isn't able to start LFS - there will just be some error messages...
yes, it can start some apps, but not LFS!
nview isn't able to set size/position of windows, it can just set the monitor/desktop for windows to display on.
(attached a screenshot of nviews options for applications)
Attached images
nview.png
Quote from Shotglass :so how would it be possible to run a triggered event after a say command like in the case sam posted ?
...
if i understand you correctly it should be impossible with the "everthing after a say command gets sent to the chatbox" rule

That's really what I meant. Having the ability to do multiple things on button/keypress would reduce the need for a multitude of tiny script files each containing a function. If you wanted to make it more conversational, instead of a character to delimit commands

button 5 say Penalty shootouts destroy football!! : shift r

you could have something like:

button 5 say Penalty shootouts destroy football!! and_then shift r

Or, to really labour the point..

button 5 say RACE RESTARTS IN 10 SECONDS and_then wait 10 and_then restart_race

Quote from -Willi- :did u ever tested it - which version do u use?

installed version 110.27 of nview - windows 2000:
nview isn't able to start LFS - there will just be some error messages...
yes, it can start some apps, but not LFS!
nview isn't able to set size/position of windows, it can just set the monitor/desktop for windows to display on.
(attached a screenshot of nviews options for applications)

xp, latestest detonators (including betas).
no error msg here.
it detects it fine and u can build the individual parameters.
however, i use my lfs fullscreen always.
My tips were based on all other apps i use windowed. for example, explorer works fine, etc etc (u can test there).
Now, NVIEW DOES MEMORIZE window position and resizes (u have an option there) however, and u are right, in lfs it doesnt work.
lfs must be doing something not totally system friendly coz nview isnt grabbing its window size and position. Other than that it works.
Ill try and grab scawen for this and ask if he can do anything.
So bottomline, i was speaking of something that works but not on this specific case and ill try and make sure it does from now on.
thanks for ya request, and sorry for any misunderstanding.
My problem was solved in another thread - I change pos/size of LFS in my own app.

Thx for help
Quote from -Willi- :My problem was solved in another thread - I change pos/size of LFS in my own app.

Thx for help

what thread? what app?
I know this is kind of off-topic, but as i watch this thread grow, I'm wondering if the whole script effort might not be better served by moving the external control subsystem into a DLL. I.e. take the existing commands and the existing abilities of insim and expose them to a DLL that happens to also implement the Insim code.

Once all the control and monitoring systems are exposed in this DLL, people can either use Insim to control LFS, or another DLL implementing the same signature can replace the Insim DLL and provide the control mechanism. At that point the community could build a DLL that embeds any of free scripting languages and exposes the control and monitoring methods.

Scawen, I don't know what the exact motivation for the scripting system is, but it seems like at least a partial duplication of what's possible via insim. And writing a scripting language these days seems to be better addressed by adopting one that exists.

I'm not trying to criticize the effort, just thinking there might be a more efficient path that has bigger pay-offs for everyone down the line.
Help :(
I don't know where I'm falling down, but I am doing.

I have a DFP. In normal operations, I have the POV set to look left, right and behind. When I hit button R2 (button 6), it runs a script. The script is as follows:

/press f12
/button 32 press up
/button 34 press down
/button 35 press left
/button 33 press right
/button 6 run normalpov

I've also tried

/press f12
/button 32 up
/button 34 down
/button 35 left
/button 33 right
/button 6 run normalpov

The script "normalpov" puts the assignments back to normal (or it will once I get over this hurdle!)

In each case, I'm getting the attached errors. Can anyone tell me where I'm going wrong?

[edit]The script is supposed to temporarily change the POV to manoevre about in the F12 screen, btw.
Attached images
unknownbtn.jpg
Well you can only assign text to the CTRL+F1 to CTRL+F12 keys, then you assign those "Text keys" to a button.

/button 32 press up <-- this is simply not a valid command.

To see how it can be done, have a look at something I just posted 5 minutes ago :

http://www.lfsforum.net/showthread.php?p=173068#post173068
Quote from Scawen :/button 32 press up <-- this is simply not a valid command.

I actually only tried that after finding that:
/button 32 up
gives an error. I pasted the incorrect order of my failures

Button 6 is allocated to the text key Ctrl+F12. Ctrl+F12's text is "//cycle\ctrlf12", where cycle is the subdirectory in the scripts directory and ctrlf12 is the name of the script containing the buttons' temporary reassignments.

I just wanted to be able to dynamically reassign the POV to enable me to negotiate the menu while the F12 screen was up, and then go back to being a traditional POV after I'd done. It's okay if it can't be done. I understand the script example you link, I just wanted to achieve something slightly more on-screen while re-using buttons
Instead of :

/button 32 up

You need :

/button 32 ctrl_f12
/ctrlf 12 /press up

Hope that helps.
Quote from Scawen :Instead of :

/button 32 up

You need :

/button 32 ctrl_f12
/ctrlf 12 /press up

Hope that helps.

You, sir, are a bloody star!

For anyone else who's confused and/or interested in the full solution (and might even want to do the same thing)

Normal POV (normalpov.lfs in the script directory):-

/press f12
/button 32 ctrl_f12
/ctrlf 12 /say Hello!
/button 34 rear_view
/button 35 left_view
/button 33 right_view
/button 6 ctrl_f1
/ctrlf 1 //f12menu

POV reassigned temporarily as arrow keys when the F12 menu is called (by pressing button 6) [f12menu.lfs in the script directory]

/press f12
/button 32 ctrl_f12
/ctrlf 12 /press up
/button 34 ctrl_f11
/ctrlf 11 /press down
/button 35 ctrl_f10
/ctrlf 10 /press left
/button 33 ctrl_f9
/ctrlf 9 /press right
/button 6 ctrl_f1
/ctrlf 1 //normalpov

Thanks again Scawen. I just couldn't get my head around one minor hiccup. I appreciate the help and solution immensely!
Another tip :

In your f12menu.lfs script, you could add "press F9" as the first line (before "press F12"). That will guarantee that the f12 menu will open. Otherwise you have the problem that if F12 was already open at the time, it will close instead of open.
Nice one! Added! Thanks!!
ok, im incredibly confused, what i wanted to do was disable the pit-limiter button on my wheel for all road cars, and make it something else, make it TC for the FZ5, once i can do this i think i can do my other ideas, but i just dont get how!

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