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

Author Topic: Mappadd "model" field doesnt work with npc_um_citizen  (Read 320 times)

0 Members and 1 Guest are viewing this topic.

Offline Dazza-chan

  • *
  • +1% chance to make useful post
  • Dazza-chan has no influence.
Mappadd "model" field doesnt work with npc_um_citizen
« on: May 05, 2018, 12:21:09 PM »
Has anyone experienced an issue with using the model keyfield for npc_um_citizen? Whenever i try to use it it's always completely ignored in favour of  the "um_citizen_model" convar. For example:

Code: [Select]
"npc_um_citizen"
{
"origin" "-815 2315 24"
"keyvalues"
{
                        "model" "models/mossman.mdl"
}
}

In this the "model" field is ignored and the npc uses the normal um citizen model. this is an issue for me however as my mod relies heavily on npc_um_citizen npcs.

Offline Onemanshow

  • JuanMan
  • *
  • *
  • +67% chance to make useful post
  • Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!Onemanshow is awe-inspiring!
Re: Mappadd "model" field doesnt work with npc_um_citizen
« Reply #1 on: May 06, 2018, 07:32:57 PM »
Sadly I'm almost certain that um_citizen doesn't support the "model" keyvalue. I'm guessing it either was removed for that NPC or that the convar takes priority over mapadd.

The next best solution I could think of is using the npc_replace_model script to override that NPC. If you need to use a different model for that NPC on a specific map you can set it up like this example:

Code: [Select]
NPCModelReplaceData
{
"default_map" {
"default_npc" {
// "models/alyx.mdl" "10"
// "models/barney.mdl" "10"
}
}

"d1_trainstation_01" {
"npc_um_citizen" {
"models/mossman.mdl" "100"
}
}
}

But if that doesn't work the convar probably overrides npc_replace_model as well, and in that case there's no good solution other than changing the convar on map load. :-\

Offline Dazza-chan

  • *
  • +1% chance to make useful post
  • Dazza-chan has no influence.
Re: Mappadd "model" field doesnt work with npc_um_citizen
« Reply #2 on: May 09, 2018, 09:15:09 AM »
Luckily the replace model system works, but the problem is i need multiple different um citizens with specific models for certain maps. I can just use a lua function to get around that. It replaces the model after spawn. but i was just wondering if i could get the model keyfield working because it would be easier.

Code: [Select]
function ModelChange()

local ent = HL2.FindEntityByName(nil, "yournpcname")
if ( ent ~= nil ) then
HL2.SetModel(ent, "models/whateverfuckingmodel.mdl")
end
end