The online racing simulator
Searching in All forums
(263 results)
Stuff
S2 licensed
Ahh.. sorry I misunderstood your original question. Yeah, a subquery should be able to do what you want. You've probably tried:


SELECT m.id, history.something
FROM members m, (SELECT table FROM members_history WHERE mid = m.id) AS history
WHERE ...

If you have tried or it doesn't work, then this is all I can think of on short notice. You'll probably get it soon enough though.
Stuff
S2 licensed
Well, I don't see any foreign keys. They would go after to your PRIMARY KEY constraint near the bottom. The foreign key tells which primary key of another table to connect to so you can join them. Something like..


CREATE TABLE class (
id integer,
class_name text,
PRIMARY KEY (id)
);

CREATE TABLE member (
id integer,
first_name text,
last_name text,
class_id integer,
PRIMARY KEY (id),
FOREIGN KEY (class_id) REFERENCES class (id)
);

SELECT m.id, m.first_name, m.last_name, c.class_name
FROM member m, class c
WHERE m.class_id = c.id;

SELECT m.id, m.first_name, m.last_name, c.class_name
FROM member m
OUTER JOIN class c ON m.class_id = c.id;

Above is just an example and of course may not work. I'm a little rusty and TAA might have a better way but this will get you started/thinking. Note, make the foreign keys the same data type as the primary keys they reference. And of course placing them in the right spot to have logical flow all depends on your data. Just do some more reading into keys, joins, etc and we'll be OK.
Stuff
S2 licensed
theres a sdk that comes with the software.. you just need visual studio 2005+, time and knowledge of c++ and insim/outgauge
Stuff
S2 licensed
Not exactly sure but my guess is he just wants the current track and some basic info his server is running on a website..? What's the best tool for that? LFSlapper?
Stuff
S2 licensed
Hmm, I'm not sure how you're getting -1 because a byte is unsigned. Not sure of the conversion of -1 signed to unsigned but my guess is, the real value is 255.
Stuff
S2 licensed
System is Ubuntu 9.04 with nvidia 180.44 drivers and 8800GT. I got bored/helpful and made a matrix of tests.. might help!

Overall the test shadows only help a little but the annoying part is still there, thanks to Wine. I'd go back to the fastest shadow system and say to just use the latest version of Wine, or whatever version they fixed it in..
Last edited by Stuff, . Reason : 8800GT
Stuff
S2 licensed
check out AVI2DVD. i used it before and worked fine..
Stuff
S2 licensed
If you have access to another computer with a XP install you can use the Ultimate Boot CD. It will allow you to boot from the XP install on the CD and run from that. You should have full access to your files. It also comes with a couple antivirus/spyware removal tools and a ton of other stuff.. Always good to have around in case of intances like so..
Stuff
S2 licensed
Ooops.. forgot a f. http://en.wikipedia.org/wiki/Woodruff_key

Basically its a little wedge that sticks out of a shaft so it can turn something else. In my case it was the engine crankshaft and the transmission. The key broke and my engine overheated. Exhaust headers turned orange and were warped. Cost about $600 to fix since the engine had to be torn apart and headers machined back into shape.
Stuff
S2 licensed
Let's see..

1987 Pontiac Sunbird - dad used to own a rental business and this car was part of that. dad gave it to me when I was around 15-16. didn't take care of it and had a bad oil leak. eventually blew the engine.. sold as parts for $500

1993 Mustang LX convertible - bought for $1500. nice car for a while then everything started breaking. oil leak, transmission, exhaust.. eventually sold it for $1000

1985 Toyota Supra - great car, powerful too.. had a few repair problems including a broken woodruf key in the middle of a spring break road trip. good times. was t-boned on the driver side then pushed over and t-boned again on the other side, in the same accident! im ok though.. totalled the car and got $6000 for it

1992 Nissan 240SX SE - bought in 1997 for around $7500. few modifications to it but pretty much stock. sold it a couple years ago for $1000 to the landlord just to get out of a stupid argument with some other person..

2002 Subaru RS 2.5 - current car. bought 2.5 years ago for $12,000, 55k miles. still in great condition. plan on keeping this one until i can buy all electric
Stuff
S2 licensed
found mine over there with everything else but really, couldn't think of anything else at the moment..
Stuff
S2 licensed
$1000 is a little extreme methinks.. A S2 license would be a nice settlement imo. Only $36
Stuff
S2 licensed
Quote from MariusMM :
case "!tr":
if (StrMsg.Length > 1)
{
1. int TrainerFound = 0;
foreach (clsConnection c in Connections)
{
2. if (c.IsTrainer == 1)
3. InSim.Send_MTC_MessageToConnection("Trainer Chat:", MSO.UCID, 0);
4. {
TrainerFound = 1;
InSim.Send_MTC_MessageToConnection(" " + MSO.Msg, MSO.UCID, 0);
}

5. if (TrainerFound == 0)
{
InSim.Send_MTC_MessageToConnection("No Permission :).", MSO.UCID, 0);
}
}
}
else
{
6. InSim.Send_MTC_MessageToConnection("No Permission :).", MSO.UCID, 0);
}
break;


Well, you have some funky code in there..
First, item 1. What is TrainerFound supposed to do? You declared it outside the for loop so it seems like some kind of tracker for all items of the for loop. I think your intention was to set it when isTrainer is true but its not working like that. Just use isTrainer and an else block or something.
2. Using isTrainer is nice but it returns a boolean right? is* usually do. Its better practice to either check for true/false and not 1 or 0. Best to leave it off altogether. eg: if (c.isTrainer)
3. This is the only line that will be executed if c is a trainer. I think your intention was to execute the lines within the curly braces below but that will not happen.
4. The curly braces here have no effect. It is not part of the if statement. #3 is but since you left out the curly braces before that, only the next statement is executed and thats it.
5. TrainerFound will never be == 0. Because the curly braces on #4 have no effect, TrainerFound is always set to 1.
6. Why send "No permission ." when there is no message? Tell them no message not no permission..

Anyway, I think this is what you want.. Also, check the params for that Send_MTC_MessageToConnection function. I'm not sure of this but it seems like its all going to whoever sent the MSO, not everyone connected. Maybe something like: InSim.Send_MTC_MessageToConnection("Trainer Chat: " + MSO.Msg, c.UCID, 0);

case "!tr":
if (StrMsg.Length > 1)
{
foreach (clsConnection c in Connections)
{
if (c.IsTrainer)
InSim.Send_MTC_MessageToConnection("Trainer Chat: " + MSO.Msg, MSO.UCID, 0);
else
InSim.Send_MTC_MessageToConnection("No Permission :).", MSO.UCID, 0);
}
}
else
{
InSim.Send_MTC_MessageToConnection("What am I going to send?", MSO.UCID, 0);
}
break;

Last edited by Stuff, . Reason : dougie answered before.. his might work better?
Stuff
S2 licensed
Hello?

A new version is out! Not many major features (will save those for later) but just a few additions I had laying around. You can now open AU1-4 layouts that were made after patch Y (the latest). BL3 is still a no go as trying to figure out where the objects would have to be placed is time consuming.. I also added a recent file list to the open button and a couple buttons to adjust object scale/zoom. Few other things too. See first post for latest..
Stuff
S2 licensed
What's this? Patching the revision part of the header? That will work fine for AU1-4 but pretty sure it won't work for recent BL3 layouts. The Blackwood track mesh changed from S2 Y forward so unless you know how to redo the objects, they won't be placed correctly. If the layout was made < Y then you'll be OK.

I guess I could release a new temp version in the meantime so you can open the AU layouts. Meantime because I've been slowly working on a new version.
Stuff
S2 licensed
Here's a thread on this from a while ago.. DirectX Graphics Injection Good luck!
Stuff
S2 licensed
Optimization note.. If an if expression is true, don't assign a variable true.. just assign it the expression. Like so:


LEDShiftLigth.Visible = (Packet.Flags And OG_SHIFTLIGHT) > 0

Last edited by Stuff, . Reason : :)
Stuff
S2 licensed
Yeah! Czech would be great, but don't do anything now as the new version is still in development and the "current" version won't be used as is.
Stuff
S2 licensed
I do plan on adding arcs/circles for the initial release. Beizer curves I might figure out later if the arcs don't suffice for some. The background image is already in the VB6 LYTe so I'm definitely going to add it for this one. Very nice feature to trace an imported image.

For rendering I'm doing it all myself. To begin with anyway. I've thought of using something like Irrlicht or OGRE for rendering but decided against it as I really wanna know how to do all that myself, for experience. They can probably do (better) what I need but I like to know how it works. The details are my passion. I wanna know "why" all the time. I'm even creating the gui. I was going to use QT but it seems like a real pain to get it the way I want it (minimal, transparent, gradient, custom controls that point to objects in the 3D scene, like a race on TV or a chat bubble above the racer's car) As time goes on I was planning to make use of what I've learned for another editor, some type of game or all the above.. But! who knows.. I may lose my motivation, do things the quick way, and use a premade one. Thanks though. I hope to make a release asap. Stay tuned.
Stuff
S2 licensed
Ahh, I see the problem. It's like I kinda said above, the InSimClient is not all there and was originally made for an older version of InSim. The lap packet, and probably tons of others, have changed. In the case of lap time, it went from a minutes/seconds/hundreths/thousandths structure to a plain, unsigned integer in ms. In any case, it's out of date So, you'll have to either fix InSimClient or delete it and make your own. But before you do anything maybe I should explain how some things work. Hopefully you'll follow me..

InSimClient uses the okSocket you give it to do the magic. If you open up InSimClient, change the left dropdown to InSimSocket and the right dropdown to Received (InSimSocket_Received) you can see where it handles the raw data. You'll also find that ISP_LAP (it's there, defined on line 67 in the InSimPackets type) raises the PlayerLap event (line 1060). After it does that, main.frm gets the event because it declared the InSimClient object using WithEvents, you see. It goes: okSocket receives data then raises Received event. InSimClient handles the okSocket Received event, parses the packet then raises whatever event. Finally main.frm handles the InSimClient events. For an article on VB6 events check out this: http://www.developer.com/net/vb/article.php/1430631 (sorry, couldn't find it en español :shrug

So yeah, check out the InSimClient's InSimSocket_Received event to see where the data is extracted/parsed. Let me know if you're stuck or want an example without the InSimClient
Stuff
S2 licensed
Well, you have two choices. You can either use the InSimClient events to handle it like main.frm does with the InSim object. (just select the PlayerLap event from the dropdown, result below) OR you can do away with the InSimClient altogether and handle the pure data from the socket. To see an example of how InSimClient does this, look at the InSimSocket_Received event.

The quickest way would be the first as I already have quite a bit of InSim handled but not all. You might have to modify that class but it's better than starting from scratch imo. That is unless you only want to handle a few events making most of InSimClient useless.


Private Sub InSim_PlayerLap(ByVal bytPLID As Byte, ByVal sngSeconds As Single, ByVal lngLapsDone As Long, ByVal lngPlayerFlags As Long, _
ByVal Penalty As PenaltyValue, ByVal bytNumStops As Byte)
lblLapTime.Caption = SecondsToTime(sngSeconds)
End Sub

'242.800 -> 4:02.80
Private Function SecondsToTime(ByVal sngSeconds As Single) As String
On Error GoTo SecondsToTimeErr
Dim intMinutes As Integer, sngSec60 As Single

intMinutes = sngSeconds \ 60 'integer division
sngSec60 = sngSeconds - (intMinutes * 60)

SecondsToTime = Format(CStr(intMinutes), "0") & ":" & Format(CStr(sngSec60), "00.00")

Exit Function
SecondsToTimeErr:
SecondsToTime = "parse error for " & CStr(sngSeconds)
End Function

Stuff
S2 licensed
OK.. I went through the latest okSocket code I had and fixed it up, included my partial okInSimClient (uses okSocket and LFS.bas stuff), and made a simple example using them. It connects to the latest InSim but it doesn't handle everything. A starting point you can use, or you can study it on how to roll you own. Upto you of course. Hope it helps! ¡Buena suerte!
Stuff
S2 licensed
Well, if the black car is at x,y and you're facing down the positive y-axis (like the picture) and using LFS units (1m = 65536) the code that first comes to mind is something like:


static const int MAX = 20;
static const int SCALE = 65536;

Car findForwardCar(x, y) {
Car forward = 0;

int distance = 0, xTemp = x, yTemp = y;
while (distance <= MAX) {
++distance; //increment distance
yTemp += (distance * SCALE); //increment y with real distance
for_each(car in Cars) {
if (pointInRect(xTemp, yTemp, car.rect) {
forward = car;
break; //exit for loop
}
}
}

return forward;
}

Hopefully that makes sense It just increments 1 meter at a time until the new point is within the rectangle of a car. Once found its returned. Of course, this example assumes you facing directly down that positive y-axis. If not you'll need the angle and have to use some trig to find the proper point.
Stuff
S2 licensed
I posted some VB6 code a while back that works for an older version of InSim (LFS S2 0.5V3, InSimVer=3, I think). It's a starting point I guess VB6_ISE and a simple, older OutGauge only example. I have some updated code around here somewhere that I will have to find if you're interested.
Last edited by Stuff, . Reason : typology?
Stuff
S2 licensed
I was thinking of some .NET function like that too dougie. But looking at his x,y points tells us it is a polygon and not a simple rectangle. In that case sun you'll have to do some reading! Yay!

http://letmegooglethatforyou.com/?q=point+in+polygon

Check out the 3rd one down, at the bottom of the page is a C/C++ function you should be able to convert
Last edited by Stuff, .
FGED GREDG RDFGDR GSFDG