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 / Shell casings ejecting

Author
Message
Opposing force
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 21st Aug 2006 15:37
Right, I have my gun model set up and it fire's bullets. I now need to know the best method on how to make empty shell casings eject from the gun. What I want is, when the gun is fired a shell casing model (yellow cylinder) flys out of the side of the gun, rises in the air for a bit then falls down to the ground and stays there, reacts to gravity basically, like if the player looks down at the ground and fires then the instead of arcing in the air it falls down straight away. So how should I do this? Has anyone got some example code? Thanks in advance.

visit http://teammegabasic.proboards59.com. Register and expand our community. Registration is free and only takes a minute.
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 21st Aug 2006 15:59
im not promoting dark physics,(get if u want)

but if u had it.you could use code like this:

phy set rigid body position shellcasing#,gunpositionx,gunpositiony,gunpositionz

then give it some force like:

phy add rigid body force shellcasing#,rnd(1000),rnd(1000),rnd(1000),1

that would send it flying up & to the side to go down to the ground & just rest there.

Opposing force
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 21st Aug 2006 16:52
Hmm, thanks for the help. I haven't got Dark Physics but thank you anyway.

visit http://teammegabasic.proboards59.com. Register and expand our community. Registration is free and only takes a minute.
Twu Kai
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location:
Posted: 21st Aug 2006 17:24
You could just make a plain, and texture it with shells, then scroll the texture out and down when you are shooting?

Twu Kai- So fast you don't realise you're dead.
Mickm
18
Years of Service
User Offline
Joined: 22nd Apr 2006
Location: Kingston, ON
Posted: 21st Aug 2006 19:49
Unless you want to make your own Gravity Engine you will probably need to get some kind of physics DLL (Dark Physics, Newton, ETC).

But basically I think you can do it something like this
1. MAKE OBJECT CYLINDER Number, Size
2. COLOR OBJECT Number, RGB(255, 255, 0)
3. POSITION OBJECT Number, GunX, GunY + Height, GenZ
4. Add Physics Code (Dll)
5. Done (? maybe)

Anyway thats just my input.
Good luck

Online Flash Games and Guides .::. http://www.gamestack.org
Online Notebook .::. http://onlinenotes.gamestack.org
Opposing force
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 21st Aug 2006 20:47
Twu Kai, Thanks but gravity won't have an effect on it.

Mickm, Thanks! I'll look into that.

visit http://teammegabasic.proboards59.com. Register and expand our community. Registration is free and only takes a minute.

Login to post a reply

Server time is: 2024-09-25 07:26:33
Your offset time is: 2024-09-25 07:26:33