Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood), 1,268 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
shooter #450782
04/22/15 14:48
04/22/15 14:48
Joined: Apr 2015
Posts: 29
Germany
Saschaw04 Offline OP
Newbie
Saschaw04  Offline 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 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Use a cylindrical or capsule shaped proxy entity for your entity wink
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.


Visit my site: www.masterq32.de
Re: shooter [Re: MasterQ32] #450785
04/22/15 17:04
04/22/15 17:04
Joined: Apr 2015
Posts: 29
Germany
Saschaw04 Offline OP
Newbie
Saschaw04  Offline 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 laugh

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 Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Quote:
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...

Quote:
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
Code:
set (my, INVISIBLE);

set this flag in your gun script
Code:
set (my, PASSABLE | ZNEAR);

optional ( if i remember right ) set this ( still gunscript )
Code:
my.genius = myplayer;

if you add "Genius" u need2 add the following code too
Code:
ENTITY* myplayer; // global entity pointer
action YourHeroScriptWED(){
   ...
   ..
   .
   myplayer = me; // set pointer2 this entity, mark as player
   .
   ..
   ...


Quote:
...c_trace problem...
possible solution
Code:
c_trace (....USE_POLYGON | ...);

instead of
Code:
USE_BOX



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=414603

This 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 Offline OP
Newbie
Saschaw04  Offline OP
Newbie

Joined: Apr 2015
Posts: 29
Germany
Quote:
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.

Quote:
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.

Quote:
set this flag in your gun script


Of course I know this.

Quote:
possible solution

Code:
c_trace (....USE_POLYGON | ...);


Yes but there was another Problem.

Quote:
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: Saschaw04] #450799
04/22/15 21:33
04/22/15 21:33
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
I would advice2 use real moving bullets ( means a bullet model moved via c_move ). if they hit something, ull trace from that position2 place a impact-decal-sprite@ hit position, 4ex. This way u have full controll about the collision hulls aka bboxe's.


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] #450800
04/22/15 22:35
04/22/15 22:35
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
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.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: shooter [Re: DLively] #450814
04/23/15 11:54
04/23/15 11:54
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Also a very easy way to create your first fps is to build upon the lite-c tutorial 'shooter2' script (workshop 24, it is one the latter ones where you can fight a wizard with your own wizard) and change the camera to fps camera position and angle. Now you can add weapons that move with the camera etc.

Re: shooter [Re: Reconnoiter] #450823
04/23/15 14:49
04/23/15 14:49
Joined: Apr 2015
Posts: 29
Germany
Saschaw04 Offline OP
Newbie
Saschaw04  Offline 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:

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

M
Malice
Unregistered
Malice
Unregistered
M



try

Code:
action actBullet(){
  	
wait(-1);
ent_remove(entBulletHole);
  	
}


Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1