|
Re: Connecting 2 models
[Re: shiznitIII]
#270896
06/10/09 12:21
06/10/09 12:21
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
ent_create("attachmodel.mdl", attachVector, attachMe);
void attachMe() { while(1) { vec_set(my.x, player.x or some vector to attach your model to it); wait(1); }
use something like this
Ubi bene, ibi Patria.
|
|
|
Re: Connecting 2 models
[Re: croman]
#270907
06/10/09 12:50
06/10/09 12:50
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
VECTOR* temp = nullvector;
VECTOR* temp_angle = nullvector;
ENTITY* bodymodel;
action body()
{
bodymodel = my;
}
action head()
{
// VECTOR* is the position vector
// ENTITY is the body-model
// STRING is the name of the bone, you set on his neck
while(1)
{
if(bodymodel != NULL)
{
vec_for_bone(temp, bodymodel, "head_connector");
ang_for_bone(temp_angle, bodymodel, "head_connector");
vec_set(my.x,temp);
vec_set(my.pan,temp_angle);
}
wait(1);
}
}
just a basic if you use bones..
Last edited by Espér; 06/10/09 13:02.
|
|
|
Re: Connecting 2 models
[Re: shiznitIII]
#270945
06/10/09 17:45
06/10/09 17:45
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
yes, exactly. you create both of those models with code and updates the head position with vec_set in a while loop
Ubi bene, ibi Patria.
|
|
|
Re: Connecting 2 models
[Re: Espér]
#271079
06/11/09 06:35
06/11/09 06:35
|
Joined: May 2009
Posts: 37
shiznitIII
OP
Newbie
|
OP
Newbie
Joined: May 2009
Posts: 37
|
hi please check my script:
function main() { video_mode = 7; level_load (""); wait(2); ent_create("frog_run.mdl", vector(200, 50, -50), frog_run); ent_create("head.mdl", vector(100, -25,-100), head); mouse_map = crosshair_pcx; mouse_mode = 2; bodymodel = my; while (1) { vec_set(mouse_pos, mouse_cursor); if(bodymodel != NULL) { vec_for_bone(temp, bodymodel, "head"); ang_for_bone(temp_angle, bodymodel, "head"); vec_set(my.x,temp); vec_set(my.pan,temp_angle); } wait (1); } }
|
|
|
|