6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood),
1,268
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
shooter
#450782
04/22/15 14:48
04/22/15 14:48
|
Joined: Apr 2015
Posts: 29 Germany
Saschaw04
OP
Newbie
|
OP
Newbie
Joined: Apr 2015
Posts: 29
Germany
|
Dear Community,
I try to program a Little shooter game (my first Project) and a I have a Problem.
It is a first Person shooter, so I have no Player entity. My Player-Entity is the weapon thats how I want to do it. I dont know how other do it.
The Problem is that my weapon is Little and it s collision hull is Little too. When I move the Player I use c_trace because I want it to stay on the ground. ==> But because of the size it is to near to the ground
Second Problem: I shoot with c_trace and I have the "var mode" USE_BOX but the same matter ==> The size of my box is too Little and because of that it is difficult to hit a enemy (with this small c_trace-beam)
To solve the two Problems I Need to grow the collision hull (it has to get bigger then the weapon).
Can anyone helps me? If I shall share my lite-c code, tell me.
Last edited by Saschaw04; 04/22/15 14:50.
-- started with programming on march 2015 -- -- living in Germany near Dortmund --
|
|
|
Re: shooter
[Re: Saschaw04]
#450783
04/22/15 14:52
04/22/15 14:52
|
Joined: Nov 2007
Posts: 2,568 Germany, BW, Stuttgart
MasterQ32
Expert
|
Expert
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
|
Use a cylindrical or capsule shaped proxy entity for your entity Set the INVISIBLE flag, bind your camera position to the entity position with an offset to the z axis, move your proxy entity with c_move to have character collisions.
|
|
|
Re: shooter
[Re: MasterQ32]
#450785
04/22/15 17:04
04/22/15 17:04
|
Joined: Apr 2015
Posts: 29 Germany
Saschaw04
OP
Newbie
|
OP
Newbie
Joined: Apr 2015
Posts: 29
Germany
|
That is what I first tried, but I did not it beause it was too difficult to set 3 (camera, Player and weapon==> camera Position relativ to Player and weapon Position relativ to camera) But now after hours of Trial and error ==> it works Thank you
Last edited by Saschaw04; 04/22/15 19:08.
-- started with programming on march 2015 -- -- living in Germany near Dortmund --
|
|
|
Re: shooter
[Re: Saschaw04]
#450792
04/22/15 20:25
04/22/15 20:25
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
X
|
X
Joined: Jul 2008
Posts: 2,107
Germany
|
I try to program a Little shooter game (my first Project) Guess its useless2 pray now that a fps is the most bad decission4 a first project... My Player-Entity is the weapon thats how I want to do Very bad idea. Try it and iam pretty sure u know why. Pure collision - mass...only one of thousands reasons why u need2 use at least two models. Simple set this in your player model set this flag in your gun script
set (my, PASSABLE | ZNEAR);
optional ( if i remember right ) set this ( still gunscript ) if you add "Genius" u need2 add the following code too
ENTITY* myplayer; // global entity pointer
action YourHeroScriptWED(){
...
..
.
myplayer = me; // set pointer2 this entity, mark as player
.
..
...
possible solution
c_trace (....USE_POLYGON | ...);
instead of Btw, 2setup your bbox / collision hull u also may look@ "vec_set - min_x, max_x etc., or the POLYGON flag" ( like already said ). Heres a little example i made while ago showing solutions2 every of your probs mentioned above. Most Basic stuff4 writing a ( very simple! ) fps project. Check it out: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=414603This stuff is pretty cool 4 newbies aswell: http://www.rp-interactive.nl/ws/wshops.html...moved2 "Starting with Gamestudio" btw... Peace
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: shooter
[Re: rayp]
#450798
04/22/15 21:28
04/22/15 21:28
|
Joined: Apr 2015
Posts: 29 Germany
Saschaw04
OP
Newbie
|
OP
Newbie
Joined: Apr 2015
Posts: 29
Germany
|
Guess its useless2 pray now that a fps is the most bad decission4 a first project... Yes it is xD But I think it is going well so far. I have a bit experience in spite of it is my first Project. Very bad idea. Try it and iam pretty sure u know why. Pure collision - mass...only one of thousands reasons why u need2 use at least two models. Simple set this in your player model Now I know that is a bad idea. I tried it and see it s bad. set this flag in your gun script Of course I know this. possible solution
Code: c_trace (....USE_POLYGON | ...); Yes but there was another Problem. Heres a little example i made while ago showing solutions2 every of your probs mentioned above. Most Basic stuff4 writing a ( very simple! ) fps project. Thank you for the tuts and Workshops. I didnt know them. Now I have the Basics of a first Person shooter. I can walk around with my gun. Shooting is working too with a crosshair. The only Thing that do not work is that: I shoot with c_trace and use USE_BOX because I want a big beam. But the beam, I think is not big, because I have to shoot exactly on a Point for hit the enemy. It works but it is not perfect. Any tips?
-- started with programming on march 2015 -- -- living in Germany near Dortmund --
|
|
|
Re: shooter
[Re: rayp]
#450800
04/22/15 22:35
04/22/15 22:35
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
Serious User
|
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Check out my tutorial on how to start your fps as a first step, and to get some ideas on how things can work together.
Last edited by DLively; 04/22/15 22:36.
|
|
|
Re: shooter
[Re: Reconnoiter]
#450823
04/23/15 14:49
04/23/15 14:49
|
Joined: Apr 2015
Posts: 29 Germany
Saschaw04
OP
Newbie
|
OP
Newbie
Joined: Apr 2015
Posts: 29
Germany
|
Thank you. Problem is fixed now. But now another Problem: I want to make bullet holes where I shoot ==> And it works, but I can not remove they. The bullet holes should go away after some time. This is a Piece of my code:
action actBullet(){
wait(-1);
ptr_remove(entBulletHole);
}
function MpfiveShoot(){
while(mouse_left){
ent_playsound(player,sndShoot2,50);
c_trace(vector(camera.x,camera.y,camera.z),vecTarget,IGNORE_ME|USE_BOX|ACTIVATE_SHOOT|IGNORE_PASSABLE);
if(!you)
ent_create("bullet_hole.tga",target.x,actBullet); wait(-0.1);
}
}
Last edited by Saschaw04; 04/23/15 14:53.
-- started with programming on march 2015 -- -- living in Germany near Dortmund --
|
|
|
Re: shooter
[Re: Saschaw04]
#450827
04/23/15 15:18
04/23/15 15:18
|
Malice
Unregistered
|
Malice
Unregistered
|
try
action actBullet(){
wait(-1);
ent_remove(entBulletHole);
}
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|