The online racing simulator
Searching in All forums
(407 results)
vane
S3 licensed
Ha i knew it would be something silly thank you so much!

Haven't done much coding for a while and forgot some of it.
Can i use 'foreach' to avoid having to put multiple 'if' *update new question*
vane
S3 licensed
name explains most of it, basically i am using this code:

private void timer2_Tick(object sender, EventArgs e)
{
Poll();

byte[] joystickbtn = state.GetButtons();
buttons = new bool[joystickbtn.Length];

int j = 0;
foreach (byte button in joystickbtn)
{
buttons[j] = button >= 128;
j++;
}
if (buttons[16])
{
label1.Text = ("16");
timer2.Enabled = false;
}

if (buttons[17])
{
label1.Text = ("17");
timer2.Enabled = false;
}

if (buttons[18])
{
label1.Text = ("18");
timer2.Enabled = false;
}

if (buttons[19])
{
label1.Text = ("19");
timer2.Enabled = false;
}

}

It detects button presses from a steering wheel, this is the button select feature from my game controller interface program.

Basically i want to know if i can use 'foreach' to make it so i only have to have one if statement.

i have tried:
if (buttons[j])
{
label1.Text = (j);
timer2.Enabled = false;
}

but it seems to not work, i would be greatful for any help available!

thanks
Peter
Last edited by vane, .
vane
S3 licensed
G force is relative to inertia and velocity isn't it?

You should try the redbull air racer planes, pulling ~10g all the time!
vane
S3 licensed
I have just got back into LFS and with it, into LFS programming again, my query is:

It may have been mentioned early but can this be set up as purely a client side Insim? eg outside of the server, i may have forgotten somethign that is really silly haven't done it for so long!
vane
S3 licensed
Most of the time i disconnect when i switch to unwindowed mode
vane
S3 licensed
Quote from george_tsiros :for the love of god, no.

no

just... no

wtf are you thinking?

if you're into that sort of thing, go play ReVolt or something

wtf is revolt?
vane
S3 licensed
No it was £60 with free p&p and 2 year warranty, and it was brand new
vane
S3 licensed
Its cause you haven't bloody paid for the game
vane
S3 licensed
Peel P50...
vane
S3 licensed
Get ano old joystick then remove one of the pots from the x y axis, mount it onto the hand brake stalk then mount the pot body somewhere then your done
vane
S3 licensed
DFGT for £60 + free p&p on ebay + 2 year warranty
vane
S3 licensed
you can get a brand new DFGT on ebay for £60...
vane
S3 licensed
I would assume as the current goings, S3 would probably be £36, but S2 then upgrade
vane
S3 licensed
Having a USB version would require the use of a USB controller chip and a PIC, which would then require a bit of code written and a £20 PIC writer, in the long run it may be cheaper (and easier) to get a parallel port chip for your computer
Logitech DFGT Scroll Wheel control application WIP (doesnt have to be a DFGT read on)
vane
S3 licensed
I am currently coding an application which will harness the scroll wheel of my recently got DFGT steering wheel. I intend to use a client side insim application to show 'buttons' on the lfs screen which scroll with the scroll wheel, allowing control of applications such as windows media player(while inside lfs) and i have to say i am qute excited!

Let me know what you think!
Peter

P.S this app would be useable on any controller as long as it has 3+ spare buttons.

I did originally have this in a thread in the LFS programmer forum available here: http://www.lfsforum.net/showthread.php?t=58587

Attached is a sample of the work but it will only work with the DFGT atm as all the button assignments are fixed, try it out!

Also make sure the DFGT is the only game controller plugged in for proper operation, this will all be remidied by the final product.

I am coming to the end of my first year at college and it is a bit of a rush so it may slow it down slightly, watch this space!!!

EDIT: you may need .Net Framework installed for it to work
Last edited by vane, .
vane
S3 licensed
Good idea AA, i'll do that!
vane
S3 licensed
I take it the DFGT isn't a very popular wheel...
vane
S3 licensed
The GT logo lights up when it is plugged in, it is also a horn button pretty cool if you ask me...
vane
S3 licensed
Are people getting a debugging error when they download that?
vane
S3 licensed
that clutch pedal looks a bit over engineered
vane
S3 licensed
The DFP power supply says:
24v 750mA positive tip
and the DFGT one says:
24v 0.7A Positive tip

(750mA = 0.7A)

So they should work

About the DFP power supply, the plug did fall off but i used my ace soldering skills and heat shrinking skills to solder it back on, it is a solid soldering job, i can pull it pretty hard and the wires do not pull of. i cannot remember what it said on the multimetre but i can check for you.

The solder job is on the low voltage side of the transformer so there is no shoddy mains connection, i might get some pics up at some point if you are further interested.
vane
S3 licensed
DFGT is a lot more quieter than the DFP

BTW, i am making an interface program for the scroll wheel and the information about it can be found here:
http://www.lfsforum.net/showthread.php?t=58587
Aswell as a little sample program!!!
vane
S3 licensed
I have found that out and no longer need help on that

I have a Concept program for all you DFGT owners to try out, sorry but it will not work on anything else, unless it has more than 18 buttons (The scrolling action works on buttons 17 and 18)

What do you think?
vane
S3 licensed
I am using this site as a reference for detecting the Controller buttons but when i try and use:

Quote : bool buttonA = buttons[0] >= 128;

It says there is nothing in the context called 'Buttons'

Can Anyone Help?
DFGT Scroll Wheel control application WIP
vane
S3 licensed
I do not at the moment need help, i just wanted to document my work. I am currently coding an application which will harness the scroll wheel of my recently got DFGT steering wheel. I intend to use a client side insim application to show 'buttons' on the lfs screen which scroll with the scroll wheel, allowing control of applications such as windows media player(while inside lfs) and i have to say i am qute excited!

Let me know what you think!
Peter

P.S this app would be useable on any controller as long as it has 3+ spare buttons
Last edited by vane, .
FGED GREDG RDFGDR GSFDG