• Around The HomeToggle Menu

    • Entertainment
    • Productivity
    • Smart Home
  • FamilyToggle Menu

    • Parenting
    • Toys
    • Pets
    • Travel
  • Product ReviewsToggle Menu

    • Phones
    • Tablets
    • Laptops
    • Desktops
    • Wearables
    • Audio
    • Cameras
    • Headphones
    • Printers
    • Smart Home
    • TVs
    • Gaming and Video
  • One Cool ThingToggle Menu

    • Frugal Tech
    • Kickstarters
    • Videos
Techwalla
  1. Home
  2. Around The Home
  3. Productivity
  4. How to Create an NPC Out of a Ragdoll in "GMOD"

How to Create an NPC Out of a Ragdoll in "GMOD"

March 31, 2015
By: Matt Scheer
  • Share
  • Share on Facebook

"Garry's MOD," also known as "GMOD," is a 3D modeling environment. It lets creators build interactive worlds with scripts and pre-made models. A ragdoll refers to a 3D model that can be manually posed. Normally, non-player characters (NPCs) are not made from ragdolls. This is because NPCs need animations to visually represent their scripted behaviors. Unless you are familiar with creating 3D animations, you should not attempt to make an NPC from a ragdoll, but instead customize GMOD's built-in NPCs.

Video of the Day

Step

Create the animations with your ragdoll that you need for your NPC. For example, if your NPC can walk, you need to create an animation that shows your ragdoll walking. Download the decompiler listed in the Resources Section. Decompile the ragdoll you wish to use by opening it in the decompiler. Create a folder for the decompiled ragdoll files. Open the decompiled ragdoll in an animation program, such as Blender, record the animation and save it. Save the file as a ".smd" file. Insert this file into the decompiled file folder you made earlier. Open the ".qc" file in the decompiled folder. Add this line of code to the file:

" $includemodel "nameofyourfile.smd"

Use a compiling software application, such as StudioMDL, to recompile the model into a new folder.

Step

Open a text editor.

Step

Type:

local NPC = { Name = "Your NPC's name", Class = "npc_entertheclass",

Choose a name for your NPC to replace "Your NPC's name." Now change "entertheclass" to the type of NPC class you wish your ragdoll to be, such as "citizen," which is an NPC that follows you, or ""vartigaunt," which is an enemy NPC.

Step

Go to the next line and type:

Model = "models/modelname.mdl"

Enter the name of the .mdl file you made in Step 1.

Step

Type "," after the name of the .mdl file. After the comma, type: "Health =" and choose a number for the health of the NPC.

Type: KeyValues = { citizentype = 4 },

GMOD comes with four citizen types: citizen, downtrodden, rebel and medic, numbered in that order. Each corresponds to different citizen behaviors. If you didn't choose a citizen for your NPC type, skip this line of code.

Step

Type:

Category = Category } list.Set( "NPC", "npc_nameofNPC", NPC )

Change "nameofNPC" to the name of your NPC. This sets the NPC in the list of NPC's in the game.

Step

Save the file with the name of your NPC and the file extension ".lua." Save the file to the file directory "garrysmod\autorun." Your NPC has now been made from a ragdoll.

Show Comments

Related Articles

Smart Health: 10 Smart Sensors to Improve Your Workout

Smart Health: 10 Smart Sensors to Improve Your Workout

Around The Home
Productivity
By: David Isaac
Examples of Graphics Software

Examples of Graphics Software

Around The Home
Productivity
By: David Wayne
12 of the Hottest Games for Your Phone for 2016

12 of the Hottest Games for Your Phone for 2016

Around The Home
Entertainment
By: David Isaac
Blender Vs. Rhino

Blender Vs. Rhino

Around The Home
Productivity
By: Shea Laverty
18 Times It Just Didn’t Pay to Be An Early Adopter

18 Times It Just Didn’t Pay to Be An Early Adopter

Around The Home
Entertainment
By: Beth Bartlett
Bad Ideas We Saw at CES (and Our Marketing Slogans to Prove It)

Bad Ideas We Saw at CES (and Our Marketing Slogans to Prove It)

Around The Home
Productivity
By: David Isaac
  • HOW WE SCORE
  • ABOUT US
  • CONTACT US
  • TERMS
  • PRIVACY POLICY
  • COPYRIGHT POLICY
  • Advertise

An error occurred. Try again later.

Thanks for signing up!
© 2018 Leaf Group Ltd. Leaf Group Media

Get great tech advice delivered to your inbox.

Keep your family productive, connected, entertained, and safe.

Please enter a valid email.