Garry's Mod

Garry's Mod

34 ratings
[E2] Better Bones Attachments
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
Addon Tags: Build
File Size
Posted
Updated
2.046 KB
14 Feb, 2015 @ 8:27am
27 Feb, 2015 @ 2:04pm
6 Change Notes ( view )

Subscribe to download
[E2] Better Bones Attachments

Description
THIS IS AN EXTENSION FOR WIREMOD, NOT CONSOLE COMMANDS
Summary:
This lets you get the position, angles and parent entities to player bones,
These are the bones your player model uses, all I can say is that you'll be able to put holograms on any part of your body.

Usage logic:
Find/Get a bone and store it in a variable using ent:bBone(index)
With that variable you can then use the functions below.
Indexes are not defined by me and can change depending on the entity model.
Note for the variable: if you put it in @persist, its type should be 'attachment'

Functions:
att = ent:bBone(index) --Get <ent>'s bone #<index>
num = ent:bBoneCount() --Get the bone count of <ent>
att = nobBone() --Return an invalid bone.
ent = att:entity() --Return the parent entity of bone <att>
num = att:index() --Return the index of bone <att>
vec = att:pos() --Return the position of bone <att>
num = att:length() --Experimental, return the length of <att>
vec = att:forward/right/up() --Return the forward/right/up direction of <att>
array = att:getChildren() --Get <att>'s children bones.
att = att:getParent() --Get <att>'s parent.
vec = att:toWorld(pos) --Get <pos> from being local to <att> to being global
vec = att:toLocal(pos) --Get relative position of <pos> to <att>
ang = att:angles() --Get the angles of <att>
void = ent:parentBBone(att) --Parent an entity to bone <att>
str = toString(att) --ToString

Commands:
I have to check the code.
7 Comments
Thomasims  [author] 4 Jul, 2022 @ 11:24am 
At this point I doubt I will ever update my e2 addons
Node⋄ 4 Jul, 2022 @ 10:54am 
will this addon be receiving any updates? would love to use bone parenting.
Tequila Sunset 22 Mar, 2017 @ 11:04am 
That would be very great if you fix the positions and angles in this addon so I'll be able to make hologram costumes! Please do it)
Thomasims  [author] 15 Mar, 2017 @ 8:47am 
I have to fix a lot of my addons on here, I'm quite busy with college ATM but I've recently regained interest in GMod so I might rewrite this one too sometime.

PS: I was already aware of the issues this one in particular had and this is due to the fact that the functions I use give weird results on the server but good result on the client (that's how other addons attach stuff to your bones AFAIK)
HungarianPatriot 14 Mar, 2017 @ 10:18am 
The addon would fix a giantic lack of functionality in E2, however, there seem to be a problem with it that kinda ruins it. I declare an attachment type variable. I make a hologram on its position. Then I use holoEntity(n):parentBBone(att). The constraint is actually formed, and the hologram moves along with the attachment, however, its position relative to the attachment is also unpredictably shifted in the moment of the parenting, effectively ruining it.
Thomasims  [author] 15 Feb, 2015 @ 5:12am 
It's hard to get used to but once you get how it works, it's alright.
Also, the bones angles are very unpredictable so this isn't of much use yet.
Blank Shade 15 Feb, 2015 @ 4:10am 
That's what I need! Many thanks!