Adding a weapon to FPS
Adding a weapon to FPS
hi there guys,
Firstly I should start by stating I'm new to using the engine Loving it so far, run through the examples etc and understand most stuff. Unfortunately only being 16 means I cant quite match most of you guys in c++ experience (i probably havent been alive as long as u guys have been coding hehe) but i do have about 3years practice with it so I feel I know enough to use the engine quite well...
My ultimate aim is to create a very basic first person shooter. Then keep remaking it adding more each time until the game is of a great quality...
I learnt last night how to load in my map from doom3 I have to say it looked ace...absolutely perfect. I now want to add to this by adding a weapon to the view like in most FPS games.
How would I go about this? Should I model it in 3dsmax? And how would I go about rendering it so it is always visible in the bottom left of the screen? At the moment I just want the weapon to be displayed...It doesnt even have to be able to shoot.
Any help really would be appreciated guys thanks
Firstly I should start by stating I'm new to using the engine Loving it so far, run through the examples etc and understand most stuff. Unfortunately only being 16 means I cant quite match most of you guys in c++ experience (i probably havent been alive as long as u guys have been coding hehe) but i do have about 3years practice with it so I feel I know enough to use the engine quite well...
My ultimate aim is to create a very basic first person shooter. Then keep remaking it adding more each time until the game is of a great quality...
I learnt last night how to load in my map from doom3 I have to say it looked ace...absolutely perfect. I now want to add to this by adding a weapon to the view like in most FPS games.
How would I go about this? Should I model it in 3dsmax? And how would I go about rendering it so it is always visible in the bottom left of the screen? At the moment I just want the weapon to be displayed...It doesnt even have to be able to shoot.
Any help really would be appreciated guys thanks
Make it in max and export it to .X or .My3d (or whichever format) if you want animation on the weapon then .X.
Load it in irrlicht using the relevent mesh loader and then just do what bitplane posted.
btw if you re 16 and have 3years experience with c++ (even if it is basic) then you are doing well, by the time you are in your mid 20s you should be a coding genius
Load it in irrlicht using the relevent mesh loader and then just do what bitplane posted.
btw if you re 16 and have 3years experience with c++ (even if it is basic) then you are doing well, by the time you are in your mid 20s you should be a coding genius
ah ha cheers guys Will try it as soon as i get home from college...hehe i read the examples yea...just wasnt to sure on how to use what i'd learnt to load an image that doesnt move. eg...the quake 3 map moves when you move the camera (obviously) wasn't quite sure how to add something that didnt move
Hehe cheers...Thought I'd learn early To be honest I'm only at a very basic level with it, but hopefully I'll improve leaps n bounds as I learn to write this game.
Also just as a side note...how good is the engine for use with Vb? Might use it in some college projects, spice up my vb lessons a bit hehe...so boring. I'm sat here being taught the very basics that i learnt years ago ( I wanna do something that tests me a bit more
Hehe cheers...Thought I'd learn early To be honest I'm only at a very basic level with it, but hopefully I'll improve leaps n bounds as I learn to write this game.
Also just as a side note...how good is the engine for use with Vb? Might use it in some college projects, spice up my vb lessons a bit hehe...so boring. I'm sat here being taught the very basics that i learnt years ago ( I wanna do something that tests me a bit more
hehe okies I have my weapon loaded into my game now. But I'm really struggling to work out how to get it to stay in the bottom right corner of my screen as i move the mouse and run around the map. I need to lkink it to the camera in some way like in every First person shooter but I'm not quite sure how?
Any help really would be appreciated... And thanks to all those above who helped
Any help really would be appreciated... And thanks to all those above who helped
ok...I've managed to work it out Works quite well but there's still a few things I need to sort out. Firstly though in case anybody has had the same problem as me, or would like to see a simple way of graphically implementing a weapon into a fps game here's the code I'm using:
Now I have one problem remaining...When ever the gun goes near a wall in my map part of it sinks into the wall and disappears. Is there anyway of making sure that all of the gun is always visible on screen no matter what?
Code: Select all
scene::IAnimatedMesh* weapon = smgr->getMesh("../../Static Meshes/assaultrifle.3ds");
scene::IAnimatedMeshSceneNode* weapon1 = smgr->addAnimatedMeshSceneNode( weapon );
weapon1->setParent(camera);
weapon1->setPosition(core::vector3df(72,-80,110));
Even in Planetside, an MMO FPS game from SOE ( Sony ) the weapons go into walls.
2 options to resolve it, that I can think of :
Just make walls thick enough, so weapons didn't stick out the other side and not worry about the gun going into walls.
Or, as was said in another thread, increase the radius of the collision around the camera so the weapon is included.
2 options to resolve it, that I can think of :
Just make walls thick enough, so weapons didn't stick out the other side and not worry about the gun going into walls.
Or, as was said in another thread, increase the radius of the collision around the camera so the weapon is included.
why not try this? it saves positional fur-bars and always works - there is never anything to be drawn on the screen side of the weapon only behind it - plus you get a speed boost by not z-testing it.Anonymous wrote:Turn of the ztesting for the weapon mesh - and draw it LAST always - then it is never drawn inside another object.
ah well