|
How do I offset something reletive to an entitys..
#201184
04/07/08 12:50
04/07/08 12:50
|
Joined: Nov 2006
Posts: 193 England
RyuShinji
OP
Member
|
OP
Member
Joined: Nov 2006
Posts: 193
England
|
How do I offset something reletive to an entitys pan?
I want to put a sword on my players back for example, but the origin is on the handle of the sword, how can i move it right a bit in other words, how can i change its y pos relitive to the players y depending on the players pan..?
I want to offset the sword to the right by say 10, here is my current code: vec_for_vertex(my.X,you,134); // get position of weapon vec_set(my.pan,you.pan); // set pan to owner's pan my.pan -= 90; // adjust weapon so player can see it better my.tilt += 45; // adjust weapon so player can see it better
Last edited by RyuShinji; 04/07/08 14:44.
|
|
|
Re: How do I offset something reletive to an entitys..
[Re: RyuShinji]
#201230
04/07/08 17:22
04/07/08 17:22
|
Malice
Unregistered
|
Malice
Unregistered
|
vec_set(temp,vector(0,5,0) vec_for_vertex(my,temp2,134); vec_add(temp,temp2); vec_add(temp,player.x); vec_set(my.pan,you,pan);
Does this work???
Last edited by Malice; 04/07/08 17:22.
|
|
|
Re: How do I offset something reletive to an entitys..
[Re: ]
#201243
04/07/08 19:02
04/07/08 19:02
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
If you want to attach the sword to a certain vertex this instruction should do the job: vec_for_vertex(sword.x,player,1234); vec_set(sword.pan,player.pan);
If you have a certain offset (stored in the sword's skills) you could use this approach: vec_set(temp.x,sword.offset_x); vec_rotate(temp.x,player.pan); vec_add(temp.x,player.x); vec_set(sword.x,temp.x); vec_set(sword.pan,player.pan);
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|