Gamestudio Links
Zorro Links
Newest Posts
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
1 registered members (VoroneTZ), 1,244 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
3rd Person Shooting Script Help! #259366
04/05/09 17:19
04/05/09 17:19
Joined: Jul 2008
Posts: 56
I
iam_ufo973 Offline OP
Junior Member
iam_ufo973  Offline OP
Junior Member
I

Joined: Jul 2008
Posts: 56
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

Re: 3rd Person Shooting Script Help! [Re: iam_ufo973] #259470
04/06/09 10:44
04/06/09 10:44
Joined: Jul 2008
Posts: 56
I
iam_ufo973 Offline OP
Junior Member
iam_ufo973  Offline OP
Junior Member
I

Joined: Jul 2008
Posts: 56
No body wants to help?

Re: 3rd Person Shooting Script Help! [Re: iam_ufo973] #259498
04/06/09 14:31
04/06/09 14:31
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
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.

Re: 3rd Person Shooting Script Help! [Re: the_clown] #260207
04/09/09 13:15
04/09/09 13:15
Joined: Jul 2008
Posts: 56
I
iam_ufo973 Offline OP
Junior Member
iam_ufo973  Offline OP
Junior Member
I

Joined: Jul 2008
Posts: 56
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....

Re: 3rd Person Shooting Script Help! [Re: iam_ufo973] #260209
04/09/09 13:47
04/09/09 13:47
Joined: Jul 2008
Posts: 56
I
iam_ufo973 Offline OP
Junior Member
iam_ufo973  Offline OP
Junior Member
I

Joined: Jul 2008
Posts: 56
Please somebody help me frown

Re: 3rd Person Shooting Script Help! [Re: iam_ufo973] #260210
04/09/09 13:49
04/09/09 13:49
Joined: Apr 2001
Posts: 425
Pittsburgh PA
RAFU Offline
Senior Member
RAFU  Offline
Senior Member

Joined: Apr 2001
Posts: 425
Pittsburgh PA
Hey, Our solution is not free but its certainly the easiest and most powerful solution out there. Intense X - Never Program Again

Thanks.


INTENSE X: The ultimate plug-in for Gamestudio. Available now!
Join our Forums now! Discuss, Vote and win Free Upgrades!
Re: 3rd Person Shooting Script Help! [Re: iam_ufo973] #260212
04/09/09 14:06
04/09/09 14:06
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
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...



Re: 3rd Person Shooting Script Help! [Re: the_clown] #260214
04/09/09 14:28
04/09/09 14:28
Joined: Jul 2008
Posts: 56
I
iam_ufo973 Offline OP
Junior Member
iam_ufo973  Offline OP
Junior Member
I

Joined: Jul 2008
Posts: 56
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

Last edited by iam_ufo973; 04/09/09 14:31.
Re: 3rd Person Shooting Script Help! [Re: iam_ufo973] #260219
04/09/09 14:32
04/09/09 14:32
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
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.

Re: 3rd Person Shooting Script Help! [Re: the_clown] #260240
04/09/09 16:53
04/09/09 16:53
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline
Serious User
Blade280891  Offline
Serious User

Joined: Jan 2008
Posts: 1,580
If you want i can always host the file for you


My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

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