The online racing simulator
Searching in All forums
(104 results)
drew555
S2 licensed
Brilliant. Thank you.

And a strange one now...

I'm using code that's tested on a remote host using this:

Quote : InSim.Send_BTN_CreateButton("^7BLAMMO!", Flags.ButtonStyles.ISB_LIGHT, 4, 30, 135, 4, 019, (Connections[GetConnIdx(Players[GetPlyIdx(AXO.PLID)].UniqueID)].UniqueID), 2, false);

And it works fine (if a little slow, we assume it's something to do with AXO packets perhaps being delivered slowly).

However.. on my local host it just wont do it - and InSim sniffer doesn't report any AXO packets.

Have I missed a setting or a checkbox somewhere?
Last edited by drew555, . Reason : Forgot the code... duuuh...
drew555
S2 licensed
Ta daaa!

But I don't know what's happened to the formatting....
drew555
S2 licensed
Thank you - you can delete this thread now if you like....

Here's what I did in case someone else does it....

I went into Project > Properties

and changed the assembly name - believing it would just rename everything that needed it.

I was wrong.

I've now lucked out and fixed it.

Embarassed
HELP! I'm panicking... [link error after renaming]
drew555
S2 licensed
I was really getting somewhere, and I did a stupid.

I was trying to rename my program.. and now I'm getting this error at build time -

Quote :The type or namespace name "LFS_External" not found

And this one....

Quote :The type or namespace name "Flags" not found

And this one...

Quote :The type or namespace name "Enums" not found

And this one...

Quote :The type or namespace name "Packets" not found

The first of the errors (of 58) is centered on this line...

Quote :using LFS_External;

I'm assuming that I've accidentally renamed a file that I shouldn't have.

And now I'm panicking, because I have hours of work in this

It works fine when debugging - but come build time it has a fit.

I don't know how to fix it.

Help plz

:edit:

I'm using Visual Basic Express 2008, and the base Insim v1.0.3
drew555
S2 licensed
For now - this is as far as I can go.

It's not quite finished - just a release candidate pending a few changes.

There will be a finished, polished version of this along with part 2 etc. as I acquire the necessary knowledge.

Could a few people who know this stuff please have a read through to make sure I'm not just talking crap?

It'd also be nice if you could point out anything obvious I've missed.

Thank you
drew555
S2 licensed
Still on ther same subject - that piece of code Maruis just posted works for !case wirth no problems at all.

And when the same syntax was used for car reset it worked also.

But with an autocross object - it doesn't.

I replaced the event trigger code (MSO) with the one the InSim.txt lists as AXO and nothing happens. No errors, but no action either.

Obviously there are rules governing the use of these codes - where you can use it in a basic form such as (NCN.UCID) and where you need the more complicated version such as (Connections[GetConnIdx(MSO.UCID)].UniqueID)

What are the rules for this I am missing?
drew555
S2 licensed
Quote from MariusMM :(Connections[GetConnIdx(MSO.UCID)].UniqueID)

One day I'll figure out what that bit is and what it does

Thanks Marry
drew555
S2 licensed
Right, now I've sucessfully reinstalled, I have more questions.

This is a case issue.

I know it's possible to have a command open a button (!gui does it on lapper) but I'm missing something.

I have this:

Quote :case "!arr":
InSim.Send_MST_Message("I'm a PIRATE!");
InSim.Send_MST_Message("and I say G'arrrr!");
break;

and it's fine.

So, I thought I'd push it a bit and used this...

Quote :case "!button":
InSim.Send_BTN_CreateButton("^1Made this button with !button!", Flags.ButtonStyles.ISB_LIGHT, 7, 66, 2, 67, 0014, (MSO.UCID) 2, false);
break;

And it's telling me:

Quote :Error 1 The type or namespace name 'MSO' could not be found (are you missing a using directive or an assembly reference?)

Now, I've seen this error a few times - and I have no idea what it means.

Is it something basic and obvious? Am I showing my n00b status?
drew555
S2 licensed
If I spot any errors - I'll point 'em out
drew555
S2 licensed
Today I celebrated Gai's birthday
drew555
S2 licensed
Feel free to say 'bog off n00b' if you like, but I thought I'd share what I've learnt in the last few days.

This is for ABSOLUTE beginners to C#, and is FAR from complete.

I'm posting it in it's unfinished state because I don't want to finish it with total inaccuracies - so feel free to rip it to shreds - and when it's finished I'll add a thanks section on the end mentioning everyone who contributed

I'd have killed for a guide like this when I started - in fact, if anyone has a finished one I'd still love to have it
Last edited by drew555, . Reason : Removed obsolete n00b guide.
drew555
S2 licensed
lol, you know a shed load more than me!

I'm using the base InSIm template that's avaliable here - and hammering the hell out of it as I learn - while also making my own .txt guide as I go along, with info stolen from whoever will have the patience to help!

Therefore I assume that MCI packets are enabled 'by default', and that a time interval is already specified.

Now I need to figure out where in the program this is specified, play with it and try to figure it out.

So.... if I have the MCI packets set to be sent every 1 second for example and have a command in the script that says something like:

Quote :Whenever an MCI packet is recieved, look up the variable 'Speed' and display it on a button.

Or...

Quote :private void MCI_CarInformation(Packets.IS_MCI MCI) <<On recieving an MCI packet?
{
InSim.Send_BTN_CreateButton("MCI_"Speed", Flags.ButtonStyles.ISB_LIGHT, 7, 66, 2, 67, 0010, Connections[GetConnIdx(Players[GetPlyIdx(MCI.PLID)].UniqueID)].UniqueID, 2, false);
}

Where: On recieving an MCI packet, make a button, take from this packet of this part and display to this player?

I invented this - so is probably totally wrong - any clarification is gratefully recieved (in n00bspeak if at all possible ).
drew555
S2 licensed
So..... if I add something like:

Quote :const BID_WHATEVER = 10

...in my form1.cs file (in a specific place?), I can use BID_WHATEVER to call upon the value of '10'?

Or the other way round, using the value of '10' to call upon the value of 'BID_WHATEVER' or the value of 'WHATEVER'?

Working the same way as ISB_DARK for example?

Can you throw up a quick example please Elmo - I learn better by being shown
drew555
S2 licensed
Quote from Gai-Luron :Work in progress , be patient

www.lfs-lapper.org/help/en

I didn't know about that... Thank you

drew555
S2 licensed
Didn't work - in fact, it stopped my LangEngines working, lol.
drew555
S2 licensed
Another one

I have had a look through the documentation I have - and can't find what I'm looking for.

This part:

$DriftDatabase = "./DriftPB";
$MinimumDriftSpeed = 30; # Minimum speed in km/h to maintain. Driving below that speed will reset score
$MinimumDriftAngle = 15; # Minimum angle to maintain. When angle is below value, score is reset
$MaximumDriftAngle = 210; # Maximum angle to maintain. When angle is above value, score is reset

Is there somrthing in Lapper that allows me to perform an action on drift score reset - perhaps something like OnDriftScoreReset:

Quote :Event OnDriftScoreRest( $userName ) # Player event
openPrivButton( "resetscore",50,5,100,7,10,10,0,"SCORE RESET");
EndEvent

In fact, I'll try that and see what happens
drew555
S2 licensed
Quote from Gai-Luron :It's impossible to have a wait in an event because if you do that, you stop LFSLapper waiting.
Use blinking button for now


ISB_BLINK and ISB_DARK are constant defined in const.lpr. Take a look at this file


You can use privdelayed command to do that but is very complicated and no very usefull.

Awesome! Thank you

Quote from sinanju :Buttons and what your line means
openPrivButton is for only driver to see, as against opening a global button for all to see (such as you'd get when race just about to start, etc)
drewpitleave05 is unique button id
50 left out of 200
12 down from top out of 200
100 is width of button
10 is height of button
10 is spacing in multiline text
1 is time in seconds button will appear (use -1 if you don't want button to disappear - or use sub routine to close it)
32 is the background colour and orientation (clear, light or dark, with text left, centred or right)
^1 is the colour of the text on the button (in this case Red [see LFSlapper.lpr file for info on what colour is which])
! REMEMBER is the text that will appear on button.

So if you want button (or in this case, proper word would be label) to appear for 5 seconds, you would have

I had that bit sorted - but thank you anyway

Quote from sinanju :Fairly recently, Gai introduced the option for text to flash, so instead of the 32 after your time, use 40, and so you would now have

See how you get on with it.

Experiments are GO!

Quote from Gai-Luron :For you colored button, this is the code who work, but you need to change to version 5.9.1.6 ( fixed one bug in delayed command )

CatchEvent OnNewPlayerJoin( $userName ) # Player event
GlobalVar $CurrRotation;
$CurrRotation = 0;
Color1( $userName );
EndCatchEvent
Sub color1( $userName )
openPrivButton( "drewpitleave02",50,12,100,10,10,-1,32,"^1R E M E M B E R !" );
privDelayedCommand( 1,color2 );
EndSub
Sub color2($userName)
openPrivButton( "drewpitleave02",50,12,100,10,10,-1,32,"^7R E M E M B E R !" );
$CurrRotation = $CurrRotation + 1;
IF( $CurrRotation < 5 ) THEN
privDelayedCommand( 1,color1 );
ELSE
ClosePrivButton( "drewpitleave02" );
ENDIF
EndSub


I'll look into upgrading, thank you

Quote from Gai-Luron :You have also this, but is BEUUURRRKKK

With this new information, that code is going bye byes

Thank you all for your patience
drew555
S2 licensed
Thank you

Here's the revised code:

Quote : InSim.Send_BTN_CreateButton("^7BLAMMO!", Flags.ButtonStyles.ISB_LIGHT, 10, 65, 5, 67, 30, Connections[GetConnIdx(Players[GetPlyIdx(AXO.PLID)].UniqueID)].UniqueID, 2, false);

Still not happening

Oh.. and BTW, I have other buttons, example:

Quote : InSim.Send_BTN_CreateButton("^1You reset your car... ^7PANSY!", Flags.ButtonStyles.ISB_LIGHT, 7, 66, 2, 67, 0010, Connections[GetConnIdx(Players[GetPlyIdx(CRS.PLID)].UniqueID)].UniqueID, 2, false);

Using 4 figure button IDs and they work fine

I'd like to be able to use letters in there too
drew555
S2 licensed
Kind of related...

I'm after changing the colour of a message in a button between 2 colour variations.

Here's the initial coding...

Quote :Event OnNewPlayerJoin( $userName ) # Player event
openPrivButton( "drewpitleave01",50,12,100,10,10,1,32,"^1R E M E M B E R !" );
wait (1);
openPrivButton( "drewpitleave02",50,12,100,10,10,1,32,"^7R E M E M B E R !" );
wait (1);
openPrivButton( "drewpitleave03",50,12,100,10,10,1,32,"^1R E M E M B E R !" );
wait (1);
openPrivButton( "drewpitleave04",50,12,100,10,10,1,32,"^7R E M E M B E R !" );
wait (1);
openPrivButton( "drewpitleave05",50,12,100,10,10,1,32,"^1R E M E M B E R !" );
wait (1);
openPrivButton( "drewpitleave06",50,12,100,10,10,1,32,"^7R E M E M B E R !" );
wait (1);
openPrivButton( "drewpitleave07",50,12,100,10,10,1,32,"^1R E M E M B E R !" );
EndEvent

I feel that if I can get the wait (1) (bad paracoding) command right - this might give me a message that flashes for 5 seconds.

I've read this thread - but don't seem to see anything that does what I want
drew555
S2 licensed
Request - a depository for documentation

Somewhere with lists of all the usable commands and suchlike - maybe just a collection of all the documentation created for all the variations of lapper.

LFSLapper.lfs has a good one at the beginning - but it doesn't seem to cover all of the avaliable commands and variables- and what they do.

Might stop a lot of frustration for people who are brand new to lapper.

Might be a good idea.
drew555
S2 licensed
Thanks Gai, I'll have an experiment with that and get back to you
Extracting and displaying car info (C#)
drew555
S2 licensed
Simple question - with probably a very complicated answer

I want to extract car data from LFS (for instance, vehicle speed) and display it on the screen.

I think I've found the bit in InSim.txt that refers to the vehicles speed - it says that the IS_MCI packet contains an array of data including..

Quote :word Speed; // speed (32768 = 100 m/s)

The idea is something like this...

InSim.Send_BTN_CreateButton > Speed in real(ish) time.

I assume that the MCI packet is sent on a regular basis - and I think I want to be extracting the Speed value from the MCI?

How do I go about grabbing this data from LFS and displaying it?
drew555
S2 licensed
Yeah, I'm back

Probably very basic stuff, but I'm a little stuck.

I have a pop up button that happens when a player resets their car - and it works:

Quote :InSim.Send_BTN_CreateButton("^1You reset your car...", Flags.ButtonStyles.ISB_LIGHT, 7, 66, 2, 67, 0010, Connections[GetConnIdx(Players[GetPlyIdx(CRS.PLID)].UniqueID)].UniqueID, 2, false);

And I wanted one that did the same on hitting an Autocross object (in this case - a cone), so I used this:

Quote :InSim.Send_BTN_CreateButton("^7BLAMMO!", Flags.ButtonStyles.ISB_LIGHT, 10, 65, 5, 67, 0012, Connections[GetConnIdx(Players[GetPlyIdx(AXO.PLID)].UniqueID)].UniqueID, 2, false);

I assume this bit is wrong:

Quote :Connections[GetConnIdx(Players[GetPlyIdx(AXO.PLID)].UniqueID)].UniqueID

But have no idea why it's wrong.

There's no errors when debugging - it just doesn't do it.

Any ideas?
drew555
S2 licensed
I'm all over it like a cheap suit.

I actually binned the open source cruise InSim - there was like waaaaay loads in there, and it just ended up confusing me.

I ended up downloading the base InSim and am going from there, using the open source cruise server for reference.

Seems to be working OK so far - with a little help from someone in MSN who's a little further down the road than me - thanks Maruis mwah.

I've got a couple of buttons on the go - now it's just patching up the differences between c# and GLScript...

Advice? Start with Lapper After that, C# is so much easier to digest.

Anyone have any good links to cheat sheets?

What I'm after now is something like Gai Luron has in the beginning of the Lapper scripts, basically giving me enough innformation to really get it badly wrong
Brand Newb C# / Visual C# 2008 Express help
drew555
S2 licensed
Hullo.

I've been playing with Lapper (basically just ripping the code to bits and making it up as I'm going along when I'm not annoying Gai) and I've kinda gotten myself a hankering for making my own InSim app.

In fact, any kind of app

I am not even close top a programmer - but... I have downloaded the Open Source Cruise InSim app along with Microsoft Visual C# 2008 Express and want to hack about with it and asee what the crack is.

I'll be playing with it and learning as I go, using tutorials I find on the web and on here begging for help no doubt.

Here's where I ask you for your help

I need a push in the right direction - and the direction I need is the one in which I can edit the source files and recompile them into something I can run so that I can see my changes.

There are lots of files, and talk of Solutions and suchlike, and I'm a bit lost in it all.

I'd love to learn how to do this properly - but at the moment I want to play with it before I try to learn it the proper way - I intend to learn by editing and progress as I can.

So folks, who's feeling helpful?

Which files do I need to edit to change stuff - and once I edit them, how do I go about recompiling them?

Here's where I got to.

I opened the Form1.cs file with VS (as I believe it is written) and changed a few things - but I don't know where to go next - the compile button appears to be greyed out - and every tutorial I have seen has assumed more knowledge than I have

Help?

FGED GREDG RDFGDR GSFDG