3d Wepon Weilding help

Blitz3D Forums/Blitz3D Beginners Area/3d Wepon Weilding help

Pooder(Posted 2007) [#1]
Hi, i've been working on a fps because i was tired of making 2d games. The problem is, I don't know how to make the player weild a 3d gun. All i can make is a doom1-like gun-holding system. Also, I need help makin nade chuckin and rocket firin. I have no clue what a parent, piviot, child, or that kind of crap is (I need to code as quick as possible because of my homework.)
All help will be apprecated, Thank-You.


puki(Posted 2007) [#2]
You seem to be the newest purchaser of Blitz3D.

You might want to start off playing around with the sample programs. Let us know if you don't though - there are probably some FPS-type shells in there.

You must know something about parents, pivots, children, etc - coz you mentioned them.


jhocking(Posted 2007) [#3]
I have no clue what a parent, piviot, child, or that kind of crap is (I need to code as quick as possible because of my homework.)

We all know about having limited time to code because of other responsibilities. That doesn't change the reality that you need to learn "that kind of crap." If you don't think you have enough time to read the documentation and learn how things work, then you don't have enough time to make a game.


altitudems(Posted 2007) [#4]
"I have no clue what a parent, piviot, child, or that kind of crap is"
Why does this make me laugh so much?

Good luck dude, your gonna need to learn that kind of crap.


Pooder(Posted 2007) [#5]
Ok, I am a fricken 6th grader who read a book and decided to try programing. I read it in 5th grade and i just started 3d programing. This is my first ever game and I don't know what they are and why there are needed. So can you just PLEASE tell me what they are. I just want to know the quickest way to use them in a way that dosen't lag.


jhocking(Posted 2007) [#6]
Well the fastest way is to just position the gun in the right place relative to the camera and then use EntityParent(gun,camera) so that now whenever you move the camera the gun moves with it.

In my mind though this is a doom-like gun holding system (in my mind, every fps game looks the same for how the gun is held; the gun sticks out from the bottom of the screen facing forward and moves with the camera) so I don't know what exactly you are asking about.


Blitz3dCoder(Posted 2007) [#7]
Hey pooder,
Congrats on buying blitz3d,
One thing though, Not that anybody on this site has problems or anything, but it is not a good idea to tell people your age on the internet. I am sure you knew that, but just a reminder.


Pooder(Posted 2007) [#8]
Umm, that didn't work. The gun isn't showing and when I shoot, I just get an illegal memary adress. Here is my code:
c = CreateCamera()
CameraRange c,1,600

PositionEntity(c,80,20,24)
p = LoadMesh("arm.3ds")
ScaleMesh(p,0.01,0.01,0.01)
EntityParent(p,c)


Pooder(Posted 2007) [#9]
Oh, and i am not tryin to make it like doom, cause i hate doom. I'm just sayin thats what they currently look like.
(I know im soundin like a nublet, but how the heck do i quote???)


Ross C(Posted 2007) [#10]
Read the site FAQ's. And read the manual. They both explain everything you need to know... Making a game with elements you don't understand, will ultimately kill it. When you get an error, and don't have the understanding of how these parts work, as above, then the community will probably end up making your game.

Go read the manual, try the samples.

Additionally:

c = CreateCamera()
CameraRange c,1,600

PositionEntity(c,80,20,24)
p = LoadMesh("arm.3ds")
ScaleMesh(p,0.01,0.01,0.01)
EntityParent(p,c)


If that's the code your using to shoot then i'm not surprised it ain't working. You need to show the code that involves the loading of your meshes, and the main loop which controls the movements and actions of the player.

Just cause your young, doesn't give an excuse :oP ;o)


Pooder(Posted 2007) [#11]
Man, Why can't ppl understand me. Thats my code to HOLD the wepon. I must be typing in somthin wrong.


Pooder(Posted 2007) [#12]
The samples are random and can't help me, i gusse i'll have to guess and check here.


Ross C(Posted 2007) [#13]

The gun isn't showing and when I shoot, I just get an illegal memary adress



That's what you typed. It's the code for showing an arm AND firing.


Pooder(Posted 2007) [#14]
The shooting is totaly a diffrent code. Did i misstype somthing or what? Seriosly, pay atention.


boomboom(Posted 2007) [#15]
You seem very angry and frustrated. Your not going to get anywhere like that. Calm down a little, if you don't have the time to make an FPS but really want to then try http://www.fpscreator.com/

Otherwise your just going to have to take it slow and learn these things.

Plus, swearing (even using asterisks **** etc) isn't genreally acceptable on these forums, so ask nicely and you will recieve.

In response to your questions a pivot is a completely empty 3D object, you can use them to group several items together under a pivot.

This is where parents and childen come along, for example, if you make a pivot and then parent a cube and a camera to it, when you move the pivot the camera and cube will move along with it automatically.


boomboom(Posted 2007) [#16]
This might be useful for you

http://www.blitzbasic.com/codearcs/codearcs.php?code=559


jhocking(Posted 2007) [#17]
Seriosly, pay atention.

This is a deliciously ironic sentence: rude contempt for the intelligence of others mixed with atrocious spelling.


PowerPC603(Posted 2007) [#18]
As boomboom said, a pivot is just a 3D point in space, without any physical appearance.
You can use it to attach other objects to it.

What a child and parent is:
Look at it like this.
Take your house for example.
Each room is a child of the house.
Each object in a room is a child of the room, and also of the house.
The house itself is the parent of every room.
A room is also a parent for each object in that room.

When you move a parent, all children attached to it will move too.
If it where possible to move your house, all rooms and objects inside it would move too, as they are all children of the house.

BUT, if you where to move an object, the room stays in the same place, as will the house.
Then you see that when you move a child, the parent will not move.

When you move a room, the house will stay in place, as this is the parent of the room.
But any object inside the room will move when you move the room, because they are all children of the room.

Parent/child stuff is not that difficult.
Or look at a tree.
When you move the tree, all branches and leaves will move with it.
The leaves are children of a branch (which in turn is the parent to the leaves attached to the branch), as the branches are children of the tree, which in turn is the parent for the branches.

When you remove a branch from the tree, the tree itself will stay where it was, but the leaves attached to the branch will move together with the branch.


Ross C(Posted 2007) [#19]
Thing is... if you irritate people on here, and they ain't going to help you again. Grow up, read the examples, and the manual, the same everyone else here did. And if you do ask a question, make sure it makes sense.

As the guys above have said, you need to create a camera. Then load in the arm. Parent the arm to the camera. If it's not showing then:

- The position is wrong.
- The scale is wrong. Needs either upscaling or downscaling. No-one knows here except you, as we can't see the arm.
- You arm isn't loading the first place.

As for paying attention, yes, yes should.


Pooder(Posted 2007) [#20]
Ok sorry, i was gettin mad cause i had no clue about what to do. I figured out what to do thanks to my stratigies of programing(type in random stuff and somehow it works). Anyway, ty for not callin me a nub, a little kid,or a ...., anyway this place has the best online communty i'v ever seen. I just have 1 more question, how do i make it so i can swap wepons without altering much of my code? I have an idea but I can tell there will porbibly be a glitch when i try it.
P.S. the arm is an armcannon as seen in the metroid games.


Pooder(Posted 2007) [#21]
Ok, i admit I rush typing and I don't reread my sentences for grammer. Yet I still have straait a's!^.^


Terry B.(Posted 2007) [#22]
Freshman in highschool and I have no trouble learning this crap in between my homework.

Alright, back on topic,
A pivot is just a point in space thats given a handle, imagin an invisible ball you can assign things too.
If you make an object a parent to somthing else( by entitypivot or other ways) then the if the object that is a parent moves, the object that is a child moves, but NOT the other way around.
So you assign a gun to a "Hand" pivot. Then the gun moves with the hand.
And now back to my homework.


Pooder(Posted 2007) [#23]
Ok,ty
Also,
Sorry for bein jerkey im use to runescape and callin ppl bad names...


jhocking(Posted 2007) [#24]
For switching guns, the simplest thing would be to simply attach them all to the camera and then use HideEntity/ShowEntity to control which is in view at any time. Mind you, this isn't necessarily the best way depending on exactly what you want to achieve, but it's certainly the simplest.


Pooder(Posted 2007) [#25]
Thax