3rd Person Shooting Script Help!

Posted By: iam_ufo973

3rd Person Shooting Script Help! - 04/05/09 17:19

Hey Folks wink
It is first time i am scripting first person shooting game so i am very confused. Help me please.
When player touches the gun model how to attach it to player and let the player shoot with it?
Is there any tutorial out there? Or can someone give me some example scripts please?
Many Many thanks from advance smile
Posted By: iam_ufo973

Re: 3rd Person Shooting Script Help! - 04/06/09 10:44

No body wants to help?
Posted By: the_clown

Re: 3rd Person Shooting Script Help! - 04/06/09 14:31

What is it now? First person or third person?
If you want to make a first person shooter, I would recommend you Grimber's first person tutorials (AUM resources), but unfortunaly they're in c-script. But the ideas and systems are clear, and they are easily transportable.
If you want to make a third person shooter, well... That might be more difficult, so I'd start with first person; In third person, you have to care about bone rotations, camera collision, entity attachement... if you never did a shooting game before, that could be too much for the beginning.
Posted By: iam_ufo973

Re: 3rd Person Shooting Script Help! - 04/09/09 13:15

Thanx the_clown for your reply.
I don't want to go for bone animation etc yet it would make things very complicated.
All i want is how to attach a gun model to player and let him shoot through it. it is that simple....
Posted By: iam_ufo973

Re: 3rd Person Shooting Script Help! - 04/09/09 13:47

Please somebody help me frown
Posted By: RAFU

Re: 3rd Person Shooting Script Help! - 04/09/09 13:49

Hey, Our solution is not free but its certainly the easiest and most powerful solution out there. Intense X - Never Program Again

Thanks.
Posted By: the_clown

Re: 3rd Person Shooting Script Help! - 04/09/09 14:06

Well, I'd not recommend to buy Intense X if the goal only is attaching a gun to the player...
However, Intense X is great and everything, but attaching the gun to the player and let him shoot through it indeed IS simple. But how to do that still depends on the kind of game you are making, first person or third person?
The principe is the same anyway. In both modes, you have to define a position for the gun model, a vector of course.
For example:

VECTOR gun_position;

Then you have to update that vector; the x, y and z values have to be set. So you have a function, call it update_gun_pos or whatever.
Now, in third person mode, you would attach the gun to the player's hand vertices, using vec_for_vertex:

function update_gun_pos()
{
while(1)
{
vec_for_vertex(gun_position,my,2230);
// change the vertex number to the desired!!!

wait(1);
}
}

This is very basic;
Now, in first person mode, you would set the vector relative to the camera:

function update_gun_pos()
{
while(1)
{
vec_set(gun_position,vector(30,-20,-10));
// play with the vector values
vec_rotate(gun_position.x,camera.pan);
vec_add(gun_position.x,camera.x);


wait(1);
}
}

I suppose you understand all of these vector functions.

The last thing to do is to set the actual model to the position;
This can now easily be done. The following code works with both of the snippets above. It turns a weapon model to a item that can be picked up and will stay at the desired position all the time:

action sample_gun()
{
while(vec_dist(my.x,player.x)<30)
{
wait(1);
}

while(1)
{
vec_set(my.x,gun_position.x);
// now decide: if in third person mode, write this line:
my.pan = player.pan;
// if in first person mode, write this line:
vec_set(my.pan,camera.pan);

wait(1);
}
}

The gun won't fire yet; I unfortunaly don't have the time to write this down now. If you want, I can try and write a little tutorial for gun code. But someone'll have to tell me how to upload it...


Posted By: iam_ufo973

Re: 3rd Person Shooting Script Help! - 04/09/09 14:28

the_clown many many thanx for taking your time and writing this tutoirla though it is still incomplete i wish you could make a complete tutoiral with sample project smile.
I will be waiting for the rest of the tutorial.
Once again thanx

Edit:: As for uploading there are hudreds of free hosting servers there like rapidshare, mediafire, filefactory etc a simple google search will bring thousands of these free file hosting servers smile
Posted By: the_clown

Re: 3rd Person Shooting Script Help! - 04/09/09 14:32

No problem. I will make this tutorial as soon as possible, but it's possible that it takes me a few days, or even a week, as I don't have much time; However, I will include the code for to weapons in third and first person mode, including animations.
Posted By: Blade280891

Re: 3rd Person Shooting Script Help! - 04/09/09 16:53

If you want i can always host the file for you
Posted By: iam_ufo973

Re: 3rd Person Shooting Script Help! - 04/09/09 17:10

And don't forget a sample working project smile
Many many thanx
Posted By: the_clown

Re: 3rd Person Shooting Script Help! - 04/10/09 09:51

Originally Posted By: Blade280891
If you want i can always host the file for you


That would be nice. I'll send it to you per e-mail as soon as I have finished it. I think I'll find your mail address in your profile description, won't I?
Posted By: Blade280891

Re: 3rd Person Shooting Script Help! - 04/10/09 10:41

Should, do, just a pick a site you want the file on, http://randomgames-design.awardspace.com
http://spearbang.awardpsace.com
http://game-design.djw-designs.com
or others, lol
Posted By: DLively

Re: 3rd Person Shooting Script Help! - 04/11/09 23:44

Hi.

Check my website in the c-script section.
I uploaded a free fps system with gun pickup and health system... its very basic, with jump, duck, shoot, kill, and of coarse walk... :P

Its just something to work off of and see how its pretty much done.


enjoy.
Cheers!

Devon.
Posted By: iam_ufo973

Re: 3rd Person Shooting Script Help! - 04/12/09 08:50

the_clown any update?
DevoN thanx for your help let me check your website.
Posted By: the_clown

Re: 3rd Person Shooting Script Help! - 04/13/09 17:05

I'm currently busy with my own project; It could take up to two weeks or more. I really would recommend you to check DevoN's site, it looks very helpful. I could manage it faster if I would not have to add code and stuff; anyway, I'see what I can do.
Posted By: the_clown

Re: 3rd Person Shooting Script Help! - 04/18/09 09:12

Eyo, DevoN, the rar file is damaged! I'm talking about the FPS outline on your site. WinRar cannot open it correctly!
© 2024 lite-C Forums