I have been lua coding for some while now, and I feel that I am starting to get good at it. However, I have recently encountered a problem that I can't seem to figure out: How do I make a scripted entity that spawns as a working ragdoll with working physics bones?Being it's own scripted entity, it's in its own class and isn't in the class "prop_ragdoll", but I want it to have working bones like a "ragdoll". For example, what if I wanted to make an unwelder gman ragdoll? The collision detection and constraint removal I know perfectly, but how would you get it to spawn as an actual working ragdoll? I have tried every bone verification, validation, and setup function on the wiki, both client and server, and nothing works! I only ever get an untouchable t-pose stuck to a grab point. I'm not asking for an entire code, just an example of how to setup an entity's bones. Any help will be greatly appreciated! Thanks!
I don't really think this is possible... however you may be able to simulate a ragdoll by using either a metamethod to inherit properties from prop_ragdoll using game.GetEntities or w/e the function is to get the table of all server entities. Or you may be able to, when creating your entity, set ENT = game.GetEntities( )[ 'prop_ragdoll' ].
I havn't tested this and have no idea what results it will give, but you might want to look into it as it may work.
change your base entity to prop_ragdoll.
you might as well just, you know, create a ragdoll when the entity is created, parent your entity, and hook you stuff to the ragdoll entity you now have.
Thanks for the help! Both of the responses may have actually provided me with a solution! :) I would still just like to know how the game sets up the bones for ragdolls..
Sorry, you need to Log In to post a reply to this thread.