The online racing simulator
#1 - Ziroh
x z y, positions program
-
(MariusMM) DELETED by MariusMM : History
#2 - Ziroh
Hm, to be honest i don't see any way to do that ^^ lol
You have to have the pthread2GC.dll in the same dir as EXE for this app to run. Writing a simple X-Y-Z app yourself is a good way to learn InSim basics though...
#4 - Ziroh
Ye, but.. can anyone give me some tips for making it?
I know that i should make a button, that gives the MCI packet, but how?
Can't you just read the source of the MaKaKaZo's app? It's C++ so it's not exactly easy to read, but the basic idea is there.

You don't have to create any button, you just read the X, Y and Z coords from the MCI packet. MCI packet contains CompCar sturcture which holds the coordinates.
If you use extra libs like InSim.NET, you don't even have to know anything about network communication, I suppose tha X-Y-Z positioning can be done very easily with InSim.NET.
Doesnt lapper give you this function
Quote from MadCatX :Can't you just read the source of the MaKaKaZo's app? It's C++ so it's not exactly easy to read, but the basic idea is there.

You don't have to create any button, you just read the X, Y and Z coords from the MCI packet. MCI packet contains CompCar sturcture which holds the coordinates.
If you use extra libs like InSim.NET, you don't even have to know anything about network communication, I suppose tha X-Y-Z positioning can be done very easily with InSim.NET.

I did write a little example of this for InSim.NET a while back. It does write the coords onto a button, but could be easily changed.

using System;
using System.Collections.Generic;
using InSimDotNet;
using InSimDotNet.Packets;

class Program {
Dictionary<byte, IS_NCN> _conns = new Dictionary<byte, IS_NCN>();
Dictionary<byte, IS_NPL> _plys = new Dictionary<byte, IS_NPL>();

void Run() {
using (InSim insim = new InSim()) {
insim.Bind<IS_NCN>((s, p) => _conns[p.UCID] = p);
insim.Bind<IS_CNL>((s, p) => _conns.Remove(p.UCID));
insim.Bind<IS_NPL>((s, p) => _plys[p.PLID] = p);
insim.Bind<IS_PLL>((s, p) => _plys.Remove(p.PLID));
insim.Bind<IS_ISM>(InSimMulti);
insim.Bind<IS_MCI>(MultiCarInfo);

insim.Initialize(new InSimSettings {
Host = "127.0.0.1",
Port = 29999,
Admin = String.Empty,
IName = "Coords",
Interval = 1000,
Flags = InSimFlags.ISF_MCI,
});

insim.Send(new IS_TINY { ReqI = 1, SubT = TinyType.TINY_ISM });

Console.WriteLine("Coords running!");
Console.WriteLine("Press any key to exit...");
Console.ReadKey(true);
}
}

void InSimMulti(InSim insim, IS_ISM ism) {
insim.Send(new IS_TINY { ReqI = 1, SubT = TinyType.TINY_NCN });
insim.Send(new IS_TINY { ReqI = 1, SubT = TinyType.TINY_NPL });
}

void MultiCarInfo(InSim insim, IS_MCI mci) {
foreach (CompCar info in mci.Info) {
IS_NPL ply;
if (_plys.TryGetValue(info.PLID, out ply)) {
IS_NCN conn = _conns[ply.UCID];

string text = String.Format(
"X: {0:F2} Y: {1:F2} Z: {2:F2}",
info.X / 65536.0,
info.Y / 65536.0,
info.Z / 65536.0);

insim.Send(new IS_BTN {
BStyle = ButtonStyles.ISB_DARK,
ClickID = 1,
H = 8,
W = 30,
L = 80,
T = 4,
ReqI = 1,
Text = text,
UCID = conn.UCID,
});
}
}
}

static void Main() {
new Program().Run();
}
}

#8 - nikka
#9 - Ziroh

FGED GREDG RDFGDR GSFDG