How to merge two objects in level in A6

Posted By: hernan

How to merge two objects in level in A6 - 09/17/06 08:12

I have met a problem when I design a game,that is two models in WED and they are designed just like one when they rotate,but one is visible and the other is not unless it's clicked.
I have used Grouping in WED but it does work,please tell me how to design this.
Posted By: hernan

Re: How to merge two objects in level in A6 - 09/17/06 13:05

just like desk and book on it,when we move,rotate the desk, the book moves with it.but the desk is visible,the book is not.
Posted By: demiGod

Re: How to merge two objects in level in A6 - 09/17/06 13:18

I really dont know what you talking about. Do you need a code to move the desk and the book together or you are asking how to turn invisible the book unless its clicked?
Posted By: hernan

Re: How to merge two objects in level in A6 - 09/17/06 13:46

Ah,my English is really bad,I need a code to move the desk and the book together just like they are one model,but not in fact.
Posted By: demiGod

Re: How to merge two objects in level in A6 - 09/17/06 14:18

First of all = wrong forum if you are searching for a fix to some code (Scripting forum);
However, you could solve your problem in several ways:

a) if you just want to show the book over the desk on mouse click, probably you just need a model with two frames, one with just the desk and the other frame with the desk and the book over it, and change the frames with mouse click;

b) if you need to aplly some physics code to the book either, you could use some kind of attach code:

Code:

entity* deskEntity;
entity* bookEntity;

action desk
{
deskEntity=my;
while(bookEntity==null){wait(1);}
while(1)
{
temp.x=my.x;
temp.y=my.y;
temp.z=my.z + 100;//play with this value
vec_for_vertex(temp,my,80);//play with the vertex number to attach book
vec_set(book.x,temp);

//insert here the code to move or rotate the desk vg. C_move, etc...
wait(1);
}
}

action book
{
bookEntity=my;
//my.invisible=on;
//etc...
}



I hope it helps.
Posted By: hernan

Re: How to merge two objects in level in A6 - 09/17/06 14:28

thanks,I think a) is the best for me,thanks,I get it.
© 2023 lite-C Forums