Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (Ayumi, NewbieZorro, TipmyPip), 13,888 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Connecting 2 models #270822
06/10/09 07:39
06/10/09 07:39
Joined: May 2009
Posts: 37
S
shiznitIII Offline OP
Newbie
shiznitIII  Offline OP
Newbie
S

Joined: May 2009
Posts: 37
Is it possible to connect two models in litec? for example I have a model of a female body and another model of a male head. can i connect them in the script?

Re: Connecting 2 models [Re: shiznitIII] #270849
06/10/09 10:11
06/10/09 10:11
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Sure, with an action that moves and rotates the head together with the body.

Re: Connecting 2 models [Re: Tobias] #270888
06/10/09 11:54
06/10/09 11:54
Joined: May 2009
Posts: 37
S
shiznitIII Offline OP
Newbie
shiznitIII  Offline OP
Newbie
S

Joined: May 2009
Posts: 37
What function would i use to do that in lite c?

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 Offline
Serious User
croman  Offline
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 Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Code:
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.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Connecting 2 models [Re: Espér] #270924
06/10/09 15:14
06/10/09 15:14
Joined: May 2009
Posts: 37
S
shiznitIII Offline OP
Newbie
shiznitIII  Offline OP
Newbie
S

Joined: May 2009
Posts: 37
how does this work. I have two models in med head.mdl and body.mdl then i will create them both in the script and with the function i can connect them? sorry i'm a quite confuse.

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 Offline
Serious User
croman  Offline
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: croman] #270948
06/10/09 17:48
06/10/09 17:48
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Or simply use vec_for_vertex to connect 2 models.

Re: Connecting 2 models [Re: Espér] #271079
06/11/09 06:35
06/11/09 06:35
Joined: May 2009
Posts: 37
S
shiznitIII Offline OP
Newbie
shiznitIII  Offline OP
Newbie
S

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);
}
}

Re: Connecting 2 models [Re: shiznitIII] #271081
06/11/09 07:12
06/11/09 07:12
Joined: May 2009
Posts: 37
S
shiznitIII Offline OP
Newbie
shiznitIII  Offline OP
Newbie
S

Joined: May 2009
Posts: 37
I'm not sure if it makes sense. I'm creating the body entity first (frog_run.mdl) then I create the head entity(head.mdl). then I'm suppose to get the position of the body where I will place the head? the my pointer is use by which entity in the script?

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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