Noobish question

Post topics regarding Level Building/Design and Entity Usage with Reality Factory
Post Reply
Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Noobish question

Post 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?
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Noobish question

Post by metal_head »

I think the weapon must have the same skeleton as the pawn.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: Noobish question

Post 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.
Pain is only psychological.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Noobish question

Post 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!
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: Noobish question

Post 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.
Pain is only psychological.
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Noobish question

Post 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...
Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Re: Noobish question

Post 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?
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: Noobish question

Post by metal_head »

if the weapon has the same skeleton as the [awn,it will execute the same animation as the pawn does.
Danimita92
Posts: 335
Joined: Sat Feb 09, 2008 5:47 pm
Location: Lanzarote/Canary Islands/Spain

Re: Noobish question

Post by Danimita92 »

Awesome :twisted:
Post Reply