Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / More H.O.T.A.S and Joystick & Keyboard Modifications to the Free Flight Prog

Author
Message
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 19th Jul 2004 23:11 Edited at: 21st Apr 2005 15:05
Here, thanks to Jess Ticular and Shawn of 3D Starwraith for their invaluable help I thought I would share this so anyone stuck dong a flight/space sim could now have a very professional player fighter /space plane, You have Joystick Hat controls (Thank you Shaun) and 1st/3rd Person camera controls (Thank you Jess) As people have helped me I think I should give back and help someone else, also has afterburner's in the code. Add your own weapons, autopilot, countermeasures and flight model



Here is the code with the pedals controlling left and right



And here is a version using the keyboard as a throttle


I also have one for the Thrustmaster Attack Throttle I will put it up in due course.
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 20th Jul 2004 13:39 Edited at: 22nd Jul 2004 07:13
Here is the one for the Thrustmaster Attack Throttle and any old PC Throttles which read the joystick Z axis rather than the joystick slider a axis



And here it is using the pedals to steer the plane/ship with



Now there is a slight problem with this code the throttle works untill you push the throttle all the way forward and then it stops I have no idea why as it doesn't do so with the USB sticks(although I find I have to actually recalberate the Saitek X36 USB before it works properly with Dark Basic), if you push the Attack Throttle to about 75% forward then it works. I will try and get answers to solve this problem, other thn that, it works fine , If you use a PC Dominator by Logic 3 you may have to adjust the joystick to stop it spinning but once you centre the joystick it works OK
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 22nd Jul 2004 05:15 Edited at: 22nd Jul 2004 05:17
Oh and I have just updated these code snippets by putting in the obligitary "Tab" afterburners, this is an extensive modification to the Example 18 Free Flight program enjoy
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 22nd Jul 2004 07:07 Edited at: 21st Apr 2005 15:08
I have solved the Thrustmaster Attack Throttle 75% problem and have updated the code snippets accordingly, anyone wishing for the old throttle value , it was 0 so just replace the -1000 with 0 and you will have the 75% per cent throttle movement for 100% throttle power, only thing is you will still get get at the 100%throttle movement forward will be 0% power so I think , personally, stick to the -1000 value, the throttle works normally then

This was done using DBC so should work better in DBP, I would add a second camera pointing and that would rotate around the object/flight model if I had DBPro hopefully I will get it soon
ArcAngel
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 25th Aug 2004 02:58
I don't see any with the Mouse and Keyboard control on there... I can make it no problem. I'll update your board as soon as I get it done . Just one question. What exactly do you want it to do? So far I'm going to make it so the up and down arrow keys are throttle and the left are right keys make it turn and the mouse makes it roll. Sounds good?

"There's a glitch in the Matrix"
"Attack life, your going to die anyway."
"Visit my website! www.freewebs.com/stradigos"
ArcAngel
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 25th Aug 2004 04:47
Well I got alot of it done. I can make it rotate forward and go forward to simulate movement and speed. But I can't get it to do the same back. It says something like must be within 360 degrees. We'll duah, it is, it's just going backwards... stupid db... lol. see if you can help me out. here's the code so far.

"There's a glitch in the Matrix"
"Attack life, your going to die anyway."
"Visit my website! www.freewebs.com/stradigos"
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 25th Aug 2004 06:12
I will try OK? I would rather use the frre flight example but I will se what I can do with this code but I am not the greatest programmer in the world
ArcAngel
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 25th Aug 2004 07:01
well whatever I'll still work on it.

"There's a glitch in the Matrix"
"Attack life, your going to die anyway."
"Visit my website! www.freewebs.com/stradigos"
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 25th Aug 2004 07:22
Well I tried this out I got it to work a bit but it would need a lot of work, plus a camera following and a 1st camera on it so you knew where you where going

here is the code

ArcAngel
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 25th Aug 2004 09:41
... I'm starting to see why i'm sticking to 2D. lol. Any possibility for a 2d MMORPG?

"There's a glitch in the Matrix"
"Attack life, your going to die anyway."
"Visit my website! www.freewebs.com/stradigos"
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 25th Aug 2004 19:03 Edited at: 25th Aug 2004 22:27
No because 2d is real boring , for me anyway what I wil do it try to get the camera in first and third person mode on this OK? Still why don't you look at the Free Flight progamme example 18 ? hmmmmmm ? if not I telly ou what I will do I will modify it just enough so you can use mouse and keyboard you will have 1st and 3rd person view but you will steer with the keyboard, not the mouse so it will be similiar to the orginal which I adapted for the joystick but not the same and I will put it in this thread ( mouse and keyboard, get a goddamn joystick they aren't much for *****'s sake, come on I am suprised at the amount of pople hear are trying to be developers and they don't even have a damn joystick, let alone a H.O.T.A.S joystick, that is totally unprofessional )
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 25th Aug 2004 22:24
here it is Stradigos
ArcAngel
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 26th Aug 2004 01:57
Quote: "if leftkey()=1 then turn object left 2,5
if rightkey()=1 then turn object right 2,5
if inkey$()="," then roll object left 2,5
if inkey$()="." then roll object right 2,5
"


Yea, thats what i was trying to do. Except with the mouse, but I decided to forget that, it wasn't realistic. But I think you should change the roll with the turn. Try and you'll feel like your playing a professional game. I think thats wise because you turn alot more than you turn on the y axis {yaw i think it's called}. Anyways check that out. If you don't mind i'm gonna modify that code to fit what I just told you plus slow it down a bit if I can.

"There's a glitch in the Matrix"
"Attack life, your going to die anyway."
"Visit my website! www.freewebs.com/stradigos"
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 26th Aug 2004 15:27
Feel free after all I modified the code myself for joysticks and got help with the camera and joyhat code , one thing please post the steering and pitching mouse code so I can see it
ArcAngel
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 27th Aug 2004 00:54
lol, i thought i told you I gave up on that to work on the VN. If you want to make a trade with codes then thats fine by me, but i'd appreciate it if you figured it out on your own.

"There's a glitch in the Matrix"
"Attack life, your going to die anyway."
"Visit my website! www.freewebs.com/stradigos"
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 27th Aug 2004 08:27 Edited at: 27th Aug 2004 18:25
Excuse Me, I figured out most of the joystick stuff n my own wiith some help and I did bloody well help you a bit with your code sonny,
still go work on VN , besides, why bother with a mouse ?????get off your butt and get a joystick, they cheap most of them now are USB and extremely stable and they are better for vehicles than a stupid mouse, And for my game SD (Sloar Dominion) I shall give the steering planes with a keyboard if I can't work it out with a mouse.

Yeah I will make a trade with you for code just to find out how to do the mouse steering and pitching for flying e.t.c.but only this once, developers too lazy to get a joystick atfer that know where they can go
ArcAngel
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location:
Posted: 27th Aug 2004 08:51
hey, woah there, i come in peace . Yea, I'll do the mouse steering thing for you.

"There's a glitch in the Matrix"
"Attack life, your going to die anyway."
"Visit my website! www.freewebs.com/stradigos"
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 27th Aug 2004 18:31 Edited at: 27th Aug 2004 18:32
OK in a way becuase you were a little because you got a little bit back but I am not just aiming my joystick comments at you Strad, too many wannabe developers come on here just doing mouse and keyboard. Look there are more games than First Person Shooters and some FPS 's have the good sense to include joystick controls and it is all there in DB.

What happens when FPS 's as the market is saturated with them, suddenly becomes out of fashion and space/flight sims come back or what I see happening is multi genre games coming in with vehicles and flight and space flight,what then? still rely on stupid mouse and keyboard? Don't think so.

@Strad still I will be looking for to this mouse steering and pitching of planes
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 14th Sep 2004 01:43 Edited at: 14th Sep 2004 01:53
Here is a new update on the flight code, I am working out the mousesteering code myself and it is almost ready just having rudder control problems


The above code is for USB sticks like the X36 USB X45 and the Afterburner Orginal , 2 e,t,c, the code below is for Z control throttles like the Thustmaster Attack Throttle e.t.c.



Have fun with the code I will put the mousesteer up soon when it is working properly

Login to post a reply

Server time is: 2024-11-23 19:35:17
Your offset time is: 2024-11-23 19:35:17