2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
attach weapon to player
#178042
01/15/08 12:19
01/15/08 12:19
|
Joined: Dec 2005
Posts: 490 Germany/Berlin-Velten
kasimir
OP
Senior Member
|
OP
Senior Member
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
|
Hello - i found this code to attach a weapon to the player... it works but sometimes it is not correct. The Code uses two vertex to orient the weapon, but i think if its possible to use tree vertes it will work fine! So Someone knows a better code??? Code:
while(player) { vec_for_vertex(temp.x,player,145); vec_for_vertex(temp2.x,player,141); vec_set(my.x,temp.x); vec_diff(temp.x,temp2.x,temp.x); vec_to_angle(temp.pan,temp.x); vec_set(my.pan,temp.pan);
wait(1); } THX kasimir
|
|
|
Re: attach weapon to player
[Re: Mythran]
#178045
01/15/08 18:53
01/15/08 18:53
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
dont know why you didt it but the .x isnt imported Code:
while(player) { vec_for_vertex(temp,player,145); vec_for_vertex(temp2,player,141); vec_set(my.x,temp); vec_sub(temp,temp2); vec_to_angle(my.pan,temp);
//if its pan 180 to much //vec_set(my.x,temp); //vec_sub(temp2,temp); //vec_to_angle(my.pan,temp2);
wait(1); }
"empty"
|
|
|
Re: attach weapon to player
[Re: flits]
#178046
01/16/08 00:26
01/16/08 00:26
|
Joined: Sep 2003
Posts: 281 Arkansas\USA
raiden
Member
|
Member
Joined: Sep 2003
Posts: 281
Arkansas\USA
|
Not sure if you saw this one I did awhile back, but the Customize Menu makes it pretty easy to set items up. Attach Items -raiden
"It doesn't matter if we win or lose, it's how we make the game."-------------------- Links: 3DGS for Dummies
|
|
|
Re: attach weapon to player
[Re: kasimir]
#178047
01/16/08 05:37
01/16/08 05:37
|
Joined: Sep 2003
Posts: 281 Arkansas\USA
raiden
Member
|
Member
Joined: Sep 2003
Posts: 281
Arkansas\USA
|
I don't see why you need 3 vertex's to change the angles, you would want to align the weapon origin to a single vertex position of the entity(like a vertex in it's right hand) and also update the weapons angles according to the entity's angles. All that's left to do is add some offsets to make it look correct if you are in 3rd person view.
If you look at the Custom Panel in the post, you will see I have offsets for x,y,z and pan, tilt, roll. You can adjust these offsets to "fine tune" the position and angle to the vertex.
I may be totally missing what your asking for, but check out the demo and see if that works for you.
-raiden
"It doesn't matter if we win or lose, it's how we make the game."-------------------- Links: 3DGS for Dummies
|
|
|
|