Not sure in which lapper version 7 it started, but if you look in the ERR.log file, it now shows the password that appears in the default_1.ini file.
At least it does in my local 127.0.0.1-29999-MSS.log file. I haven't updated my server lappers yet, which are still v6 as still playing around with few things.
Extract:
2/19/2016 8:55:56 AM ----------------------------------------------------------------------------- 2/19/2016 8:55:56 AM -> Parsing config file...Ok 2/19/2016 8:55:57 AM -> Loading WR...Ok 2/19/2016 8:55:57 AM -> Loading swearwords...Ok 2/19/2016 8:55:57 AM -> Connecting to 127.0.0.1 / 29999 2/19/2016 8:55:57 AM -> LFSLapperInsimVersion 0 Connection OK 2/19/2016 8:55:57 AM -> InsimInit Lenght: password_here 19/02/2016 08:55:57 -> 2/19/2016 8:55:57 AM -> InSImReceive Thread Started... Product:S3 Version:0.6M InSim Version:7 19/02/2016 08:55:57 -> Ftp Upload grip DB Thread Started... 19/02/2016 08:55:57 -> Ftp Upload drift DB Thread Started... 19/02/2016 08:55:57 -> Web Commands Thread Started... 2/19/2016 8:55:57 AM -> 19/02/2016 08:55:57 -> 19/02/2016 08:55:57 -> LFSLapper is running... PubStat Thread Started... Register Web Thread Started...
It's the line
2/19/2016 8:55:57 AM -> InsimInit Lenght: password_here
Not my password, but it is shown where I have "password_here".
And. 'Lenght' should be 'Length'.
For security, can this line be removed, or at least the password?
If you look in the /docs folder, you'll see that Krayy did dump of these...
Player Vars in 'playerVars.txt' and 'playerInfo.txt'.
Lapper Events in 'Lapper Events.txt'.
Your 2 recent contact Events should be added to this last file.
EDIT:
Just a thought; As you're taking over lapper programming, you should apply to become 'Section moderator'.
Last edited by sinanju, .
Reason : An additional thought
Was using your updated files to do testing on something else I'm working on, with 2 AI cars on track, when I hit one, and lapper crashed.
Did it few more times to test, and lapper always crashes, then quickly restarts. I get same error message each time in my 127.0.0.1-29999-ERR error log;
Object reference not set to an instance of an object. LFSLapper at LFSLapper.LFSClient.managePacket(CON con) at LFSLapper.LFSClient.Loop(Connect insimConnection) at LFSLapper.LFSClient.doloop() at LapperInstances.LapperInstance.doConnection() Void managePacket(CON) Closing Instance... -----------------------------------------------------------------------------
As it's only an issue when local racing AI, not sure if much of a problem?
I've written an alternative, and very verbose description, using most of the 'blurb' put together by Scawen, but hopefully in a better way to make it more obvious in what order things should be done, and why.
In a Word document these instructions would fill about 3 x A4 pages.
Don't look at me either. I have no idea how to edit a wiki, and I don't have the necessary create privilages.
You have to make a text file to go with your layout, etc, but that text is only shown when you get onto 1st screen.
Its only on checking that I realised that the hashes within the file, which I thought were to replace blank lines, are actually there to fit within the Objective / Purpose / Tips that appear when you get into 1st screen of training/lesson before you hit GO.
EDIT: If I'd ready the revised instructions properly then I'd have found this out.
Screenie shows 1st para is for the Objective, 2nd for Purpose and 3rd for Tips.
Testing something else in lapper today and noticed that unless you use "All_Objects", you don't get message when hitting a 'scenery object'.
Because I don't want message when driving on concrete slabs and ramps on my skytrack layouts, I basically have long list that includes everything else but slabs and ramps, but if you use same list on a proper track, with no added Autocross objects, the only things that records a 'hit' are marker boards. This is in my list, but so are cones and tyres, and these don't get hit message when they're part of proper track scenery.
Can a 'scenery object' be added as a choice?
Of no real interest, but my list:
Also.
If you drive on a normal track with "All_Objects" enabled, you will only get message when you hit an object that can move (cones, tyres, marker boards), but not if you hit fence, wall, rubber covered barrier, and other non-moving objects.
Can a non-moving object be added?
As it's mainly needed for walls and barriers, maybe "wall barrier", "barrier wall", "wall/barrier" or "barrier/wall"? Or something else you can think of that explains better.
Wish I'd noticed your problem posts - you're way ahead in the use of the training lessons.
As the .lyt, lsn, .txt and .jpg files will all be put in the \data\training folder, these could all just be zipped up, and downloader told where they should be placed.
The difficult part for most users, due to lack of knowledge / experience, will be the need to SHIFT T into List Editor mode, and then move this downloaded Lesson up the list to the top, so it becomes the first lesson.
Not sure uploaders of lessons should be supplying downloaders with uploaders own lessons.lll file as downloader may have already added one or more training lessons into their list, and uploaders file may have non-standard lessons in it too.
I still think a separate forum section for these 'extra' training lessons should be made, and the first couple of posts could be sticky's giving step by step instructions - one on how to make your own, another if downloading (where to put files, and SHIFT T list, etc). Possibly another section for 'real' training layouts, and another for autocross event training/competition layouts, like your images.
An aide-memoir for myself - if loading lessons onto forum, best to make clear in some way what license level is required (demo, S1, S2, S3) as not all layouts will be available for all license types (not much good demo user downloading S1, S2, or S3 lessons, or S1/S2 users loading S3, etc).
"Editing the lesson list:"
Worth noting that AutoX automatically saved as Easy mode, although the difficulty can be changed to Easy, Medium or Hard by clicking the button under 'Difficulty'.
Also, AutoX automatically saved as S1 mode (no option to change). I assume because this is minimum license needed, and tracks will automatically save in mode reflecting minimum license needed, e.g. Rockingham will save as S3 mode.
My first thought (before we get into description) was that there should probably be a new Forum header for Training Lessons so that people who've made them can load for others to use. Either totally new or subset of Autocross layouts?
Your description. Likely it's me, but made little sense, and couldn't follow it.
After playing about for a while, tried making my own instructions, which were;
Design lesson layout in Autocross Editor (SHIFT U mode). Do not make layout in Rev, X or Y configurations.
Save layout.
Take screenshot of layout (preferable not with Editor enabled).
Layout will be saved in /data/layout. Manually copy and save into /data/lesson directory.
Edit screenshot and save as 512 x 512 jpg into /data/lesson directory. Saved file should start as zzz_ then 3 letter descripter, then 2 or 3 letter car type - no spaces, use underline (e.g. zzz_jum_rb4.jpg).
Make small instructions text file (.txt) explaining lesson, and save in /data/lesson directory. Where you want a line space (with no text), use slash (\), e.g.
Text file should have same name as layout name.
Select Lesson Editor (SHIFT T in main entry screen)
Click and choose from the various selections. You will need to choose;
Car Type
Track Name
Config
Layout Name
Image Name
Lesson Type
Depending on 'Lesson Type', there may be futher choices.
(Just an observation, but the black text for the various choices is almost unreadable).
This is where it all went wrong.
My newly made layout does not appear as choice in 'Layout Name' list. In fact, there are 2 choices (AU1_test and AU1_MRT_AutoX), while the lesson directory contains 6 layouts (AU1_Fast Slalom, AU1_MRT_AutoX_1, AU1_Quick Chicane, AU1_Slow Slalom, AU1_testdrive and AU1_Throttle Control#2).
Does AU1_testdrive layout = AU1_test and AU1_MRT_AutoX_1 = AU1_MRT_AutoX?
Also, my newly made and saved zzz_jum_rb4.jpg does not appear in the 'Image Name' list. Tried copying and saving that image as AU1_JumpGap.jpg, but looks like image has to start 'zzz_'.
I assume, if I could edit the Lesson Type to suit my lesson layout, the file would be saved as .lsn file, with relevant info inside (car type, track abbreviation, layout name and image name)?
And it would be this file that would be needed for the List Editor?
I meant in general; not specifically aimed at you, although item 2 is something you should be made aware of.
If you show me code you've made that looks like you've made the effort, I'll likely be happy enough to correct (assuming I know) if code not working.
Caveat: If you try 'reverse engineer' some of my stuff, I might not help if you can't get it working. Almost all my code is public, and I've given big hints on how to do other code, but I reserve the right to keep some code to myself, for my own use.
If you can come up with something original, then I might be willing to share.
You sent pm about the self-destruct message that appears when you connect to my server.
Answer:
ALL the buttons in my welcome message are set to 12 seconds long (likely when you join my server the countdown will start from 10, but the code IS 12 seconds).
The top part is the welcome message consisting of background button, text buttons, and OK button - all set to 12 seconds.
The bottom (self destruct) part consists of 3 buttons; background, text and countdown - all set to 12 seconds.
The actual timer is a light button (16) with the text string "^1%cpt%".
So, red countdown text on light button, counting down from the time set in the button code (12 seconds).
This means that when the countdown counts out, it, and all the other buttons have been on screen for their maximum alloted time, will now disappear.
No sub is required to clear these buttons/messages, because they are coded to time out anyway.
However, the OK button does have sub attached to it, in case you want to clear everything before countdown finished
If you can't work out how to do this from the very detailed clues above, then, in my opinion, you shouldn't be altering the default lapper scripts, and in future, if I answer, then I'm going to direct you to THIS post.
You can use same system to spec someone (better this than sending someone to pits, although pitting someone can be done just as easily).
I assume you know the node(s) you want to use (fetch the number using !node command)
You will have to use the RegisterNodeAction - if you don't know much about this, look at the radar_trap add-on, as well as the changes.txt file.
Within this RegisterNodeAction line of text is the sub (read THIS post about buttons that explains bit about Vars and Subs).
Assume your sub is called NodeTrigger, then your sub would look like
Sub NodeTrigger( $userName )
> Do something (needs proper lapper code here)
EndSub
The "> Do something" is likely to be open a private button with time set to 20 seconds, and possibly saying something like
spec in > %cpt% < seconds
At the end of the line, after this text, you will have another sub so when your message button counts down then times out, it triggers your new sub.
This new sub will have a line with cmdLFS within it. Lots of examples to find, so I'll leave you to search the LFSLapper.lpr and other files.
The thing you are likely to have problems with in this 2nd sub, is in the sub header line. In my 1st example - Sub NodeTrigger( $userName ) - you see $userName in brackets. The 2nd sub likely won't like this. You can try it, but you may have to experiment with nothing between the brackets, or different vars, such as
($KeyFlags,$id)
or
($KeyFlags,$userName).
This is one area, amongst many, that I only get to work by experimenting with different things. You will likely have to do the same.
Although you have specified 20 seconds, %cpt% can be set for other time periods (10, 15, etc). Haven't tested it, but as long as minutes+seconds are shown in seconds (eg 2mins10 seconds shown as 130), likely countdown should still work.
And, although you are asking for code to work with Node, almost exactly same code will work with Zone. You just need to register zone rather than node.
It seems to me that with InSims, demo users get lot more than they probably should, and this gives no incentive to become part of the LFS community (ie buy a license)
2 - I'm likely not going to give away code - instead I'll give hints (as in my post above yours).
Else, there's no incentive for lapper users to actually learn how to use lapper.
Buttons are the first thing anyone should learn about if they are new to editing the default LFSLapper ('lapper') code, or want to add their own code.
Buttons are name given by LFS to any text (whether on clear or grey coloured background) or just coloured backgrounds that appear on the screen. Every InSim, including lapper, uses same convention. LFS InSim allows a maximum of 240 buttons on screen at any time. LFS can display normal buttons in these four screens:
- main entry screen
- race setup screen
- in game
- SHIFT+U mode
Usually the first, and main thing people want to change in lapper is the 'Welcome' message when you connect to your server.
Buttons are the easiest thing to do in lapper. If you can't edit to change them, make your own, or are not willing to experiment, then my advice is to live with whatever the default code is, and tag on any additional add-ons that take your fancy, assuming you know how to add an add-on.
The first part of the standard LFSLapper.lpr file (before any code) tells you about buttons; difference between private and global, what the numbers mean regarding button size and placement, the time setting, the background colour, the text colours.
If it still makes little or no sense, then look at the Welcome message that appears on your screen when you join your server and compare that to the actual code. This Welcome message appears in the OnConnect Event.
The actual text will be in the language section at the bottom of the lapper file, where the code for a particular button will be converted to a text string, eg
main_welc1 = "^7Welcome {0} ^7to ^1LFSLapper ^7powered server !%nl%^2Type ^7!help ^2after leaving garage to see commands.";
where numbers within curly brackets (ie {0}) refer to the variable at the end of code line (in this case its the users Nickname)
and %nl% means text after this goes on new line
and the caret (^) mark with numbers in front of text define the message text colours (e.g. ^7 = white. No number or ^8 both mean light grey)
The -1 in the button code means the button will stay on screen for ever, unless a sub-routine comes up later to close that particular button.
In most cases, you will want to make private buttons, as they are used for the individual driver.
openPrivButton - used when you want individual driver to see on-screen buttons. For example, you don't want the 'Welcome' message to be Global, as everytime someone joined the server, every person already on the server will see same message.
Example of using private buttons -
openGlobalButton - used when you want everyone to see same on-screen buttons, such as an admin message.
Another way of looking at the difference is that when racing in LFS, your lap numbers and times will be private (as they only refer to laps and times you've driven), but the results table that appears at end, is Global, as every racer sees this same table.
Sometimes at the end of the line of button code, after the text, there's nothing. Sometimes you will get a single variable, or multiple variables, and others a sub-routine.
Variables are placed by using the numbers in curly brackets (as explained above), always starting with zero (0). More than one variable, then use next number {1} ...
In the Welcome message, the button called "pos" uses multiple variables.
Variables are called vars, as in PlayerVars.
The sub-routine may just be a word, or series of words without spaces, such as OnConnectClose.
A Sub-routine in lapper is called a sub.
In most cases, where there's a sub, it means that the button on screen needs pressed for it to do something. For more advanced users, you can use %cpt% to act as a timer, so that when it runs out, the sub in your button is activated.
In most cases, when you make a button, it's only displaying a message, and requires no interaction.
This 'button' may have a clear background, or a light grey background, or a darker grey background. It may just be a background with no text (in code written as ""), or it may have coloured text, which has been centred, justified left, or justified right.
For really experience users, it is possible to make coloured buttons, and even circular buttons. These are really letters and symbols blown up to huge scale.
Above image consists of 36 buttons; some with text, some without. In some bits, one button is overlaid onto another to make something appear even darker.
As you can see, buttons don't just have to give you messages!
You can get countdown buttons (explained near top of this post, using %cpt%, and you can even get buttons that change the text colour to simulate blinking, using %at% - look in the 'changes.txt' file included in the /doc directory of lapper on how to use.
Sometimes when you're reading someone's add-on code, you will see that some of the numbers you would expect to see within the button line of text has been changed to strange wording, or wording plus a number, as in
$RTorigL+1
This just means the author has made a GlobalVar, in this case called $RTorigL, which can stand for any number (up to 200) and his button is to be further left, by 1, on what he has specified. If his GlobalVar was 10, then this button would be placed at 11.
Buttons are placed in a 200 x 200 area of your screen. This area is defined by InSim, not lapper.
Extract from InSim 7 documentation regarding placement;
First number is the X heading (left to right), next number is -Y heading (you start at top of screen, and larger numbers place things further down. Next number is width of button. This number, plus X heading shouldn't add to more than 200, or your button will be placed partly off screen. Next number is height of button or text. Again, this number, plus -Y heading shouldn't exceed 200 or will disappear off bottom of screen.
Occasionally you will see in both the main LFSLapper.lpr and some people's add-on lapper scripts, that the last number (after the -1 in above examples) is not shown as a number, but as ISB_ text.
Some of these numbers/text are interchangeable.
- 16 or ISB_LIGHT for light button
- 32 or ISB_DARK for dark button
- 64 or ISB_LEFT to align text to left
- 128 or ISB_RIGHT to align text to right
GlobalVars used for placing buttons are great if you're developing a script. If you define your var and all your buttons use this var, then buttons will be placed where you wanted. If you're not happy where all these buttons land up, you just change the single GlobalVar - NO need to change relevant detail on every single button.
Most buttons that require interaction (user to click), usually have the time set to -1. When clicked, the first thing that usually needs to happen is you have to close the button that was clicked (closePrivButton / closeGlobalButton), so you will need to learn about these too. When you get more experienced, likely you'll want to start using 'closeButtonRegex' too.
When making buttons, you will tend to set a unique id for each button, such as 'welc' or 'clos' (see OnConnect section).
However, it is possible to re-use these names (might be slightly confusing if you do) - usually best if they've already closed, else they will be re-written but with different text messages.
In some of my code scripts, I do this deliberately. One of my buttons is called "hud_message". If something happens, a message appears on the hud (long button above mirror!). If something else happens, this new button with same name, but different message, will overwrite the first hud message.
Some of this may likely seem complicated. Some of it is, but I've learned how to do it because I've experimented a lot on making simple buttons, gradually getting onto more advanced buttons and advanced way of using buttons.
Note that buttons are not the only way to put just text on screen. Look at the lapper script for examples of privMsg and globalMsg. These are output at top left of screen, where you normally see messages when people write them on a server. LFS itself outputs these as global messages, as everyone on server see's them.
The buttons described above (openPrivButton, openGlobalButton, privMsg, globalMsg) is not a definitive list. There are other buttons too, including;
openPrivTextButton
privRCM
GlobalRcm
Look in the standard lapper file to see examples of how they are used.
Also, for these buttons, and most other things, read the changes.txt file in the /docs folder.
If you are going to experiment, best to do so with different copy of lapper to what you may have on your server, and this experimental copy of lapper connecting to your own pc via Multiplayer/start new host/local (visibility). Remember you need to type insim/29999 when you connect to LFS, and the password you use MUST match the password in the default_1.ini file (which can be edited in NotePad).
If you've managed to read this whole post, likely means you have the stamina to learn how to code your own buttons!
Actually, all the things he wants are things he saw on my server last night, or in one of my videos that I posted on this forum. These things have all been done on lapper, including country...$currPly["PSCountry"].
The distance code has already been supplied - he asked in another post when he saw a video I made. I made it to measure distance of the layouts I create (for no good reason I just used "Dist").
I use an IF statement for item 1 for choice between Admin (which is me) and Guest (which is everyone else). Clue: UserInGroup. But if you don't make the distinction, it's just a simple global button.
You will have to use 'cpt' to countdown. Search for this string (or %cpt%) in the changes documentation.
If you want to see the countdown in action, you can join one of my servers (Sin'rs or Sin'rs Too) - I use it to remove my 'Welcome' message when you join the server -
Is it possible to list specific concrete objects in the '$DetectHitObject' string?
I've been using Skytracks (layouts in the sky) on my servers, but in testing, I keep getting messages about 'hitting' slabs and ramps, when in fact, all I'm doing is driving on the layout.
I use ramps to make undulations, so you might go up a ramp or two, level out on a slab or two, then back down ramp(s) to level off again.
Each time I change, I get message.
In fact, when you spawn into the Start position, you land on a slab so you get a message.