2 registered members (AndrewAMD, dr_panther),
730
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Positioning an entity in a position relative to another entity
#288581
09/07/09 14:24
09/07/09 14:24
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
OP
Serious User
|
OP
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
Hi, what code i can do for positioning an entity in a position always relative to another entity, laso when the second entity is moving?
Last edited by painkiller; 09/07/09 14:24.
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
Re: Positioning an entity in a position relative to another enti
[Re: the_clown]
#288648
09/07/09 19:50
09/07/09 19:50
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
OP
Serious User
|
OP
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
thanks, but i don't understand very well the code, can you explain it me?
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
Re: Positioning an entity in a position relative to another enti
[Re: painkiller]
#288822
09/08/09 21:30
09/08/09 21:30
|
Joined: Jul 2009
Posts: 39 Chile!
Renard
Newbie
|
Newbie
Joined: Jul 2009
Posts: 39
Chile!
|
Look, this is the code I`m using for attaching a gun to my model.
STRING Gatlin_mdl = "Gatlin.mdl"; function Gatlin()
{ proc_mode = PROC_LATE; set(my,PASSABLE); // the Gatlin shouldn't slow down the player while (player == NULL){wait (1);}//wait ītill the player is created. while(1) { vec_for_vertex (my.skill1, you, 1446); vec_for_vertex (my.skill4, you, 1447); //vertex on the model hand vec_diff (my.skill7, my.skill4, my.skill1);// compute the vector that will be used by the Gatlin vec_to_angle (my.pan, my.skill7); // rotate the Gatlin accordingly // put the origin of the Gatlin in the vertex that is placed at the bottom of the arm vec_set (my.x, my.skill1); wait (1); } }
AND you need to add a line on the character code, to ent_create the model to attach and call the function. BUT, this is going to attach the models nicely, but it can cause some issues depending on your player`s code.
Last edited by Renard; 09/08/09 21:36.
WRYYYYYYYYYYYYYYYYYY!!!1!!ONE!!11
|
|
|
Re: Positioning an entity in a position relative to another enti
[Re: Renard]
#288898
09/09/09 10:29
09/09/09 10:29
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
OP
Serious User
|
OP
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
thanks, i haven't problem because i use the physics engine, then i put the another entity as passable and there wonīt be problems
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
|