Getting root bone of unit?

Everything about mods can be found here.

Moderator: Morax

Getting root bone of unit?

Postby D4rkstalker » 16 Apr 2019, 07:11

Is there a way to get the root bone of a unit?

i.e for ahwassa (xsa0402):
Code: Select all
self:getrootBone()
// returns XSA0402


I'm currently using
Code: Select all
bp.BlueprintId
which causes issues when the bone does not match the blueprint id.
D4rkstalker
Crusader
 
Posts: 11
Joined: 01 Sep 2018, 16:37
Has liked: 0 time
Been liked: 0 time
FAF User Name: D4rkstalker

Re: Getting root bone of unit?

Postby Franck83 » 16 Apr 2019, 11:00

Hi D4rkstalker,

It depends on what you want to do. I'm not sure that the unit id always matches the root bone name.
If you want to check the bone names on a specific unit, launch a game on cheat mode. you can show it with the console commands: ren_ShowSkeletons & ren_ShowBoneNames
if you want to apply an fx like CreateAttachedEmitter(self, bone or 0, self:GetArmy()), you can refer to 0 that will point to the root bone.
Unless you got a GetBoneName method on entity objects.

Hope this will help.
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83

Re: Getting root bone of unit?

Postby Franck83 » 16 Apr 2019, 11:07

You can try this method to give you the root bone name : self:GetBoneName(0)
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83

Re: Getting root bone of unit?

Postby D4rkstalker » 17 Apr 2019, 07:18

That worked nicely, thanks!
D4rkstalker
Crusader
 
Posts: 11
Joined: 01 Sep 2018, 16:37
Has liked: 0 time
Been liked: 0 time
FAF User Name: D4rkstalker


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest