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 / getting into vehicles

Author
Message
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 29th Feb 2004 16:35
can someone tell me how to get into a tank like you walk up to it and press a button and the camera appears inside pls

*=========**=================*
*.-steve-.**.-slipknot rule-.*
*=========**=================*
ReD_eYe
22
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 29th Feb 2004 16:43
its a bit complicated, i'll explain the theory:

you need to constantly check how far you(the player) is from the tank.
when you are quite close, you allow the player to press a button.
if they press the button, you change a variable flag

meanwhile you have an if function that detects if the variable flag changes. if it does, position the camera in a different place and allow the player to control the tank. if the variable flag doesn't change, then the player hasn't pressed the button to get into the tank, and they should be allowed to keep walking normally.

thats pretty much it, i've done in a game already, but the code is quite alot more complicated than that, if your still stuck i might be able to do some basic code for you.

In the beginning, the universe was created...
This made alot of people very angry and it has been widely regarded as a bad idea...
Visit http://redeye.dbspot.com
steve c
21
Years of Service
User Offline
Joined: 30th Jan 2004
Location: united kingdom
Posted: 29th Feb 2004 16:50
yes can you do the basic code for me i dont know about making flags and stuff so if you would i would be very gratefull

*=========**=================*
*.-steve-.**.-slipknot rule-.*
*=========**=================*
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 29th Feb 2004 17:19 Edited at: 29th Feb 2004 17:40
Is it psssible to do it so that you don't have to use a button ReD_eYe or attach the player to the tank using limbs and get it inside the tank so say you have A.I. enemies shooting at you that the bullets and shells hit the tank and not the player unless the player is outside the tank?

I was thinking that it would be better to have the player have the camera as his eyes and then when you get into the tank the player would be able to see outside the tank but the player can control the tank and also the player can turn the camera left and right and can control the view up and down , like in a flight or space simulator like say Space Wraith, is that possible?
Dark Pledge
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location:
Posted: 29th Feb 2004 18:33
just about ANYTHING is possible with programming. it just depends on how much time you invest.



Dpledge
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 29th Feb 2004 20:06
Well I asked for that, what I ahould have said, was how it is posssible?
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 3rd Mar 2004 20:24
OOh yesand can I have some basic code on how getting in and out vehicles works [lease ReD EyE?
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 4th Mar 2004 00:03
Psuedo code (will NOT compile...best to learn not to give )

cameramode = 1 :`1 would be following the player, 2 following the tank
intank = 0

do
If CameraMode = 1
`Player Specific Code Here
endif

If CameraMode = 2
`Tank Specific Code Here
endif

`the get in the tank
If player is close to tank and intank = 0
If returnkey() = 1 then gosub _changemode

loop

_changemode:
inc cameramode,1
if cameramode > 2 then cameramode = 1 :'make sure the camera value loops
inc intank,1
if intank > 1 then intank = 0 :'make sure the intank value loops
return

Thatll give you an idea of how it would be coded


We need help! Email us! [email protected]
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 5th Mar 2004 16:57
I see RPG I suppose you could modify it so that you can actually get the player in and out of the tank rather than the camera's as that would mean additonal code to make the player charector dissappear and the model of the player on foot dissappear.

Any shells hitting the tank then would destroy the tank and not the player, which what I would like and have the player eject automatically from the tank when the tank is destroyed, others would just allow the player to be destroyed with the tank I guess
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 6th Mar 2004 01:09
HI

I have been reading suggestions and think "that stuff is to complicated". That is why I thought of this.....

you create a sphere (or whatever shape) and use it to surround the player object. Then you hide the sphere, and check to see if the sphere position equalls the tank position. You will need to make it so that the sphere position is always the same as the player position.

I dont know if that will work because I have never tried it before, but it is easy.

P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.

Login to post a reply

Server time is: 2025-06-02 06:32:53
Your offset time is: 2025-06-02 06:32:53