2 registered members (Akow, 1 invisible),
1,423
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
how do i attach my sword to my character?
#317330
03/30/10 16:06
03/30/10 16:06
|
Joined: Nov 2008
Posts: 196 the wrong place
Muhsin
OP
Member
|
OP
Member
Joined: Nov 2008
Posts: 196
the wrong place
|
Hi!
I have been trying to attach my sword model to my character, but I couldn't make it work. how can I attach my sword to my character, without making them stop each other, and when my character animates(like running or attacking), then I want my sword to stay in the hand of the character and follow the hand. how do i do this? my character doesn't use bones for animation.
thanks!!
- Muhsin Kaymak
Come and play my new browsergame - Valley Of Wolves: http://www.mafiacreator.com/ValleyOfWolvesHurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it! And be the most feared MafiaBoss in the World!!
|
|
|
Re: how do i attach my sword to my character?
[Re: Muhsin]
#317335
03/30/10 16:23
03/30/10 16:23
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
how can I attach my sword to my character, without making them stop each other Make the sword either passable or set my.group = 123; // or another number in your sword and player code. Your player movement code must use IGNORE_PUSH then to make it work in all c_trace and c_move instructions. and when my character animates(like running or attacking), then I want my sword to stay in the hand of the character and follow the hand. how do i do this? You have 2 options: (1) You animate the sword exactly like your player is animated and you update your swords frames: sword.frame = player.frame (and next_frame maybe, too). (2) Code it: VECTOR temp,temp2; proc_mode = PROC_LATE; while(1) { vec_for_vertex(my.x,player,123); // attach the weapon to player's vertex 123 vec_for_vertex(temp,player,456); // choose 2 vertices of the player's hand that determine the weapon's rotation vec_for_vertex(temp2,player,789); vec_diff(temp,temp2,temp); vec_to_angle(my.pan,temp); // wait(1); } This should work, at least you get the idea!
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: how do i attach my sword to my character?
[Re: Superku]
#317338
03/30/10 16:45
03/30/10 16:45
|
Joined: Nov 2008
Posts: 196 the wrong place
Muhsin
OP
Member
|
OP
Member
Joined: Nov 2008
Posts: 196
the wrong place
|
Thanks for the help!!
I used the code, it works, but it's behaving a little odd, but I'm sure it can be fixed with little adjustment.
Thank you, again!
- Muhsin Kaymak
Come and play my new browsergame - Valley Of Wolves: http://www.mafiacreator.com/ValleyOfWolvesHurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it! And be the most feared MafiaBoss in the World!!
|
|
|
Re: how do i attach my sword to my character?
[Re: Muhsin]
#317341
03/30/10 17:19
03/30/10 17:19
|
Joined: Nov 2008
Posts: 196 the wrong place
Muhsin
OP
Member
|
OP
Member
Joined: Nov 2008
Posts: 196
the wrong place
|
what do i do, if the sword is facing the wrong direction?
Come and play my new browsergame - Valley Of Wolves: http://www.mafiacreator.com/ValleyOfWolvesHurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it! And be the most feared MafiaBoss in the World!!
|
|
|
Re: how do i attach my sword to my character?
[Re: Muhsin]
#317347
03/30/10 19:15
03/30/10 19:15
|
Joined: Nov 2008
Posts: 196 the wrong place
Muhsin
OP
Member
|
OP
Member
Joined: Nov 2008
Posts: 196
the wrong place
|
can somebody help, I use this script for my sword:
-------------------------------------------------------------------------------- function sword_equiped() { VECTOR temp,temp2; proc_mode = PROC_LATE; my = me; my.group = 123; while(1) { vec_for_vertex(my.x,player,27);
vec_for_vertex(temp,player,24); vec_for_vertex(temp2,player,26); vec_diff(temp,temp2,temp); vec_to_angle(my.pan,temp); wait(1); } } -------------------------------------------------------------------------------- when my character animates, my sword behaves odd. what can I do to make the sword follow the hand without behaving odd?
thanks!!!
- Muhsin Kaymak
Come and play my new browsergame - Valley Of Wolves: http://www.mafiacreator.com/ValleyOfWolvesHurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it! And be the most feared MafiaBoss in the World!!
|
|
|
Re: how do i attach my sword to my character?
[Re: Superku]
#317354
03/30/10 20:12
03/30/10 20:12
|
Joined: Nov 2008
Posts: 196 the wrong place
Muhsin
OP
Member
|
OP
Member
Joined: Nov 2008
Posts: 196
the wrong place
|
OK, i made it face the right direction, but it doesn't follow the hands movement. can you please download it and see if you can see what wrong? here is the link: http://dl.dropbox.com/u/5394772/test.rarthanks - Muhsin Kaymak
Come and play my new browsergame - Valley Of Wolves: http://www.mafiacreator.com/ValleyOfWolvesHurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it! And be the most feared MafiaBoss in the World!!
|
|
|
Re: how do i attach my sword to my character?
[Re: Widi]
#317390
03/31/10 09:22
03/31/10 09:22
|
Joined: Nov 2008
Posts: 196 the wrong place
Muhsin
OP
Member
|
OP
Member
Joined: Nov 2008
Posts: 196
the wrong place
|
yea, I am using the vertices number from the player hand, but it doesn't work right. can't you try to download it. the models and scripts is included. please?
thanks!
Come and play my new browsergame - Valley Of Wolves: http://www.mafiacreator.com/ValleyOfWolvesHurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it! And be the most feared MafiaBoss in the World!!
|
|
|
Re: how do i attach my sword to my character?
[Re: Muhsin]
#317404
03/31/10 13:23
03/31/10 13:23
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
rotate the sword so that the blade of is pointing to +x direction.(kilicin ucu +x yonune bakacak sekilde dondur.)
and then use this vertex numbers:
vec_for_vertex(my.x,player,30);
vec_for_vertex(temp,player,30); vec_for_vertex(temp2,player,33);
3333333333
|
|
|
|