The online racing simulator
Searching in All forums
(446 results)
Krayy
S2 licensed
Quote from Fire_optikz001 :that's not what i meant .... i meant like


<?php 
IF( GetCurrentPlayerVar("Mouse") == "1" THEN
GlobalMsg
($userName." Is Using a Mouse");
ENDIF
?>


Just use the PlayFlags var add do a logical AND on it (&) against the value 1024.
Krayy
S2 licensed
Quote from nssf :no it isnt for that couse otherways i would have a massage or this topic would closed

I'd love a massage. My back is killing me.
Krayy
S2 licensed
Quote from Tim NL :Hi,

A little question how to use closeButtonRegex.

I have for example serval GlobalButtons with all ID's start with "abcxxx"

"abc001" , "abc002" , "abc003" and i want them to close them all.

I use now closeGlobalButton("abc001&abc002&abc003"); but its earier to close them all with closeButtonRegex.

I treid
closeButtonRegex( GetCurrentPlayerVar( "UserName" ), "abc.*" );
But this not working in a Lapper event.

How do i get closeButtonRegex working in a Lapper event ?? ( like in Event OnRaceStart( $NumP ) # Lapper event )

Thanks in advance

CloseButtonRegex is a Player event rather than a Lapper event, so it can't be used in any event that does not pass the UserName variable.

That being said, add this to your utils.lpr to close everyones buttons:

<?php 
Sub closeButtonRegexAll
$exp )
    
$LoP GetListOfPlayers( );
    FOREACH ( 
$Pid IN $LoP )
        
closeButtonRegex ($Pid["value"], $exp);
    ENDFOREACH
EndSub
?>


Krayy
S2 licensed
Quote from Fire_optikz001 :i tried to make a function that replaces one string for another but it only takes the first letter of the $find string
...

Nice work as a starting point, just a few things missing. Put this in the utils.lpr:


<?php 
Sub StrReplace
$String$Find$Replace )
    
$DONE FALSE;
    
$NewString $String;
    WHILE ( 
$DONE == FALSE )
        
$FindIndex indexOf($NewString$Find);
        IF ( 
$FindIndex == -)
        
THEN
            $DONE 
TRUE;
        ELSE
            
$Split1 subStr$NewString ,0$FindIndex );
            
$SplitMid strLen($Split1) + strLen($Find);
            
$Split2 subStr$NewString ,$SplitMidstrLen($NewString) - $SplitMid );
            
$NewString $Split1 $Replace $Split2;
        ENDIF
    ENDWHILE
    return (
$NewString);
EndSub
?>


This will sub whole strings as well as chars.

Call like:

<?php 
Sub DoTest7
( )
    
$testStr "Here_it_is-mate";
    
privMsg ("testStr: " $testStr);
    
$newStr StrReplace($testStr,"_"," ");
    
privMsg ("newStr: " $newStr);
EndSub
?>


Last edited by Krayy, .
Krayy
S2 licensed
Quote from Fire_optikz001 :like
  • Dont Spam
  • say sorry when you crash
ect :P

Dude,

Just for you I did a quick rewrite (and updated the attachments to the first post) to add the facility to have button groups in the tab bar. To do this, put an entry into the item list using a leading colon (check the updated gui_help.lpr attached to the first post and the screenshot for an example).

That should make things a bit more organised.
Krayy
S2 licensed
Quote from Fire_optikz001 :how would it look if i added rules to the !help? :P

What do you mean rules?
Krayy
S2 licensed
It's only for the fact that I put all the help into one file. In theory I should practice what I preach and put the help into multiple files, but I wanted to include this as an example of how to do a self contained item list rather than a multi file one. More fool me hey?
Krayy
S2 licensed
I've updated the help.lpr with the cruise help, and also rewritten part of it so that it makes it easier to add new help items. Also, if you want to change the oreder that the tabs show up in, just copy & paste the Globalvar lines for the help items until you get them the way you want e.g

Go from this:


<?php 
    
# Just reorder these lines to change order of help item tabs
    
GlobalVar $HLP_GENERAL$HLP_GENERAL $HLP_MAX$HLP_MAX $HLP_MAX  1$GUI_HELP_ITEMS $GUI_HELP_ITEMS "General,";
    
GlobalVar $HLP_STATS;   $HLP_STATS $HLP_MAX;   $HLP_MAX $HLP_MAX  1$GUI_HELP_ITEMS $GUI_HELP_ITEMS "Stats,";
    
GlobalVar $HLP_ADMIN;   $HLP_ADMIN $HLP_MAX;   $HLP_MAX $HLP_MAX  1$GUI_HELP_ITEMS $GUI_HELP_ITEMS "Admin,";
    
GlobalVar $HLP_CRUISE;  $HLP_CRUISE $HLP_MAX;  $HLP_MAX $HLP_MAX  1$GUI_HELP_ITEMS $GUI_HELP_ITEMS "Cruise,";
?>

To This:

<?php 
    
# Just reorder these lines to change order of help item tabs
    
GlobalVar $HLP_CRUISE;  $HLP_CRUISE $HLP_MAX;  $HLP_MAX $HLP_MAX  1$GUI_HELP_ITEMS $GUI_HELP_ITEMS "Cruise,";
     
GlobalVar $HLP_STATS;   $HLP_STATS $HLP_MAX;   $HLP_MAX $HLP_MAX  1$GUI_HELP_ITEMS $GUI_HELP_ITEMS "Stats,";
    
GlobalVar $HLP_ADMIN;   $HLP_ADMIN $HLP_MAX;   $HLP_MAX $HLP_MAX  1$GUI_HELP_ITEMS $GUI_HELP_ITEMS "Admin,";
    
GlobalVar $HLP_GENERAL$HLP_GENERAL $HLP_MAX$HLP_MAX $HLP_MAX  1$GUI_HELP_ITEMS $GUI_HELP_ITEMS "General,";
 
?>

to put cruise help at the top and General at the bottom
Krayy
S2 licensed
Quote from Fire_optikz001 :is it a bad thing that when i updated to your new member script that user is admin worked?

The gui_admin_member.lpr scrip defines a UserIsAdmin function that overrides any existing function of that name, so not really (at least from my perspective )
Krayy
S2 licensed
Quote from Fire_optikz001 :I must say Nice Work!

Thanks. And if you like them there are a number of user config and admin modules coming in the next week that will make you put a simley face on the end of that.
Administration GUI base & initial modules
Krayy
S2 licensed
These modules are add-ons for the gui.lpr common look & feel system and replace the Handicap and Membership administration modules.

To install, save the files to your lapper include directory, rename the files from *.lpr.txt to just *.lpr and add the following to your "addonsused.lpr" file below the include for gui.lpr:


<?php 
# Admin GUI
include ("./gui_admin.lpr");    # Admin GUI root include 
include ("./gui_admin_membership.lpr");   # Admin GUI Membership administration
include ("./gui_admin_handicaps.lpr"); # Admin GUI Handicap allocations
?>

Last edited by Krayy, .
[CODE] Common look & feel GUI with modules
Krayy
S2 licensed
NEWS!!! This lapper addon has now been superseded by the Common Interface Framework (CIF): http://www.lfsforum.net/showthread.php?t=72589

Hi guys,

This is a big update in the fact that it could make life a bit easier for us and newcomers to Lapper. Thius initial release is mainly for the framework, but I have additional modules that will be released over the next few weeks to allow a lot of Lapper admin tasks to become easier and the user experience to be a lot friendlier.

*** NOTE: This addon will ONLY work for Lapper v6.0.1.0 ***

Q. What do the main competitors for Lappers "InsIm of Choice" crown offer?
A. A common look & feel across their interface taht makes the user experience that much more underwhelming and friendly.

Q. How do we combat this?
A. See below.

This addon provides wrapper functions for the tabbed GUI system.

This can be used by scripters to create a multi-page interface that has a common look and feel so that Lapper becomes easier to use and promotes a clean style of coding to make scripts easier to edit and maintain.

New modules should follow the following naming guidelines and .lpr heirarchy to keep in sync with other available modules:

gui.lpr (this is the main module that must always exists)
|-> gui_<module_name>.lpr
|-> gui_<module_name>_<sub_module_name>lpr

Luckily, I have provided some GUI templates for you to use. So if we were creating a new module called "foo" with an item tab called bar", we would do the following:

1. Copy the base template (gui_template.lpr) to gui_admin_foo.lpr and then update any variable definitions to new names
2. Copy the mdule template ( gui_template_module1.lpr) to a new file called gui_foo_bar.lpr and update vars etc.
3. Add those filenames to the includes in addonsused.lpr, ensuring that they are listed in heirarchical order (gui_foo.lpr first, then gui_foo_bar.lpr) below the gui.lpr include
4. test it using whatever command you set (default is "!module1")

To kick things off, I have included a version of the multi-page help that uses this system, so have a look at the screenshot and the code. To install save the files to your include directory, rename them from *.lpr.txt to just *.lpr and then add the following lines to your "addonsused.lpr file" somewhere near the top, but below the utils.lpr:


<?php 
# GUI Framework main include - this MUST be first
include ("./gui.lpr");
# Help GUI
include ("./gui_help.lpr"); # Multi-tabbed help (all in one)
include ("./gui_help_cruise.lpr"); # Cruise help file (remove if not reqd)
?>

Have a look at the addons below for further examples.

*** Recent changes ***
7/7/2010 - Updated Help.lpr to include Cruise help and to be more readable and allow easy additions
7/7/2010 - Updated gui.lpr to support grouping of buttons in the tab using a leading colon on group name (see gui_help.lpr for examples)
Last edited by Krayy, .
Krayy
S2 licensed
Quote from nssf :i dont believe that i asked to talk crap......
you have no awncer on th q than dont react on it
thank you

Take a chill pill so you can recognise a joke when you see it.

And the advice about how to drive faster is, I think, quite valid. Only through practice can you get quicker. My league racers regularly hit good & great splits only through practice and racing hard against each other.
Krayy
S2 licensed
Quote from nssf :...
and 1 more thing
the minimum pb times ar so crazy hi that no1 can come into the !pb list do i need to change all those times in default>trackinfo file each after each?

I have a solution...drive faster?

But seriously, the split times are calculated as a percentage of the WR times, and even getting within 10% is sometimes a challenge, but stick with it. Watch the WR replays and learn the lines. Even the gear change points can take up to .5 off a lap. Good luck.

PS: Gai, Theoretically it would be possible for Lapper to calculate the split times on the fly using PubStat, and then we could set the threholds in Lapper itself. If you thinm it's not worth it, I might take a crack, so any thoughts you have on the best way to do it would be appreciated.
Krayy
S2 licensed
Quote from Mustangman759 :im getting this error :/ Lang : en (id notfound) any ideas? (we purchased server recently from 500 servers)

The message indicates that the Language entry for "id" does not exists. So, if your script has:

<?php 
    globalRcm
langEngine"%{main_midnight}%" ) );
?>

, then it's basically saying that you have no language entry called "main_midnight".

If you are using a variable to specify the lang entry, make sure that the var is valid (case sensitive). Also post the code around the error and we'll see what we can do
Krayy
S2 licensed
Quote from Fire_optikz001 : yay now i can fix some bugs on my cruise insim

... what vars are required for OnButtonFunction?

you didn't include it in the lpr

Oops. Put this in Lapper.lpr as a template for it


<?php 
Event OnButtonFunction
($userName$SubT# Player Event
#    DEBUG ("Button SubT for " . $userName . " is " . $SubT);
EndEvent
?>


Krayy
S2 licensed
Quote from Fire_optikz001 :will you be releasing the exe for this?

Yes, along with an extra little something that will kick yo' ass

A few more days to get the functionality set and I'll release it.
Krayy
S2 licensed
Quote from emit-nl :Hi,
A while ago, Sinanju made a post in the config help. It was about making your own buttons to choose your language of LFSLapper.



I´m now busy with making LFSLapper fully graphical and implementing it to my website. It would be great if I can also make an button in my own menu for choosing your language.

Is it possible?

Thanks!

Tim

Just use setplayervar or setcurrentplayver like this:

setcurrentplayervar("idlang", "fr"); # change to french
setcurrentplayervar("idlang", "en"); # change to english
Krayy
S2 licensed
Quote from iOL(Qc) :...
EDIT: The answer to my question is you can find all new lapperVars in changes.txt .

Also, download the source and look in the src\LFSClient\GLSPlayerVars.cs file at the top.
Krayy
S2 licensed
Lapper is a Framework, not a complete out of the box system for all types of server, but that being said, if you look at the *lpr files that come in the package, you can get some good ideas on how to use the databases (setstoreduservalue, getstoreduservalue etc) and the other events like OnFinish to allocate points, track them and check who has access to what.

Of course you will need to be able to read the scripting language, but it's fairly basic as languages go, so have a crack at starting a script and then ask us specific questions on how to do specific things and we'll do the best we can to assist.
[InSim Packets] Start Light Control/Info
Krayy
S2 licensed
I have a couple of suggestions for InSim packets to do with the start lights.

The first is a simple packet to be sent when the Green Light for a race start goes on. This could probably be just an extension of IS_FLG with a new value for a Green Flag. If this were the case, then it could also be used to notify normal racing has started after the racer exits an area of the track where a yellow flag is in effect.

The second is slightly more complex in that sometimes we wish to be able to do a staggered start, which would require using an InSim app to set each racers initial lights to red, and then manually controlling when each racer gets a green light from within the InSim app i.e. using a 2-way packet, perhaps called, IS_LGT do :
* Calculate start times and put them into an array with PLID and start time
* Send a TINY_ using that array to set individual timers
* For each racer, as their start time comes up, InSim packet gets sent for Green light and green light shown to racer.

I can actually do this in an LFSLapper script, but am left to my own devices to show the racer their lights and do the time calculations. It's messy but it (mostly) works, so no great shakes if it cannot be done. Then again, it's not exactly for the layman.
Krayy
S2 licensed
Quote from iOL(Qc) :So lfs knows when the light is'nt green yet in some way.

Its a data, why cant it be processed by the lapper like any other data?

Olivier

InSim is basically an outgoing data stream that the LFS devs wrote to encourage community involvement. It was not designed as an API or an interface to modify in-game variables or affect LFS directly. The development of the InSim functions was largely driven by community requests through the LFS Improvements forum (http://www.lfsforum.net/forumdisplay.php?f=8), but as it takes time to implement the functionality, it's been at the developers discretion as to whether a particular feature gets in.

With regards to false starts, this was addressed in the IS_PEN packet which covers the following penalties:

PENR_UNKNOWN, // 0 - unknown or cleared penalty
PENR_ADMIN, // 1 - penalty given by admin
PENR_WRONG_WAY, // 2 - wrong way driving
PENR_FALSE_START, // 3 - starting before green light
PENR_SPEEDING, // 4 - speeding in pit lane
PENR_STOP_SHORT, // 5 - stop-go pit stop too short
PENR_STOP_LATE, // 6 - compulsory stop is too late

If you're writing your own InSim app, or modifying the Lapper code (not the .lpr files, but the .cs source code), then you could probably send an TINY_MCI request to get user data sent back to your app and process it to find speed/heading etc, but why bother? The user was moving so he got penalised, and knowing if he was going 30km/h doesn't matter at all.

I suppose the biggest question to answer is "What exectly do you want to do if someone jumps the start?". Answer that and we'll tell you if it's possible.

Also, try using the tool InSim Sniffer that you run alongside the LFS Server to see what InSim packets are being sent during a race to determine what your InSim app can react to.
Last edited by Krayy, .
Krayy
S2 licensed
Quote from iOL(Qc) :If there are OnFalseStart events, lfs must know somehow in some way that the red lights are still on or that the lights have not turned green yet?

How could OnFalseStart events exists otherwise?

Olivier

The OnFalseStart events are spawned when Lapper receives a Penalty packet via InSim, so its LFS itself that determines a false start and Lapper is only responding to that event.
Krayy
S2 licensed
Quote from Bass-Driver :hi there
where can i find the sub event : Myconfig() ??
thx

MyConfig is a hard coded function inside the lapper .exe file. You can see what it does in the source code in the loop.cs file under the showConfigPlayer function
Krayy
S2 licensed
Quote from iOL(Qc) :

<?php 
Event OnGreenLight
($UserName # Possible to make this as a player Event?
WHILE (ToInt(GetCurrentPlayerFunctionReturn(GasIsPressed())) != 1)
$reactionTime StartCounting();
ENDWHILE
...
?>

Is there another way to do this, should it be in the next release or am i dreaming?

Olivier

Not in Lapper or any other InSim application I'm afraid as those are more like OutSim functions (InSim = run on the server, OutSim = run on your PC). You can see if someone is accelerating, and there is an event called OnAcceleration in the Lapper.lpr file that will get run when a user accelerates from 0 to 100km/h (configurable just above the function lines).

There is also a function OnRaceStart which runs when the race does a restart, but only runs when the grid is formed and not when the light goes green. That's a limitation of LFS, not Lapper.
FGED GREDG RDFGDR GSFDG