Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Multiple Models for one NPC  (Read 1177 times)

0 Members and 1 Guest are viewing this topic.

Offline The Carrousel

  • *
  • *
  • +1% chance to make useful post
  • The Carrousel has no influence.
Multiple Models for one NPC
« on: September 05, 2013, 06:20:21 AM »
Title says all. All I want to know is if it's possible to have one NPC (for example npc_combine_s) use multiple models. Because I saw this in Underhell and it grabbed my attention.

Offline Troggy Hordesman

  • *
  • +3% chance to make useful post
  • Troggy Hordesman has no influence.
Re: Multiple Models for one NPC
« Reply #1 on: September 05, 2013, 06:47:11 AM »

Here is an example of a script I am using:

   "d1_canals_03" {
      "npc_metropolice" {
         "models/civil_medic.mdl"      "5"
         "models/hl2concept.mdl"      "30"
         "models/police.mdl"      "45"
         "models/hdpolice.mdl"      "20"

      "npc_combine_s" {
         "models/elite_police.mdl"      "100"

As you can see, there is a 45% the metrocop spawns with the regular model, but only a 5% to spawn as a medic. It's only cosmetic, of course. The soldier on other hand has a 100% chance to spawn with the elite metrocop model.

If you are like me and use more models than is good for you (like having region-based regiments) it is adviced that you add the models to the precache in the mapadd to prevent crashes, or you will have to save the game and quit every time you encounter a map transition.

There is also the similar functioning npc_weapon_randomize which can allow you to have random weapon lists on enemies, which can create some interesting twists on maps and may give the game a Borderland-esque quality with "rare loot".
« Last Edit: September 05, 2013, 06:55:05 AM by Troggy Hordesman »
My behind is behind me, always watching.