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.

DarkBASIC Discussion / Controllable views

Author
Message
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 21st Feb 2004 07:43
Yes, how do I attach or program a view to say an aircraft or tank or car and have the player turn the view aroundwhen they are using a joystick with a hat control on it? I have manged to get a plane and spaceplane and, a hovertank and a tank to work and steer(The Hovertank straffes left to right using Rudder Controls) using joystick controls but I can't seem to do that for a 1st person Camera.

Does anyone actually know how please?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 21st Feb 2004 11:01
Well, if you have it working for objects, then it's the same principal for the camera, all you do is get the user input, then, instead of moveing/rotating the object, you move/rotate the camera.

Hope I Helped...
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 23rd Feb 2004 14:15
I meant using the Joystick hat controls or the Joystick POV controls, are you sayng t is the same principal then Jess and the positoning how do I get that? I think that is the most difficult
thing at the moment
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 23rd Feb 2004 14:54
Um, I'm not too sure what you just posted... but
Quote: "the positoning how do I get that?"
stood out, so, I'm gonna try and help.

To get the camera positions, use the following commands;
Camera Position X()
Camera Position Y()
Camera Position Z()

They're self-explanitory.

Hope I Helped...
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 23rd Feb 2004 20:16 Edited at: 29th Feb 2004 12:47
I meant ho would I do it on an imported object, say a plane or atank do I usethese positions to get the cockit view, actually I think it might be best ona huuman or alien model but then that opens up oother problems an I wnt my charectorsto be ableto get in and out of vehicles so then it's geting the A.I or player to get into the cocpit position, as lond as the head can rotate(I think it would be limbs to getaround that) then getting the view to look around shouldn't be a problem, it would be getting the cockpit position I expect
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 24th Feb 2004 12:06
Do you mean you want a First Person View?

If so... instead of positoning/rotating/moving an object, just position/rotate/move the camera using the camera commads instead of the object commands...

ie, instead of;

Position Object x,y,z

use;

Position Camera x,y,z

Hope I Helped...
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Feb 2004 09:40
I think you are saying that you need a HUD (the dashboard of a car, for example) that moves with you.

You can acheive this either with Sprites, or with 3D objects and using LOCK OBJECT TO SCREEN()

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 26th Feb 2004 10:41
Oh... I'm sorry, I completely misunderstood your problem...

I feel rather silly now... Sorry for wasting your time

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Debbie McDowell
21
Years of Service
User Offline
Joined: 14th Oct 2003
Location: Florida
Posted: 26th Feb 2004 12:06 Edited at: 26th Feb 2004 12:08
Some questions are not clear and some do not try hard enough on their own. These very things I learned on my own with no help,
never a school nor so much as a tutor or mentor.

There was not even this forum when I started.

Placing a camera or drawing a gunsight to the screen are very basic
and if one has trouble here then they surely have not taken
the time to do it on their own

Here one would quickly wear thin the willingness of another to offer assistance for repeated questioning regarding the same "VERY BASIC ESSENTIALS" of programming.

READ THE TUTORIALS

**"BY READING THE TUTORIALS"**
where you can flat out copy and paste
this very information right into your own program you would not have been here to ask this question.
DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 26th Feb 2004 17:58
hmmm I don't understand your problem very clearly, but I think I have done something like that in my F-16 Gold Wings...

If what you want is a "free cockpit view", do this:

1. Position the camera where the tank/plane/ship/human is
2. Orient the camera to the object (SET CAMERA TO OBJECT ORIENTATION)
3. This is a bit complicated...it requires a lot of trial and error but you'll have to do it: try to move the camera to where the cockpit is by using this sort of code:


This can be explained like this: stand somewhere in your home, for example, and try to move like the camera...like this:
Turn camera left 90 = turn left
Move camera 10 = move 10 steps
Turn camera right 90 = turn right

Why to turn in the opposite direction after moving the camera?, because the camera is aligned to the tank/plane/ship/human, and with that you'll reset the camera's orientation to the object.

for example here's some code of my F-16 Gold Wings (in this example I have a 3D cockpit instead of the entire 3D model, but it can be applied for an entire 3D model if you want):

With this you have a free cockpit view.

I hope this'll be useful

Current Projects: F-16 Gold Wings
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 28th Feb 2004 01:28 Edited at: 29th Feb 2004 12:48
I see thanks Darkguy , that is kind what I am looking for, turning the player 's 1st person view with the joystick hat, the kind of thing you get in most flight simulators.

I have no idea what debbie McDowell is talking about I haven't seen any tutorial in Dark Basic with any aircraft and a 1st person camera which you can control with the joystick hat, and I am sure you don't know of any tutorial yourself because I believe me I did look and I have had Dark Basic for quite a while possibly you just wanted to make a flame or something, or you just didn't bother to read what exactly what I was saying at all, hmmm? Just wanted to establish some silly hierarchy, cliquey thing hmmm?


Anyway I wanted to know how it was done and how to do it, as for whether you were here first or last I am not really interested, I am only interested in getting my game done, so if all you want to do is flame someone please find someone else I am not interested.

Jess Ticular, I will explain, if you ever played X-Wing Alliance or the Wing Commander series or the Descent series or any games like that , if you have a joystick with a hat control on it you can use the joystick hat to move the player's view or camera around and you can look around the cockpit or up above youor look side to side, some een have it that you can look right round that is what I meant
DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 28th Feb 2004 05:07 Edited at: 28th Feb 2004 05:17
ok ok!!!! don't get angry with me!!

anyway......if what you want is to get an object coordinates that is inside a 3D model, there's a post in this forum related with some shooting gun or "potato launcher" or something like that...

sorry!!

edit: take a look at this post: http://darkbasic.thegamecreators.com/?m=forum_view&t=23090&b=10

Current Projects: F-16 Gold Wings
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 28th Feb 2004 12:16 Edited at: 29th Feb 2004 13:02
Dark Guy I wasn't getting angry with you I was getting angry with Debbie McDowell, she hasn't even read any of the tutorials because if she did she (if it is a she) would know that the tutorials are for a 1st person shooter not a flight simulator and the free flight example also included in Dark Basic has the camera in third person just looking at the the flight object which really makes me doubt that Debbie actually has been working with Dark Basic for that long for she would know all that and before you ask Debbie Yes I did try to get another view attached to the object and it kept crashing Dark Basic and my PC at the time which was a P2 350.


So DarkGuy I am sorry if you think I was getting angry with you, I wasn't, actually I was thanking you for that bit of code.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 29th Feb 2004 12:42 Edited at: 29th Feb 2004 12:43
vampyre, with regards to Debbie... She was only trying to help, she has used DarkBASIC for a while, she is a competent coder, and has read through the tutorials ( as she has pointed specific ones out to people on these very forums ). I think she, like me, completely misunderstood your problem...

Now that I know what you're after, I have a snippet right here in my Projects folder that is what you're after ( i answered a similar Q once upon a time )...

Alright, so I can't find the snippet, but here's one I just wrote...




It's long, yeah, But that's just cos I had to set it all up...

If you use DarkEDIT, and enable Globals, alot of those functions can be combined.

Hope I Helped This Time
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 29th Feb 2004 12:59 Edited at: 29th Feb 2004 13:02
OK thanks JessTicular I shall try to convert it for joystick hat controls to use, well I have been around for a while, although I stupidly used 3D RAD because I thought it as quicker , I since learned subsequently how stupid and foolish that descision was but I have, since then ,done qiute a bit of work for myself so I was a litle peeved at the remark she made as I used to get that all the time on the 3D RAD forum

Still thanks for the code Jess
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 29th Feb 2004 14:15
Alrighty, glad to have helped

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 29th Feb 2004 14:27 Edited at: 29th Feb 2004 14:29
Damnnn!!!!!!!!!!!!!!!!!!!!!!!!!!!!! it worked I even got it to move up and down with the joystick hat (t) although I am having a few problems making it work properly as the POV cures when looking upwards as my Saitek X36 USB has joystick HAT points of 0 for looking up 9000 for left 27000 for right and 18000 for looking down and really only works properly when I turn left and right that up and down works without curving but it works, unbelievable, thanks especially for the code Jess and I must say, if I could get this attached as a first person view to say the free flight example , which I have modified for joystick H.O.T.A.S and ordinary joysticks with hats this would effectively mean that, with quite a bit of help, got a professional player aircraft done within a couple of months of really using Dark Basic Classic.


WOW now that really is impressive, try doing that with 3D RAD, EVEN 3D Gamestudio and Gamestudio is very good although I would say the language for me is a little intimidating
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 29th Feb 2004 14:40
Alrighty, glad that it works for you

I personally have never used a Joystick with DBC/P as I haven't ever gotten to that stage in a game where I've needed/wanted to use one... Plus, my Joystick is about 5 years old, so it's not exactly up-to-date, lol.

Again, glad that it works for you, and I'm sorry I didn't help straight off.

Jess.

PS I have never used 3D RAD or anything like that... only DBP/C for making games...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 29th Feb 2004 17:10 Edited at: 19th Aug 2004 08:26
Well, it doesn't have to be a flash stick , I have a very old PC Logic Joystick which I picked up for £5.00($9.20)in a Cash Converter store with a hat control and it works with that. I picked up an old Thrustmaster Attack Throttle for £5.00 of ebay as well so you don't have to get a flash USB joystick , as a matter of fact, most of my sticks are second hand and I bought most of then of ebay

P.S. Be thankful you haven't especailly 3D RAD, I recommend, even if people are absolute beginners , never ever use that package, it has some good bits but the people who run it are stupid and nasty and don't care for their customers and rip them off, it's only good for the most basic of 3D Games and is just, just better than a click together but not that much
DARKGuy
21
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 17th Mar 2004 00:08
sorry for not answering in all that time

Quote: "So DarkGuy I am sorry if you think I was getting angry with you, I wasn't, actually I was thanking you for that bit of code."


Oops! sorry for the misunderstanding!

vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 17th Mar 2004 01:51 Edited at: 17th Mar 2004 01:57
Thats OK but I am still having trouble with the hat controls as I am trying to get the free flight example to control the view with the joystick hat example I did get it to work within the code that Jess Ticular gave me but I can't convert it for the free flight example I currently decided to ask the techinal team for help as I don't think there is anyone on the forums who can reall help me with this.

Still no problem about that DARKGuy It wasn't you having a go at me under the guise of "help"

Login to post a reply

Server time is: 2025-05-24 19:26:50
Your offset time is: 2025-05-24 19:26:50