I wanna know how to merge glasses or another props like hats etc. with bone of ragdoll and NPC.
I tried to use bone merger but if prop has no attachmets it's no use like with glasses on screenshot - they has no attachments to this ragdoll.
When I tried to use multiparent tool it merge glasses to the pelvis of this ragdoll not to the head, so I guess it's a tool for props that does not work with ragdolls in that way.
Weld is useles - prop moving around the head and it does not work with NPC's.
I even tried this method:
1. spawn NPC
2. write to console: ent_setname *stupidnamehere*
3. aim to the thing you want weld to NPC
4. write to console: ent_fire !picker setparent *thatstupidnameyouwrotetothe*stupidnameh•ere**(**)
5. done. it's welded.
But it weld prop to the pelvis...
Maybe I missed some tool that can work in that way?
[url=http://postimg.org/image/s9c1dytzp/][img]http://s2.postimg.org/s9c1dytzp/gm_flatgrass0002.jpg[/img][/url]
Your only option is to use SetParentAttachment. If it doesn't help, you are fucked.
[QUOTE=Robotboy655;44595106]Your only option is to use SetParentAttachment. If it doesn't help, you are fucked.[/QUOTE]
So here what I found using this tool. Point for glasses on a head and point on a glasses but it's unnamed. What shall I do with this?
[url=http://postimg.org/image/c0q3q4bch/][img]http://s8.postimg.org/c0q3q4bch/gm_flatgrass0002.jpg[/img][/url]
Lua code:
[code]a:SetParent( b )
a:Fire( "SetParentAttachment", "glasses" )
[/code]
a is your glasses, b is your ragdoll.
This is essentially what you gotta do.
Maybe additionally a:SetLocalAngles and a:SetLocalPos
I really should make a tool for parent attachment too, but i am just too lazy for now.
[QUOTE=Robotboy655;44651913]Lua code:
[code]a:SetParent( b )
a:Fire( "SetParentAttachment", "glasses" )
[/code]
a is your glasses, b is your ragdoll.
This is essentially what you gotta do.
Maybe additionally a:SetLocalAngles and a:SetLocalPos
I really should make a tool for parent attachment too, but i am just too lazy for now.[/QUOTE]
Like this?
models\characters\bolt-on\glasses\Dude_glass_02.mdl:SetParent( models\characters\M_Avg_Postal_Dude_v2\M_Avg_Postal_Dude_v2.mdl )
models\characters\bolt-on\glasses\Dude_glass_02.mdl:Fire( "SetParentAttachment", "glasses" )
[url=http://postimage.org/][img]http://s2.postimg.org/xfednlts5/34c6fbad32b71e750b2b5ce881941aa0.png[/img][/url]
That explains a lot...
I will try to throw together a tool for this next weekend, no promises.
[QUOTE=vlsn;44657810]Like this?
models\characters\bolt-on\glasses\Dude_glass_02.mdl:SetParent( models\characters\M_Avg_Postal_Dude_v2\M_Avg_Postal_Dude_v2.mdl )
models\characters\bolt-on\glasses\Dude_glass_02.mdl:Fire( "SetParentAttachment", "glasses" )[/QUOTE]
You need to spawn the models and do it on them. The following is not a great way of doing it but it should do the job, assuming you're on single-player or the host of a listen-server.
Spawn the ragdoll, look at it and put this in console:
lua_run modela=ply:GetEyeTraceNoCursor().Entity
Do the same for the glasses but use modelb instead, then put this in console.
lua_run modelb:SetParent(modela) modelb:Fire( "SetParentAttachment", "glasses" )
[QUOTE=MattJeanes;44659789]You need to spawn the models and do it on them. The following is not a great way of doing it but it should do the job, assuming you're on single-player or the host of a listen-server.
Spawn the ragdoll, look at it and put this in console:
lua_run modela=ply:GetEyeTraceNoCursor().Entity
Do the same for the glasses but use modelb instead, then put this in console.
lua_run modelb:SetParent(modela) modelb:Fire( "SetParentAttachment", "glasses" )[/QUOTE]
[IMG]http://i.imgur.com/pzo9CXp.png[/IMG]
Replace ply with Entity(1)
[QUOTE=Robotboy655;44661036]Replace ply with Entity(1)[/QUOTE]
Ok. The 1 and the 2 command done well but the last one does not work
[IMG]http://i.imgur.com/HCO7WKM.png[/IMG]
Oh whoops, forgot ply wasn't defined. You didn't repeat the command on the glasses, while changing the command slightly to say modelb instead of modela.
[QUOTE=MattJeanes;44661933]Oh whoops, forgot ply wasn't defined. You didn't repeat the command on the glasses, while changing the command slightly to say modelb instead of modela.[/QUOTE]
Ok. It works for the last. But it looks like this:
[IMG]http://i.imgur.com/gXIIERQ.jpg[/IMG]
How I can fix it?
You gotta use modelb:SetLocalAngles(Angle(0,0,0)) and modelb:SetLocalPos(Vector(0,0,0))
replace the 0s until you get proper result.
Great!!! It works with ragdolls and NPC/animated props. The right attachment for the glasses was "Postal_Dude_L0.Glasses" not "glasses".
Also it have a glitch with some fast animations - glasses moves away from the head, but this is unfixeable problem I guess.
Thank you guys for your help.
[IMG]http://i.imgur.com/DgRSnL4.jpg[/IMG]
Sorry, you need to Log In to post a reply to this thread.