Page 1 of 1

Noobish question

Posted: Thu Jul 31, 2008 5:23 pm
by Danimita92
Hi everybody. I'm trying to script a weapon system for a friend's project but first I need to figure out how they work.
You see, I downloaded and played the Nirhis demo (really cool, Juutis) and viewing the enemies' actors, I realized they don't have the weapons on them. So I tried to figure out how to change and set their weapons. I didn't find it in the manual, and in the scripts I only found SetWeapon(theweapon); But I can't figure out how to set the bone where to attach that weapon.
Please could you explain it to me?

Re: Noobish question

Posted: Thu Jul 31, 2008 6:37 pm
by metal_head
I think the weapon must have the same skeleton as the pawn.

Re: Noobish question

Posted: Thu Jul 31, 2008 7:14 pm
by Juutis
Yeah, both must have the same skeleton. You must assign the weapon's vertices to the skeleton (probably the hand bone) in the modeling software and then export it to RF. So basically you assign the weapon to a bone when modeling the weapon, not when it's already in RF.

Re: Noobish question

Posted: Thu Jul 31, 2008 7:42 pm
by metal_head
and than in the script make a variable with the weapon for example
WEAPON [pisol] (make sure that "pistol" pawn.ini)

and than SetWeapon(WEAPON);

Is that right,Juutis? You know I'm a beginner :D

EDIT: of course if that seems hard to you,you can always attatch the weapon's 3D model to the pawn's 3D model easily in Milkshape!

Re: Noobish question

Posted: Thu Jul 31, 2008 7:49 pm
by Juutis
metal_head wrote:and than in the script make a variable with the weapon for example
WEAPON [pisol] (make sure that "pistol" pawn.ini)

and than SetWeapon(WEAPON);

Is that right,Juutis? You know I'm a beginner :D
Yap, that's right. You could also write directly 'SetWeapon("pistol");' but using a variable is definitely better. It's much easier to do changes then, and overall it's much cleaner.

Re: Noobish question

Posted: Thu Jul 31, 2008 7:55 pm
by metal_head
yeah,that's why I make my pawn's weapons with variables.
BTW I don't remember..it was a lot time ago,but once I didn't use a variable for something (I don't remeber what) and the script gave an error,than when I used a variable,there were no problems...

Re: Noobish question

Posted: Sun Aug 03, 2008 5:48 pm
by Danimita92
Ok, one question regarding this. If I wanted to use this, would I be able to make the assigned weapon do different animations? Say like I tell the pawn it's attached to, to do the Walk animation. Would the weapon play it's own Walk animation?

Re: Noobish question

Posted: Sun Aug 03, 2008 8:39 pm
by metal_head
if the weapon has the same skeleton as the [awn,it will execute the same animation as the pawn does.

Re: Noobish question

Posted: Mon Aug 04, 2008 12:22 pm
by Danimita92
Awesome :twisted: