Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Akow, 1 invisible), 1,423 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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 Offline OP
Member
Muhsin  Offline 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/ValleyOfWolves

Hurry 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 Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
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.

Quote:
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 Offline OP
Member
Muhsin  Offline 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/ValleyOfWolves

Hurry 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 Offline OP
Member
Muhsin  Offline 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/ValleyOfWolves

Hurry 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 Offline OP
Member
Muhsin  Offline 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/ValleyOfWolves

Hurry 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] #317348
03/30/10 19:37
03/30/10 19:37
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You must describe what you mean by saying "the sword is behaving odd".
If it is facing the wrong direction, why don't you change the two vertices 24 <-> 26 in your script?


"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] #317354
03/30/10 20:12
03/30/10 20:12
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline OP
Member
Muhsin  Offline 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.rar

thanks

- Muhsin Kaymak


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry 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] #317376
03/31/10 02:52
03/31/10 02:52
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Are you sure you have the right Vertices at vec_for_vertex? You have to use "yours" Vertices from the Models Hand. This Number is showing up in MED, select the Vertex of the Hand and you see the Number at the right bottom.

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 Offline OP
Member
Muhsin  Offline 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/ValleyOfWolves

Hurry 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 Offline
Senior Expert
Quad  Offline
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
Page 1 of 2 1 2

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