Game Development Community

Bladed weapon - problems in 1st person/when on the ground

by Gleznov · in Artist Corner · 08/03/2005 (5:40 am) · 6 replies

Hi,

I just created a sword for my character. I twisted it in milkshape until it came out looking right when my character picks it up. The problem with that is:

1) When the weapon is on the ground before being picked up, it looks wrong (twisted in a funny direction)
2) When I switch to first person after picking the weapon up, the blade is being held strangely sideways. My character isn't holding it sideways in 3rd person, why in 1st?

So my questions are:

1) To fix this, I should just play with a transform when I place the object, right?
2) How do I fix this? Is there some kind of transform for 1st person perspective?

Also, I'd be forever grateful if anyone can tell me how to trigger a swing-the-sword motion I sequenced as [seq:swipe=10-30,fps=40] in code when my character "shoots" his sword (or presses the fire button)?
Will the 3rd person version of that swipe translate properly to 1st person? If not, how do I define the 1st person version?

Thanks!

Glez

#1
08/03/2005 (5:51 am)
1)adjust the object's position untill you are happy with it

2) adjust either the mount0 (node on the player) or mountpoint (node on weapon)
or Use mountOffset or eyeOffset to fake it

You could have the player.playThread(0, 'swipe'); in the sword::onFire() function.

Good Luck
#2
08/03/2005 (6:14 am)
Anthony,

Thank you! mountOffset or eyeOffset must be what I'm looking for. I have a couple quick questions about your answer:

1) Using eyeOffset, will the 3rd person perspective stay the same and only the 1st person perspective will be affected?
2) in player.playThread(0,'anim'); --> what does the zero do?

Thanks again! Those were just what I was looking for!

Glez
#3
08/03/2005 (6:36 am)
1) Try it and see what happens :) You will probably find that it doesnt, but I dont know for sure.
2) It sets which thread to play the animation in.
#4
08/03/2005 (7:11 am)
For the earlier question of rotating an object around its axes on the ground, setTransform only seems to allow one angle be specified? How do I rotate individually around the X, Y and Z axes?

More importantly, is there a full torque-script reference manual anywhere? I can't find one in the torque documentation.

Glez
#5
08/03/2005 (7:50 am)
The transform is a transform matrix. You set colums bsed on what you want to change.

colum 0 = x axis
colum 1 = y axis
colum 2 = z axis
colum 3 = position

Don't quote me on this, but I am pretty sure thats the way it goes.

Call dump(); on an object to find out everything about it.
#6
08/03/2005 (9:30 am)
Well good and bad:

The good:
eyeOffset does allow me to change the position of the weapon when in first person mode.

The bad:
It causes the weapon to remain static (my character's idle animation is to breathe up and down - without eyeOffset in first person, the weapon bobs slowly up and down in rhythm - with eyeOffset it's deadly still on the screen)
It also causes the angle of the weapon to change by 90 degrees (this one I don't understand) - without eyeOffset the weapon looks the same as the way I'm holding it (although way too low) - with eyeOffset I see it as thought my wrist had turned 90 degrees with it.

Anyways around this? I feel so close!

Glez