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.

Newcomers DBPro Corner / Flying objects

Author
Message
maowan
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 27th Feb 2003 22:04
I wonder if anyone could help me.

I am trying to program my first 3D FPS game at the moment on Dark Basic Pro...
My problem is I am trying to get objects, cubes will do for now, to fly towards and over the player, from random directions. As at a later time I want to create some aircraft models.

Can anyone give me help with what code would do this?

please help!!
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 28th Feb 2003 00:26
Try


There are plenty of things to change there so you need to experiment a bit

Those of you who think you know everything are annoying to those of us who do.
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 28th Feb 2003 01:03
A problem I can see in witchbomber's code is that the cubes won't act like aircraft. As soon as they reach the player they will vibrate and rotate wildly about, still trying to point to a position above the player but overshooting each time.

When the cube is close enough to the player, the cube should find a new destination, preferably in the same line it was originally travelling, to fly over to. That way the cube will fly down over the player and pull up again to fly away.

Alternately, you could model the entire thing using cos and sin commands to get a swooping motion.

Once I was but the learner,
now, I am the Master.
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 8th Mar 2003 21:22
No they won't. Read the code more carefully. They only point towards the player once. In the main program loop they keep going in the same direction.


(Location:United Kingdom. Don't tell me. You're En**ish aren't you Darthster)
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 8th Mar 2003 21:23
Also, considering he only joined the forum a few weeks ago and is using cubes as targets its unlikely he wants to be using trigonometry just yet.
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 8th Mar 2003 23:38
Yeah, I didn't read the code very thoroughly, I was able to anticipate what may happen, noticed the 'point' command but didn't take any notice of where the looping was.

Yeah I'm English. So are you, it seems.

Once I was but the learner,
now, I am the Master.
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 9th Mar 2003 10:50
Don't ever call me Eng**sh. I'm Scottish and there is no-one I hate more than the En**ish.

Considering your country invented the insane concept of the "United Kingdom" I thought you would understand not everyone in it is En**ish.

Visit the Mad Matt Games Website
http://www.geocities.com/madmattgames/index.htm
Home of Witch Bomber and Pinball Football (and a lame website)
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 9th Mar 2003 13:40
lol

fight, fight, fight!!!
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 9th Mar 2003 13:56
Flashingblade, before you consider fighting just remember Stirling Bridge and Bannockburn. You outnumbered us by about 20 to 1 and we still won.

Visit the Mad Matt Games Website
http://www.geocities.com/madmattgames/index.htm
Home of Witch Bomber and Pinball Football (and a lame website)
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 9th Mar 2003 17:21
Be quiet

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 9th Mar 2003 17:22
you outnumbered me?
I wasn't there - and neither were you.

I was joking with the fight fight fight chant.

Calm down and be friendly.

I say Glasgow you say Glasgeeee, #LETS CALL THE WHOLE THING OFF#

^another joke btw
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 9th Mar 2003 17:24
I was talkin to witch bomber. If you have a problem with the english people. Tell them off somewhere else.

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 9th Mar 2003 17:29
I know, I was too
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 9th Mar 2003 17:41
Just a bit of friendly banter. But RPG you should be on my side. The Scottish Wars of Independence, to which I was referring, were fought for almost the exact same reason as the American civil war, and against the same evil throne.

Also, my last post was actualy telling flashingblade a fight wasn't a good idea.

Flashingblade: I wasn't there, but my ancestors and I have suffered the consequences of the evil thirst for power of the Eng**sh throne and we're still suffering.

Visit the Mad Matt Games Website
http://www.geocities.com/madmattgames/index.htm
Home of Witch Bomber and Pinball Football (and a lame website)
maowan
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 17th Apr 2003 19:58
AHEM! can you guys get back to my problem please? x-d

I AM actually interested in any trigonometry etc to make the planes look like theyre flying realistically etc. as i have now got a pretty cool WWII aircraft model.

Can anyone help with this?

Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 17th Apr 2003 23:38
After you put your first post i felt the challenge and developed a code where a bunch of planes fly towards the player randomly whatever position he is or moves to on the matrix and they fly away after him at random..to see such effect with real airplanes is fantastic (i used DBC models)...it took a while so, since you never posted again i did not post either..
the only drawback is that there is no function to prevent them to hit each other..so i tried several randomize numbers till they wouldn't..you could try to do that part yourself
I'll try to make a version with cubes so you can run it straight away and adapt to your needs..give me a day or two..
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 18th Apr 2003 02:20
here it is...
maowan
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 18th Apr 2003 16:25
Hey, Thanks so much Scorpyo

But I copied and pasted the code into a new project to check it out, and the screen just rotates wildly about when i move the arrow keys?

i cant tell what is happening

Am i doing something wrong?

Shadow
21
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 18th Apr 2003 17:49
Ancient feuds should be forgotten. Do you not value your individuality? Your views should not reflect your nationality. Conflict between nations should not be encouraged.
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 18th Apr 2003 18:14
I'll check it again..are you sure you didn't cut out some "return" or other command with the copy and paste?
And, are you sure you are not duplicating some walk commands in your code..

Did you refersh the project? like:

Open New project
paste code
save source as
save project as
close project and reload project
maowan
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 18th Apr 2003 18:45
hi scorpyo,
yeah i saved the source and project and reloaded, its still spinning about uncontrollably.

i can sometimes see the flying objects, but then its spinning too fast.

Maybe if i take out the camera options or something,
i'll give it a go

Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 18th Apr 2003 23:03
mmmm..that's odd..i tried it again and it s fine here..I am on patch 4..are you?
Can someone else who's reading here try it and let us know?
maowan
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 19th Apr 2003 16:09
Hey Scorpyo,
Just installed patch4 and the code works great!! Its fantastic!

Once the cubes have flown over my head the cone resets to the start position... how would i change it so the planes would just continue to fly over the cone no matter where it was?
Ive been changing the code here and there to get it working, cant seem to work it out :-( Sorry about this.

P.S. id love to see the code you were working on since your last code snippet!

Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 19th Apr 2003 21:34
Oh that s easily done..remove this line
x#=landsize/2:z#=500
in the reset subroutine

i put it there to restart whenever i wanted by pressing "r" for testing purposes

you can also remove:
if inkey$()="r" then gosub reset
at the beginning of the do-loop

this other line
if abs(behindz#)>10000 then gosub reset
repositions the cubes randomly as soos as the last one is 10000 units far from the player

i haven't gone much further except building a war scenario with objects and planes ..
I think next i will add a shooting routine so the planes will bomb or shoot at the player (or maybe at the buildings and vehicles)
maowan
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 20th Apr 2003 16:34
COOL!!

cant wait to see that shooting routine!

ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 20th Apr 2003 17:18
scorpyo, would it be ok for me to use this code in a game i'm making at the moment???i would give you the credit but i don't mind if you would prefer to use the code yourself.

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL mynameisnoneofyourbuinsess@hotmail.com to work on the new Star Strike project!!!
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 20th Apr 2003 19:30
No problem ReD-Eye, maowan and all..You can use the code and up to you to put me in the credits if you wish..
Happy I could help ...

maowan, at present i'm working on another project, as i said i made a quick game protoyping with a war scenario using the flying planes routine just to test the effect..so it may take a while before i code the shooting etc.. also i haven t figured out yet what method to use for it..that sphere bullet thing you see around is so lame...
as soon as i have something done i will give a sequel to this flying planes thing..
cheers
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 20th Apr 2003 19:58
thanks mate, not sure for certain if it'll be in the game but it would be a nice effect

ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL mynameisnoneofyourbuinsess@hotmail.com to work on the new Star Strike project!!!

Login to post a reply

Server time is: 2024-09-20 06:52:10
Your offset time is: 2024-09-20 06:52:10