Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Attaching 2 entities for animation #261629
04/19/09 00:15
04/19/09 00:15
Joined: Apr 2009
Posts: 2
S
skullzman Offline OP
Guest
skullzman  Offline OP
Guest
S

Joined: Apr 2009
Posts: 2
okay im still new to gamestudio and trying to make a simple side scrolling platform game (locking y axis), now im using the cbabe model for my test and was wondering if there was any way to say attach a weapon to her hand that will update position / angle during ent_animate?

Any help/concepts appricated fully?

Re: Attaching 2 entities for animation [Re: skullzman] #261631
04/19/09 00:36
04/19/09 00:36
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_vertex is the function you need, I think there is an example in the manual.

EDIT:

Sorry, the example in the manual doesn't fit with your needs.

You need the numbers of two vertices of the hand of cbabe, you can get them when you open cbabe.mdl in MED, switch to vertex mode, and when you select a single vertex, you can see its number at the right at the bottom of the window.

For the sword or gun or torch or whatever you should use its origin to place it to the palm of the hand.

With in the while loop of the action of cbabe you have write something like the following:

vec_for_vertex(temp, my, 98);//Let's say, 98 is the vertex in the palm of the hand

Now temp got the vector of the vertex, where you can place it.

Maybe, you should look into the kh_movement script, it must be available on the Free Resources site - link at this side, upper right frame.

Last edited by Pappenheimer; 04/19/09 00:53.
Re: Attaching 2 entities for animation [Re: Pappenheimer] #261633
04/19/09 01:08
04/19/09 01:08
Joined: Jun 2008
Posts: 428
Rasch Offline
Senior Member
Rasch  Offline
Senior Member

Joined: Jun 2008
Posts: 428
Thereīs a good solution. Create a bone in MED that has the same position and angle like your weapons should have. Aniamte the bone every frame with our character. Give your bone or bones a name.

Later you can use this script (itīs from glorius battle)

Code:
my.scale_x = you.scale_x;
my.scale_y = you.scale_y;
my.scale_z = you.scale_z;
my.passable = on;
	
while(1)
{
	vec_for_vertex(my.x,you,225); // 225 is the vertex in your hand or wherever you want it (change it!)
	ang_for_bone(my.pan,you,"sword"); ("sword" is the bone name. Change to your name!)
		
	wait(1);
}


Re: Attaching 2 entities for animation [Re: skullzman] #261638
04/19/09 04:10
04/19/09 04:10
Joined: Apr 2009
Posts: 2
S
skullzman Offline OP
Guest
skullzman  Offline OP
Guest
S

Joined: Apr 2009
Posts: 2
Thanks alot both of you very helpfull and quick response's smile more then enough to work with smile


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