Gamestudio Links
Zorro Links
Newest Posts
How to buy tomorrow at open?
by frutza. 06/01/23 19:58
Adding Position to Current Trade
by AndrewAMD. 05/30/23 10:34
Unable to change multiplier of contract
by vicknick. 05/30/23 06:56
Wrong Definition of Sharpe Ratio in Zorro?
by vicknick. 05/29/23 06:32
Backtest strategy on bitcoin/crypto
by JamesHH. 05/26/23 04:36
Return type of floor()
by AndrewAMD. 05/25/23 14:17
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (AndrewAMD), 1,065 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
BInnacle, androsa, XquicksnowX, danishinvest, Trail
18942 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to connect bones of different Models? #357093
02/05/11 14:58
02/05/11 14:58
Joined: Feb 2011
Posts: 3
ChaosNe0 Offline OP
Guest
ChaosNe0  Offline OP
Guest

Joined: Feb 2011
Posts: 3
Hello up there!

I had just the idea of a game for which I have to know how ro combine bones of different Models so that it become one "unit".
I set one bone in the main-model and one in the target-model. Than I tried to write a light-c script which sets every frame the bone of the target-model to the bone of the main-model but this didn't work the way I wanted. I even don't know which commands I've to use for as I'm new in programming light-c.

Hope to get soon answers,

greetings ChaosNe0

Re: How to connect bones of different Models? [Re: ChaosNe0] #357113
02/05/11 15:53
02/05/11 15:53
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
vec_for_bone gives you the position of a bone, this should help, but I didn't try it myself:
http://www.conitec.net/beta/avec_for_bone.htm

Re: How to connect bones of different Models? [Re: Pappenheimer] #357138
02/05/11 19:34
02/05/11 19:34
Joined: Feb 2011
Posts: 3
ChaosNe0 Offline OP
Guest
ChaosNe0  Offline OP
Guest

Joined: Feb 2011
Posts: 3
Yes, I've used it in my script too.
The script for the entity which is attached is...:
function testsubjekt_orientierung()
{
ANGLE bone_angle;
VECTOR bone_vec;
VECTOR ent_vec;
while(1)
{
vec_for_bone(bone_vec,TEO,"Rezeptor");
ang_for_bone(bone_angle,TEO,parentname);
if((teo_animframe_counter>=4)&&(teo_animframe_counter<=9))
{
vec_for_bone(ent_vec,my,"TargetPoint");
my.x = -(ent_vec.x-my.x)+bone_vec.x; a = my.x;
my.y = -(ent_vec.y-my.y)+bone_vec.y; b = my.y;
my.z = -(ent_vec.z-my.z)+bone_vec.z; c = my.z;
ent_bonereset(my,"TargetPoint");
ent_bonerotate(my,"TargetPoint",bone_angle);
}
else
{
vec_for_bone(ent_vec,my,"TargetPoint1");
my.x = -(ent_vec.x-my.x)+bone_vec.x;
my.y = -(ent_vec.y-my.y)+bone_vec.y;
my.z = -(ent_vec.z-my.z)+bone_vec.z;
ent_bonereset(my,"TargetPoint1");
ent_bonerotate(my,"TargetPoint1",bone_angle);
}

wait(1);
}
}

...

You've also to know...:
var teo_animframe_counter;
ENTITY* TEO; //TestEnvironmentObject
...and that the command "ent_bonemove" ( http://www.conitec.net/beta/aent_bonemove ) didn't work in here. (Don't ask me why ;D)

The problem is: the "testsubject"-entity is avery frame set on a chosen bone but this bone is animated and in the second part of the animation the testsubject moves partly like the animated bone but not direct there where it should move. It moves a bit next to the animated bone.

Edit: I know now what the problem with the "ent_bonemove"-command was... I didn't assign the vertexes to the bone. laugh
But now I got another problem: The testsubject is always set by the false vector.

Last edited by ChaosNe0; 02/07/11 15:31.

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

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