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 / Pattern for a gun

Author
Message
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 11th Sep 2003 03:11
Has anyone made a shotgun code for a pattern as I can do a slug but that just wont work for my game. I had an idea on what to do shucj as make it an array but I have no clue how to make it.
Cheers,
Christian
Thanks in advance Christian.
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 12th Sep 2003 03:20
Does any one have any ideas or a code snipplet I could use or look at?
Cheers,
Christian
TheAbomb12
21
Years of Service
User Offline
Joined: 14th Aug 2003
Location: Amist the blue skies...
Posted: 12th Sep 2003 05:21
Umm.. it would be really hard for you to make a shotgun, or anything else for that matter, while in dark basic. You should probably get some modeling software like Wings 3d, milkshape, or 3D canvas.

Not many people want to take the time to sit there and "code" a shotgun directly from dark basic.

Those who Fight with swords get killed by those who don't
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 14th Sep 2003 07:32
You missunderstande me I mean like the buckshot from the gun or the bullets. For example if you play the game halo and you pull out the shotgun and fire at the wall you see the bullet holes from where the bullets collided with the wall. How would you make a cod for that as I have no idea.

Cheers,
Christian
Velorien
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 14th Sep 2003 15:04
Lets say you have a wall. You model it so that it looks ruined(like that it has bullet holes, grenade fragments etc.). Then you make small objects to fill that holes so that the wall when it's covered with them looks like it's whole, a non-damaged wall. Then you code in DB that when your bullet collides with, let say, object 2 which is a bullethole cover, you hide (or if you can unload it or destroy it or something)the object 2. Then the wall will look like it has a bullethole inside it. Repeat the proces and you get something like that geomode in Red Faction.

I know, i know it's really complicated but hey you can do it with textures or something like that.

I'm the guy that likes to complicate things
Darksyde
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location: Staffordshire, UK
Posted: 14th Sep 2003 15:40
or are u meaning the fact that a shotgun has a spread affect with its bullets, for example they will all fall random within a certain area ?
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 15th Sep 2003 06:45
thats what i thought he was saying. how would you make it so when you shoot your shotgun, it shoots a random spread of about 10 'bullets', how would you make the bullet holes in your wall?

<{^_^<}
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 15th Sep 2003 09:12
bullets would intersect the wall at a given position and u can place a small 3d plain with the bullet texture on it.

Or

Using a bitmap area and a code of a rough filled elipse u can add these to the current textures dynamically.

http://www.lunarpixel.com
It's already tomorrow in Australia
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 17th Sep 2003 01:10
I mean the pattern how would you code that?
Cheers,
Christian
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 17th Sep 2003 01:23 Edited at: 17th Sep 2003 01:28
Do what Indi said. Find where the object collision is between the wall and your bullet object, and place a plain textured with bullet hole there.

EDIT

Feelin generous

BulletObject=1
WallObject=2
BulletTex=3

If object Collision(1,2)>0
BullX=Object Position X(1)
BullY=Object Position Y(1)
BullZ=Object Position Z(1)
Make Object Plain 3,1 : `possibly set cull here
Texture Object 3,3
Position Object 3,BullX,BullY,BullZ
Endif

Somethin like that (wrote it quick, untested, wont work but it'll give ya good idea)

/end edit

RPGamer

Current Project: Eternal Destiny
Porting all files to my new computer
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 17th Sep 2003 02:59
I still dont quite get it (I'm slow sorry). And how would the plain help? I dont need the texture I couldn't care less about the texture.
you lost me with the whole plaine idea.
Cheers,
Christian
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 19th Sep 2003 05:11
Could anyone help me here as I dont understand this.
Cheers,
Christian Merrill
orv
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: Chicago, IL
Posted: 26th Sep 2003 02:34
I believe RPGamer is using the plain object as sort of a piece of a movie set to give the illusion of bullet holes on the wall in the area that was shot at by the shot gun. The texture for this piece would look like the texture of the wall but with bullet holes drawn on it! You would just position it a hair closer to the camera than the wall is (i think) to make sure that you see it.

Another way of looking at it:
* Take a piece of plain old ordinary paper.
* Draw bullet holes on it with a magic marker.
* Pretend to shoot the wall near by with your hand!
* Walk over and tape your picture of the bullet holes to the wall where you aimed!

I think that this is what trick is being attempted here.
Of course since the texture would be the same as the wall, you would only see the bullet holes drawn on the texture not the outline of the plain object that you were texturing!

The piece of paper would be our analogy for the plain object.


The Results:
BAM! you aimed at the wall and shot your shot gun.
Ten bullet holes appear on the wall in the area that you pointed at.

I hope this helps.
Zen_Budha
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Water Valley, MS
Posted: 26th Sep 2003 12:58
Actually although I don't know how I believe what he's trying to do it make the shotgun fire like a shotgun in the game. Where for example a pistol fires a single round, and slightly off target will miss.
Many games have shotguns where you can hit evemy's when not aiming straight at them.
Or in another way of putting it instead of like a single collision line being drawn from the barrels it's a slowly explanding cone. The farther away the more it spreads, and is more likely to hit the target. The closer the target or object the tighter the spread.

He who stands on toilet is high on pot!
Socs
20
Years of Service
User Offline
Joined: 26th Sep 2003
Location:
Posted: 27th Sep 2003 02:51
Mabee if you make 10 little beebees or create them. And then hide them. Then when you hit the key to fire your gun all of the 10 beebees you have created will show up and move like your firing a shotgun.
I cant really help you with the code becuase I'm not really been around DB that much I been working with BlitzBasic.
Sorry.
Socs
20
Years of Service
User Offline
Joined: 26th Sep 2003
Location:
Posted: 27th Sep 2003 02:53
This is what you want your spray to look like right?

...
. . . <---Shotgun Spray the beebees
...
HardBoot
21
Years of Service
User Offline
Joined: 10th Sep 2003
Location: Earth
Posted: 27th Sep 2003 15:59
i dont realy know, new at this stuff, but..
i think it would be the same as shooting one bullet, except make a bunch. then instead of giving them all the trajectory of exactly where the gun is pointing, put a rnd in the angle the bullet gets from the gun/character. Hope it helps.
Socs
20
Years of Service
User Offline
Joined: 26th Sep 2003
Location:
Posted: 27th Sep 2003 16:11
yea thats what I was trying to say. Do what hardboot sayed.

Login to post a reply

Server time is: 2024-09-21 01:13:20
Your offset time is: 2024-09-21 01:13:20