The online racing simulator
Searching in All forums
(943 results)
PoVo
S3 licensed
Hi, a few months back, I tried to get this library running with Visual Studio.

I got very far, to a point where the program builds, but crashes on start up.

I basically got the Event InSim app created my the OP, and copied it to the Project in VS.

I was unable to find the problem, so I decided to post it here, so that if anyone could have a look, to check what the problem is.

I would really appreciate someone experienced in C++ to look at my project (which can be downloaded from my site HERE (couldn't upload here as it's too big))

Thanks
PoVo
S3 licensed
Tried the server out, and the idea is very nice.

It was pretty lonely playing on my own, but I can imagine the fun of it.

Hopefully a nice community builds up for this server, as it looks fun, if there's like 20~ people in the server.

Good luck
PoVo
S3 licensed
Well, I guess the forum will benefit from the fact that you won't be able to spam it everyday with your 11k posts
PoVo
S3 licensed
Quote from Forbin :Don't waste your time. Stick to racing properly.

PoVo
S3 licensed
As far as I know, you can't do that.

The only closest thing to that is getting the PLID of a person who hit a layout object
PoVo
S3 licensed
Quote from nikopdr :http://www.ihatestickers.com

they're having quite a nice sale, buy stuff for 20 dollars and get free shipping, its a bargain for a finn like me as 20 dollars is something around 14-16 euros

You're putting those stickers on the Civic right? :beady:
PoVo
S3 licensed
You can check if the number of objects have changed Just send a TINY_AXI, and you'll receive an IS_AXI

struct IS_AXI // AutoX Info
{
byte Size; // 40
byte Type; // ISP_AXI
byte ReqI; // 0 unless this is a reply to an TINY_AXI request
byte Zero;

byte AXStart; // autocross start position
byte NumCP; // number of checkpoints
[B]word NumO; // number of objects[/B]

char LName[32]; // the name of the layout last loaded (if loaded locally)
};

PoVo
S3 licensed
Quote from Tomba(FIN) :where's the cockpit?

Behind the cameraman
PoVo
S3 licensed
Quote from Nathan_French_14 :Amen Brother.

I'm a young driver myself (19), but whenever I overtake a young lad on the dual carriageway, they see it as some sort of invitation to a race.

Pisses me off!

Here's the problem:

Your car looks like this.
PoVo
S3 licensed
Good luck to Japan
PoVo
S3 licensed
Quote from skywatcher122 :yep yep Grammar Tech!

Thanks, I try. :biggrinfl
PoVo
S3 licensed
Tomba, what wheels are being used in those screenshots?

Is it me or I can't find it in Wheel Changer?
PoVo
S3 licensed
Quote from skywatcher122 :In soviet russia zer0 divides you

Well, it's not like you know much about Soviet Russia.
PoVo
S3 licensed
Even though it looks and sounds bad, the conversion looks reasonably good!
PoVo
S3 licensed
Well, I've downloaded the latest Source from repository. If any thing wrong pops up, I'll let you know.

Continue the speedy work
PoVo
S3 licensed
Nice box to play around in
PoVo
S3 licensed
Tried yesterday, and the server is awesome. Layout is very unique! Congratulations with this masterpiece
PoVo
S3 licensed
Working perfect
PoVo
S3 licensed
Great work! Will test the 220 character button in a few mins.

Edit: Long character buttons finally work!

One thing that doesn't work is, sending a button with no Text in it. e.g Text = "" or not declaring the Text at all, throws an exception:


System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at System.String.Substring(Int32 startIndex, Int32 length)
at InSimDotNet.Packets.PacketWriter.Write(String value, Int32 length)
at InSimDotNet.Packets.IS_BTN.Pack()
at InSimDotNet.InSim.Send(ISendable packet)
at DriftProject.Button.Control.NewButton(Vars Conn, Int32 currentID, IS_BTN Button) in G:\Users\Povilas\documents\visual studio 2010\Projects\DriftProject\DriftProject\Button\Control.cs:line 20
at DriftProject.Packets.MCI.Update(Vars Conn) in G:\Users\Povilas\documents\visual studio 2010\Projects\DriftProject\DriftProject\Packets\MCI.cs:line 50

Setting the Text to " " (A simple space) solves the problem. Not much of a big deal, but it worked before
Last edited by PoVo, .
PoVo
S3 licensed
Quote from DarkTimes :Car Updates

The library also supports MCI updates, without the need for any hacks . Here we check the speed of each player on track and spectate anyone who goes above 80 Kph.

using System;
using System.Collections.Generic;
using Spark;
using Spark.Packets;
using Spark.Helpers;

namespace Spark.Example5
{
class Program
{
static InSim _insim;
// We store the players in a dictionary.
static Dictionary<int, IS_NPL> _players = new Dictionary<int, IS_NPL>();

static void Main()
{
// Create new InSim object.
using (_insim = new InSim())
{
// Bind handlers.
_insim.Bind<IS_ISM>(MultiPlayerInfo);
_insim.Bind<IS_NPL>(NewPlayer);
_insim.Bind<IS_PLL>(PlayerLeft);
_insim.Bind<IS_MCI>(MultiCarInfo);

// Establish the InSim connection.
_insim.Connect("127.0.0.1", 29999);

// Initialize InSim.
_insim.Send(new IS_ISI { IName = "^3Example", Flags = InSimFlags.ISF_MCI, Interval = 500, Admin = string.Empty });

// Request for multiplayer info packet to be sent.
_insim.Send(new IS_TINY { SubT = TinyType.TINY_ISM, ReqI = 255 });

// Prevent program from exiting.
_insim.Run();
}
}

static void MultiPlayerInfo(IS_ISM ism)
{
// When joining multiplayer request for all connections and players to be sent.
_insim.Send(new IS_TINY { SubT = TinyType.TINY_NCN, ReqI = 255 });
_insim.Send(new IS_TINY { SubT = TinyType.TINY_NPL, ReqI = 255 });
}

static void NewPlayer(IS_NPL npl)
{
if (_players.ContainsKey(npl.PLID))
{
// Leaving pits, just update NPL object.
_players[npl.PLID] = npl;
}
else
{
// Add new player.
_players.Add(npl.PLID, npl);
}
}

static void PlayerLeft(IS_PLL pll)
{
// Remove player.
_players.Remove(pll.PLID);
}

static void MultiCarInfo(IS_MCI mci)
{
// Loop through each car on track.
foreach (var car in mci.CompCars)
{
// Get the player driving this car.
IS_NPL npl;
if (_players.TryGetValue(car.PLID, out npl))
{
// Check cars speed.
var kph = MathHelper.SpeedToKph(car.Speed);
if (kph > 80)
{
// Spectate player and send chat message.
_insim.Send("/spec {0}", npl.PName);
_insim.Send("{0} ^3spectated for speeding", npl.PName);
}
}
}
}
}
}


Use this code from DarkTimes. Where it says "// Spectate player and send chat message." output the "kph" variable on a button.
PoVo
S3 licensed
Quote from broken :1. The color codes I send to LFS, are being shown as text. I send ^1red, and I get a normal, green ^1red.

Same problem for me
PoVo
S3 licensed
I think he sold his computer
PoVo
S3 licensed
Quote from dawesdust_12 :I can't wait for the after picture:

ouch
PoVo
S3 licensed
Lovin all the unique pictures
FGED GREDG RDFGDR GSFDG