Garry's Mod

Garry's Mod

DrGBase | Nextbot Base
How works the "GrabRagdoll()" function?
Basically I want to make my NPCs can pick-up corpses and later drop them and I'm testing the function for that, the arguments it needs are (ragdoll, bone, attachment)

If I'm correct "ragdoll" is the one we want to pick up, "bone" the bone of the ragdoll from where is going to get dragged and "attachment" to which bone of the NPC you want to attach it.

The problem I have is this, for some reason the ragdoll levitates in a point near the NPC but far away from being next to it.

https://i.imgur.com/jTLNqXw.jpg

Here is my code, as you can see, I'm testing with both the same model (the ragdoll and the NPC), the ragdoll is hanging with its left foot, so the first argument of the function is working, but for some reason it doesn't matters how many times I change the bone for the "attachment" argument, everytime is going to float in that point relative to the NPC position.

https://i.imgur.com/XHsieSN.png

So, my question is, I'm doing something wrong? I'm misunderstanding how this function or their arguments work?

--------------------------------------------------------------------

In case someone is interested this are the model bones:

0 ValveBiped.Bip01
1 ValveBiped.Bip01_Pelvis
2 ValveBiped.Bip01_L_Thigh
3 ValveBiped.Bip01_L_Calf
4 ValveBiped.Bip01_L_Foot
5 ValveBiped.Bip01_R_Thigh
6 ValveBiped.Bip01_R_Calf
7 ValveBiped.Bip01_R_Foot
8 ValveBiped.Bip01_Spine
9 ValveBiped.Bip01_Spine1
10 ValveBiped.Bip01_Spine2
11 ValveBiped.Bip01_Spine4
12 ValveBiped.Bip01_L_Clavicle
13 ValveBiped.Bip01_L_UpperArm
14 ValveBiped.Bip01_L_Forearm
15 ValveBiped.Bip01_L_Hand
16 ValveBiped.Bip01_L_Finger2
17 ValveBiped.Bip01_R_Clavicle
18 ValveBiped.Bip01_R_UpperArm
19 ValveBiped.Bip01_R_Forearm
20 ValveBiped.Bip01_R_Hand
21 ValveBiped.Bip01_R_Finger2
22 ValveBiped.HC_BodyCube
23 Tail1
Last edited by Caracol Sensual; 23 Jun, 2021 @ 12:08pm
< >
Showing 1-3 of 3 comments
Dragoteryx  [developer] 23 Jun, 2021 @ 1:28pm 
I'm guessing you forgot to use $attachment in the .qc file of your model.

https://developer.valvesoftware.com/wiki/$attachment
The attachment argument needs to be the name of the attachment, not the name of the bone.
Caracol Sensual 23 Jun, 2021 @ 1:53pm 
Originally posted by Dragoteryx:
I'm guessing you forgot to use $attachment in the .qc file of your model.

https://developer.valvesoftware.com/wiki/$attachment
The attachment argument needs to be the name of the attachment, not the name of the bone.

Those models are from the workshop so I'm not the one who made the qc. If there is no $attachment the function wont work?
Dragoteryx  [developer] 23 Jun, 2021 @ 9:10pm 
Yeah you need attachments.
But decompiling a model isn't very hard, if you have permission from the model's creator of course.

- decompile the model using Crowbar
- edit the .qc file to add attachments
- recompile the model using Crowbar
< >
Showing 1-3 of 3 comments
Per page: 1530 50