The online racing simulator
Sending a message to LFS x, y co-ordiantes
(6 posts, closed, started )
#1 - sun
Sending a message to LFS x, y co-ordiantes
Hi

The thing is that i want to make somthing that sends the x, y co-ordiantes in LFS and it displays on my screen so i know where my lottery ticket place is. I thought it might be InSim.Send_MST_Message("/

or InSim.Send_MTC_MessageToConnection.

If you can help please post in here.

Thanks.

Regards

Owen.

Edited by the_angry_angel
Owen I've received several emails complaining about the fingerpointing. Please refrain from doing so in the future unless it is required to advance the topic.
use this toy http://www.lfsforum.net/showthread.php?p=516752#post516752
and this script if you one on track.

function drag_init(imsg)
racer = {}
luaLFS:small(0, SMALL_NLI, 50)
luaLFS:tiny(1, TINY_NPL)
end
evt_bind(EVT_CONNECTED, drag_init)

function test(imsg)
local mci = luaLFS:mci(imsg)
luaLFS:bfn(0, 255, 50, 0)
luaLFS:bfn(0, 255, 51, 0)
luaLFS:btn(50, 255, 50, 0, 32, 0, 172, 25, 28, 10, "X1="..mci.compcar[plid].x)
luaLFS:btn(51, 255, 51, 0, 32, 0, 172, 35, 28, 10, "Y1="..mci.compcar[plid].y)
end
evt_bind(ISP_MCI, test)

function npl_loc(imsg)
local npl = luaLFS:npl(imsg)
plid = npl.plid
end
evt_bind(ISP_NPL, npl_loc)

Sun i told you to do one simple thing, you said to me you know how to send messages to lfs and via insim and the base your using. I then said "Send a message to lfs containing the x,y" seen as your determined to get an answer and drag me into this by mentioning my name so here goes...



InSim.Send_MST_Message("X: " + MCI.Info[0].X);
InSim.Send_MST_Message("Y: " + MCI.Info[0].Y);

Put that piece of code in the MCI packet and there you have your X,Y value in lfs. I said to you it was a very simple bit of code but yet you where detemened to get me to give you a full answer.

As for A.Fedorov post, 1. thats in Lua which will be no use to him what so ever. and 2. you have a heck of a lot more patience then i do.

Edited by the_angry_angel:
Sean, I've also cleaned your post.
Ok, if your going to post like this let's get a run down of what you need to post on here so we can all get up to speed so that we may help you. The first thing would be what programming language are you using. What Library are you using (if any, and if your not using one, and if your using your own code, then expect not to get help if your not willing to post SOME code.).

I would also like to discuss your general attitude on here. The Live For Speed Programmer Forum in particular, is a very open community. We like to help people, but only if people are willing to help them self's. What I am trying to say is, not so much RTFM, but at least take some time on this project. From all of your post on here it only seems as if you want other people to build your code and while you horde it. You remind me of Bill Gates in many ways, and don't take that as a complement. Open source software does work, and the community as a whole is better for it. So you might try and open up your code, or work on a smaller project that is open to get to grips with what your trying to do.

Programming is just about sitting in front of the computer screen with a keyboard and some coffee, 90% of programming is prep time. You have to have a plan. You have to think where you want to go with the project, all before writing a line of code. If you fail at planning, you project will also fail, and it will take more time over all to reach your goals. Please, take a step back and think about what your trying to do, and then do it.
Also (as I've been doing), don't be scared to fiddle around. If you're rather unsure of a language, just play around, create errors and learn how to fix them on your own. Don't just cry wolf whenever your compiler fails to compile. I know nearly no C#, but I've been playing around, learning how things work.

If you're new to a language, copy-pasting will teach you nothing, whereas researching, examining and just seeing what others have done and actually attempting to interpret what someone's getting at, will teach you too.

Honestly, if you still can't figure simple things out on your own, you need to take a step back and re-assess your knowledge and learn missing bits.
Guys, can we keep this thread civil and to the point, if possible. This is the one evening I'm going to bed early and I've been woken up with email alerts from the phone (granted this is my fault for not turning it on silent), so I'd prefer not to see a load of crap in the thread / forum when I wake up tomorrow.

Sun/Owen has been told several times about how to get answers. I think hammering the point home isn't going to make much of a difference. Please bear in mind that he is young.

A.Fedorov, as much as I'd love to recommend luaLFS to people, I'm currently not working on that project and unless anyone else wants to take it up, I wouldn't recommend using it as there are design flaws.

Sun/Owen, I'm still not convinced that you should be tackling a relatively "complex" project like this yet. I really think you should go back to your book and work through any exercises in that then come back in a few weeks and see how you get on. I will not be repeating the reasons why.

I've locked this thread as you've had your answer from mcgas001 (although his answer will only provide the MCI position if you're connecting to the LFS client, or are hosting the game yourself).
-
(mcgas001) DELETED by the_angry_angel : Simple instructions. Follow them.
This thread is closed

Sending a message to LFS x, y co-ordiantes
(6 posts, closed, started )
FGED GREDG RDFGDR GSFDG