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 / Help me with Making my shooting good.

Author
Message
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 14th Dec 2004 04:43
Okay don't get me wrong, I know how I can get a bullet to come out if the left mouse button is clicked. But my shooting looks really lame. I have a gun shot noise, but I'm not good as positioning stuff so where I positioned my listener and sound in 3D space. This is for a first person shooter. Also I want it to look more like the shooting does in time splitters, like you see a bunch of cool effects and it feels like a gun. Not just an object coming out and hitting something. Another thing I have a problem with is the positiong of the bullet so it comes out of the gun but it goes to where I aimed, and my gun is towards the right hand side of the screen. You know all the effects that make it looks like you are firing? How can I add this in? And what rotation properties must I set to have the bullet shoot correctly? Some help would be appreciated. If you need some code that I have, I'll email it to you.

Have a heart and join my message board.
FoxBlitzz
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location: United States
Posted: 14th Dec 2004 05:26 Edited at: 14th Dec 2004 05:27
Quote: "Another thing I have a problem with is the positiong of the bullet so it comes out of the gun but it goes to where I aimed"


I suppose you could use raycasting for that. It is a feature in Nuclear Glory Collision and the Newton Physics Wrapper (DBPro only). Give NGC a try. It might help you to code some of those other bullet effects, too.

UNVIDIA GeFartFX 5600 Crud Edition
Featuring an unbeatable 0-1 FPS in 3DMark05!
If Return to Proxycon were a game, I would die before I saw the door open!
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 14th Dec 2004 05:34
Well I'm using DBC until I managae to purchase DBP, which won't be until next year so Raycasting won't work nor will Newton Physics (which I wish I could add). And I'll download the NGC demo a try too. Thanks Evil Monkey.

Have a heart and join my message board.
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 16th Dec 2004 01:24
I could never get NG to work!!!! Im trying to figure out how to try Sparkys Collision DLL. You should try that!

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 16th Dec 2004 03:22
Where can I find Sparky's collision DLL? And also can anyone help me make some realistic looking shooting? All I really need help with is the eeffects I can get the shooting to happen if the mouse button is pressed and all...

Please?

Have a heart and join my message board.And now my messageboards work again!Woot!
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 17th Dec 2004 21:20
Uhhh go to Program announcments (I think) and look for DBP/DBC Collision DLL - FREE by Sparky. If you can work out how to use it please tell me!

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 18th Dec 2004 03:34
Thanks. Now I just need to figure out what I can do to make my shooting look good...
Will look for Sparky's collision.

Have a heart and join my message board.And now my messageboards work again!Woot!
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 18th Dec 2004 04:26
Hey i just had an idea! For a muzzle flash have lik 2 textures of the flash in action then create a plain, position it in front of the gun and hide it and do something like:

Load Image "flash1",1
Load Image "flash2",2

Anim = 1

Make Object Plain 1,10,10,10
Hide Object 1
Texture Object 1,Anim

Do

If mouseclick()=1
Show Object 1
Inc Anim,1
EndIf

If Anim > 2 and Mouseclick()=1
Anim = 1
EndIf

If MouseClick()=0
Hide Object 1
EndIf
Loop

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 18th Dec 2004 05:41
Well I would need two flashing textures, but if I two that go together to make it look good then that would probably work. BTW, I'm going to try your snippet now.

Have a heart and join my message board.And now my messageboards work again!Woot!
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 18th Dec 2004 05:52 Edited at: 18th Dec 2004 05:52
If you need muzzle flash images just do a google!

Looks like its just you and me talking again...

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 18th Dec 2004 06:32
That's what I planned to do. But thanks for the help.

Have a heart and join my message board.And now my messageboards work again!Woot!
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 18th Dec 2004 10:53
I must be using the wrong words when searching, I tried:
Muzzle Flash images
Muzzle Flash textures
And also tried those two queries with quotes. God hates me .
I don't suppose anyone else has some?
Also how can I make the vibration of the gun look real when you're shooting lots of guns? (I'm bad at explaining if you want to know what I mean look at the Uzi in David T's Mercenaries 2 Demo).

Have a heart and join my message board.And now my messageboards work again!Woot!
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 18th Dec 2004 18:40
Ill try and get u some muzzle flazshes as for vibration how about when you shoot increase the y position of the gun by 1 then when the guns position is 2 dec guns position by 1. See code below:

Position Object Gun,0,0,0
posy = object position y(Gun)

Do

If mouseclick()=1
inc posy,1
Endif

If posy > 2 and mouseclick()=1
Dec posy,1
Endif

If posy < 0 and mouseclick()=1
Inc posy,1
Endif

Loop

Im not to good at FPS so it probably wont work

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 18th Dec 2004 19:15
Here is a muzzle flash texture that i found on a google search!

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)

Attachments

Login to view attachments
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 18th Dec 2004 21:39
That texture is perfect! Thank you sooooo much Saberdude!
What query did you type in? Lemme guess the exact same as me...
Man I'm an idiot.

Have a heart and join my message board.And now my messageboards work again!Woot!
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 18th Dec 2004 21:44
Heheh No Prob! I typed Download Muzzle Flash Textures

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 18th Dec 2004 21:46
Oh, So you just added in Download.
Btw, check your email I sent you the code.

Have a heart and join my message board.And now my messageboards work again!Woot!
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 19th Dec 2004 00:19
Saberdude, which site did you get that muzzle flash from? Because I was going to add in the Muzzle Flash to my game based off of your code and realized I'd need another one that is the same so I could do your Anim thing to have a muzzle flash.

That came out really odd, didn't it?

Have a heart and join my message board.And now my messageboards work again!Woot!
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 19th Dec 2004 21:17
Ummm... Oh I cant remeber. Ill check the History and try to find it! Cant you just use the one in the download and modify it a bit? Just rotate it 90 degress or something

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 19th Dec 2004 21:39
I guess that could work...

Have a heart and join my message board.And now my messageboards work again!Woot!
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 19th Dec 2004 22:46 Edited at: 19th Dec 2004 22:49
So I was trying to implement the muzzle flare and it turned out ugly when I set the transparency (doesn't matter I'll try and find a better one later). But my real problem is positioning the plain when it's locked on to the screen. The only it is on the screen is with these coardinates:

If I move the Z to something like .25, the plain does not appear on teh screen! This is really bugging me.

Do I have to move by like .1 or something?

Also, it appears that my muzzle flash image is not changing when anim in increases. This is really buggin me.

Have a heart and join my message board.And now my messageboards work again!Woot!
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 20th Dec 2004 00:58
If something's too close to the camera, by default DarkBasic won't bother showing it.

See the built-in documentation for the SET CAMERA RANGE command.

(SET CAMERA RANGE Front Value, Back Value)

By default, the documentation says, Front Value would equal 1 and BackValue would be 3000.

Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 20th Dec 2004 00:59
Hmmm... Try setting culling on for the disapperaing plain. As for the anim I dont know how to fix that since Ive never done that sort of thing before.

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 20th Dec 2004 02:34
I'll try to set the culling on, and thanks for the info about camera range. What should I set the range to have it work then?

Have a heart and join my message board.And now my messageboards work again!Woot!
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 20th Dec 2004 02:37
SET CAMERA RANGE 1,5000

That should do it

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 20th Dec 2004 02:43 Edited at: 20th Dec 2004 02:50
Thanks Saberdude.

Ugh! When I tried to move the X position it disappeared again, I had these coardinates:




Have a heart and join my message board.And now my messageboards work again!Woot!
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 20th Dec 2004 04:42
try moving it 0.5. Whats the object limit in DBC?
Quote: "Position object 5000"


DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 20th Dec 2004 04:47
I'll try moving it .5, I have no clue waht the object limit is. But 5000 is okay because the object appears on screen when it has these coardinates:


Have a heart and join my message board.And now my messageboards work again!Woot!
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 3rd Jan 2005 00:53
Well I've made absoloutly no progress in getting my shooting good, and it bugs me so much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
Does anyone have anysnippets of code that could help me get all this stuff right, I'm really struggling here.

Have a heart and join my message board.And now my messageboards work again!Woot!
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 3rd Jan 2005 01:15
What is it that is exactly wrong here? Is it the rate of fire? Ill find some snippets for you.

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 3rd Jan 2005 01:18
Here is some code! It works for DBP (Which i got for Xmas!) Dunno if it works in DBC. But try it anyways! Ill keep looking though!


DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 3rd Jan 2005 01:19
Quote: "Whats the object limit in DBC?"


65535

Am I the only one here who's really confused?
http://db1games.topcities.com
(used to be demonsbreath)
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 3rd Jan 2005 01:30
Well I want to add a muzzle flare and have the recoil look good, I'll take a look at the rate of fire thing though, it might be helpful if I can get it working in DBC. If not I'll use it in DBP when I get that, because at the moment I might be getting sooner than expected so I could transitino this project to DBP.

Have a heart and join my message board.And now my messageboards work again!Woot!
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 3rd Jan 2005 01:33
Ill work on the recoil for ya!

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 3rd Jan 2005 01:35 Edited at: 3rd Jan 2005 01:46
Check out the 'Iced' demo which came with DBC. That had good rate of fire and recoiling.
[Edit]
Here is an animated flary thingy.


Realms Of Tutopia I : Rise Of Evil - A hack+slash RPG
http://www.freewebs.com/elbsoftware/index.htm
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 3rd Jan 2005 02:56
Oh I've got a muzzle flare from lime-fly and a damn good one too!

Have a heart and join my message board.And now my messageboards work again!Woot!
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 3rd Jan 2005 03:13
Is it animated? Damn I cant seem to position the cylinder(Acting as a gun) in the right place for my example!

DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 3rd Jan 2005 03:17
No but I have 2 images the muzzle flare and the same one rotated so it looks different.

Have a heart and join my message board.And now my messageboards work again!Woot!
DeHonCha
20
Years of Service
User Offline
Joined: 2nd Dec 2004
Location: A world of my own...
Posted: 5th Jan 2005 04:40
i think i have the answer to your problem

try my examples - download the zip file for a spicy simple game with
shooting, effects and sound or just try the snippet for a more simple
approach.

if you do try the zip just unzip it anywhere and run the .dba file

if you view the snippet you may notice the "flare.bmp" image which you
can find in the download (zip) or just substitute your own

sorry if the bullet doesn't come out of the gun nozzle - didn't quite
figure that out meself either :S

have fun - hope this solves your problems

good luck

For when they said I couldn't, I did...

Attachments

Login to view attachments
DL187
20
Years of Service
User Offline
Joined: 14th Nov 2004
Location:
Posted: 5th Jan 2005 07:10 Edited at: 8th Jan 2005 07:34
kool demo
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 5th Jan 2005 07:33
I have noticed that also, and other's have in Halo. But I don't know how I could do that but still have it look "real".

Have a heart and join my message board.And now my messageboards work again!Woot!
Sol462
20
Years of Service
User Offline
Joined: 12th Sep 2004
Location: playing with the spazookeedoo
Posted: 5th Jan 2005 09:43
good demo

coffee + monkeys + creativity = games
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 5th Jan 2005 09:56
What's a good demo?

Have a heart and join my message board.And now my messageboards work again!Woot!
Sol462
20
Years of Service
User Offline
Joined: 12th Sep 2004
Location: playing with the spazookeedoo
Posted: 5th Jan 2005 10:38
the one dehoncha uploaded on page 1

coffee + monkeys + creativity = games
DeHonCha
20
Years of Service
User Offline
Joined: 2nd Dec 2004
Location: A world of my own...
Posted: 6th Jan 2005 00:25
so does that help anime?

For when they said I couldn't, I did...
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 6th Jan 2005 02:12
Gonna check it out soon.

Have a heart and join my message board.And now my messageboards work again!Woot!
DeHonCha
20
Years of Service
User Offline
Joined: 2nd Dec 2004
Location: A world of my own...
Posted: 6th Jan 2005 20:46
okay - i'll be waiting ...

For when they said I couldn't, I did...
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 7th Jan 2005 02:13 Edited at: 7th Jan 2005 02:35
Woot!
That code was everything I've been needing it was the perfect example! That was really helpful. Can't wait to implement something similar into my code. But stay here cuz I might need some help with some of your code.

Sipmle enough to implment into my code I've only got 1 problemo, and that's that my muzzleflare image is pasted in the top right hand corner of the screen, now I can shoot and it does the same as in your code but the image is just there all the time, I'm still looking for any prolbems though.

Fixed it, stupid mistake on my part. No need to tell you what it was just an line that shouldn't have been there.

Anyways I really have problem with sound and listeners I have downloaded a bunch off of Psionics site but I don't know where to position the sound in 3D space and have the timing right so you here the "BANG!" when I actually shoot the bullet.

Have a heart and join my message board.And now my messageboards work again!Woot!
DeHonCha
20
Years of Service
User Offline
Joined: 2nd Dec 2004
Location: A world of my own...
Posted: 7th Jan 2005 06:00 Edited at: 7th Jan 2005 06:01
did you try the download example
it includes sound

and i didn't use listeners for my sound effects (gun shot) just a simple play sound command

For when they said I couldn't, I did...
Cian Rice
20
Years of Service
User Offline
Joined: 8th Jun 2004
Location:
Posted: 7th Jan 2005 07:23
Oh. No I didn't try the downloaded example. Well anyways its a very good basic code so now I can work with it cuz it kinda makes my current gun(an Ak-47) act more like a tactical 12-gauge. But it's great none-the-less.

Have a heart and join my message board.And now my messageboards work again!Woot!

Login to post a reply

Server time is: 2025-05-24 03:29:06
Your offset time is: 2025-05-24 03:29:06