ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
NPC spawning without weapon? or dropping them?

1 2
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  20:50:54  25 June 2012
profilee-mailreply Message URLTo the Top
Kocayine
Senior Resident
 

 
On forum: 07/15/2010
Messages: 918
NPC spawning without weapon? or dropping them?

Hey there.

So yeah, I'm playing Narodnaya Solyanka but I thought I'd just make a thread here to perhaps get more attention as this might not be a "NS-only" problem.

Thing is that I often encounter NPCs who have no guns. It's been a while, but for example in Bar area the duty guards towards the wild territory would have no AN94's. I had to sell that to them (lol). In more recent time (today) I've experienced one of the soldiers in the Agroprom attack, just running off. When I shot him I saw how he had ammo enough for an AK74 but he had no actual weapon.

At first I thought it might be something bad in the character_desc files but when I then went into the Agroprom undergrounds, one of the first bandits that attacks you just ran off instead, evidently because he had no weapon. I reloaded a save i made before i entered the underground, where i entered it again and this time, he did indeed have an AK74 ready to blast me with.

Is there someone here with great knowledge in how the AI/NPC's work, who can mayeb help me with this no-weapons issue? Would like to solve it.


Thanks in advance
  21:03:49  25 June 2012
profilee-mailreply Message URLTo the Top
olaf1
Senior Resident
 

 
On forum: 01/17/2012
 

Message edited by:
olaf1
06/25/2012 21:04:39
Messages: 240
You must add the weapon in the character_desc_level_name.xml
There are all NPC´s listed and there you can chose the weapon or add.

But i think the amk have make a new xml data is that right??
In there stand alle NPC´s for all level.
  21:05:35  25 June 2012
profilee-mailreply Message URLTo the Top
Kocayine
Senior Resident
 

 
On forum: 07/15/2010
Messages: 918

---QUOTATION---
You must add the weapon in the character_desc_level_name.xml
There are all NPC´s listed and there you can chose the weapon or add.
---END QUOTATION---

That has already been done for me. I'm not making a mod here, I'm playing one. Besides, adding weapons in those files would be a MASSIVE work and it would seem like the character_desc files are intact because why else would the bandit in the Agroprom undergrounds have a weapon 2nd time I entered?
  21:13:24  25 June 2012
profilee-mailreply Message URLTo the Top
olaf1
Senior Resident
 

 
On forum: 01/17/2012
Messages: 240
Yes that is lot of work but you don´t add by all NPC´s the weapon.

But why the bandit in the Agroprom undergrounds have a weapon 2nd time you entered that i don´t know
  21:34:43  25 June 2012
profilee-mailreply Message URLTo the Top
Kocayine
Senior Resident
 

 
On forum: 07/15/2010
Messages: 918

---QUOTATION---
Yes that is lot of work but you don´t add by all NPC´s the weapon.

But why the bandit in the Agroprom undergrounds have a weapon 2nd time you entered that i don´t know
---END QUOTATION---



Because the problem lies elsewhere.
  20:50:39  28 June 2012
profilee-mailreply Message URLTo the Top
Kocayine
Senior Resident
 

 
On forum: 07/15/2010
Messages: 918
Does nobody have a clue?
  23:17:43  28 June 2012
profilee-mailreply Message URLTo the Top
bamah
Senior Resident
 

 
On forum: 02/10/2008
 

Message edited by:
bamah
06/28/2012 23:22:34
Messages: 911
mp_ranks

Add the new weapons you've added to the mp_ranks.ltx file under section 4. This allows the NPC to use the weapon. Check the console for a bolded white error. Is it asking for a rank for the weapon?

Adding a weapon to the char_dec_XXXX files just gives him the weapon you want him to have.

EDIT:Just read ur first post. Does it use a random loadout for npcs. If you spawn them via menu that may cause an issue.
  02:07:02  29 June 2012
profilee-mailreply Message URLTo the Top
Kocayine
Senior Resident
 

 
On forum: 07/15/2010
Messages: 918

---QUOTATION---
EDIT:Just read ur first post. Does it use a random loadout for npcs. If you spawn them via menu that may cause an issue.
---END QUOTATION---



I think it's pretty random. I mean sometimes (for instance) the bandits at carpark in the beginning have lotsa Stretchkins and sometimes lots of BM16's... It varies a lot. Do you know which file controls this?
  03:30:27  29 June 2012
profilee-mailreply Message URLTo the Top
Derranged
Senior Resident
 

 
On forum: 04/12/2010
Messages: 1009

---QUOTATION---
EDIT:Just read ur first post. Does it use a random loadout for npcs. If you spawn them via menu that may cause an issue.

I think it's pretty random. I mean sometimes (for instance) the bandits at carpark in the beginning have lotsa Stretchkins and sometimes lots of BM16's... It varies a lot. Do you know which file controls this?
---END QUOTATION---



If it's like how the normal game spawns Food and Medical supplies then they have probably created a new file.

As an example of what this file may look like. If you have your games files unpacked, then look for the file: Character_drugs.xml

Right click, edit. Inside you should see:

medkit = 1, prob=0.2 \n
bandage = 1, prob=0.4 \n

"Item" = "Amount", prob="Chance of getting the item" \n

So, if you look through the mods files you should see something like this:

wpn_bm16 = 1, prob=0.5 \n

Now, you will notice inside the Character descriptions where it spawns their items, there a "Character_Drugs.xml" line of script. Too make this easier, do you see any other thing like "Characer_Weapons.xml"???
  04:14:39  29 June 2012
profilee-mailreply Message URLTo the Top
Kocayine
Senior Resident
 

 
On forum: 07/15/2010
 

Message edited by:
Kocayine
06/29/2012 4:15:25
Messages: 918

---QUOTATION---
EDIT:Just read ur first post. Does it use a random loadout for npcs. If you spawn them via menu that may cause an issue.

I think it's pretty random. I mean sometimes (for instance) the bandits at carpark in the beginning have lotsa Stretchkins and sometimes lots of BM16's... It varies a lot. Do you know which file controls this?

If it's like how the normal game spawns Food and Medical supplies then they have probably created a new file.

As an example of what this file may look like. If you have your games files unpacked, then look for the file: Character_drugs.xml

Right click, edit. Inside you should see:

medkit = 1, prob=0.2 \n
bandage = 1, prob=0.4 \n

"Item" = "Amount", prob="Chance of getting the item" \n

So, if you look through the mods files you should see something like this:

wpn_bm16 = 1, prob=0.5 \n

Now, you will notice inside the Character descriptions where it spawns their items, there a "Character_Drugs.xml" line of script. Too make this easier, do you see any other thing like "Characer_Weapons.xml"???
---END QUOTATION---



Nah I've been thru most of those files and everyone seems to have each of their own set of "supplies". And example can be:


---QUOTATION---
<supplies>
[spawn] \n
ammo_9x18_pmm = 1 \n
device_torch \n
sigaret \n
harmonica_a = 1, prob= 0.5 \n
guitar_a = 1, prob= 0.3 \n

medkit = 1, prob=0.5 \n
medkit_army = 1, prob=0.4 \n
bandage_dmx = 1, prob=0.05 \n
yadulin = 1, prob=0.01 \n
bread = 1, prob=0.3 \n
kolbasa = 1, prob=0.3 \n
vodka = 1, prob=0.2 \n
energy_drink = 1, prob=0.5 \n
flaska = 1, prob=0.1 \n
beer_a = 1, prob=0.2 \n
sweetness = 1, prob=0.1 \n
sandwich = 1, prob=0.3 \n
cigara = 1, prob=0.1 \n
</supplies>
---END QUOTATION---



It actually avoids the entire character_*.xml thing. But yea, like I said. It's rarely the same NPCs not having weapons. It's random and something going back a save or two and entering an area again will spawn the NPCs correctly with the weapons (usually that is). I may add that these guys always have some sort of items on them, most of the time (if not always) ammo too.. Just not a weapon.
  05:42:46  29 June 2012
profilee-mailreply Message URLTo the Top
Derranged
Senior Resident
 

 
On forum: 04/12/2010
Messages: 1009
Well, that is pretty weird if you ask me... I have no clue really, I guess just keep looking. If you use "Agent Ransack" do a search for "wpn_bm16 = 1, prob"

If you don't know what Agent Ransack is, it is a very useful tool which looks through every file for that line of script.
  14:04:51  29 June 2012
profilee-mailreply Message URLTo the Top
Kocayine
Senior Resident
 

 
On forum: 07/15/2010
Messages: 918

---QUOTATION---
Well, that is pretty weird if you ask me... I have no clue really, I guess just keep looking. If you use "Agent Ransack" do a search for "wpn_bm16 = 1, prob"

If you don't know what Agent Ransack is, it is a very useful tool which looks through every file for that line of script.
---END QUOTATION---



Thanks for the suggestion, already using grepWin for that but I guess they do exactly the same thing the two programs.

It seems like there is no weapons that uses the "prob". (Probability of spawning, I guess it means). Only items like guitars, food and what not... and it doesn't seem like (I know this is hard to say because the character_desc files are massive) any characters have missing weapons in their "supplies".
  14:20:25  29 June 2012
profilee-mailreply Message URLTo the Top
Lijenstina
Doom metal in the shade of the flying radiators
(Resident)

 

 
On forum: 07/23/2005
 

Message edited by:
Lijenstina
06/29/2012 14:22:42
Messages: 1902
The problem with the vanilla weapon spawn generator in the xml's is that sometimes an npc get spawned a lot of weapons and sometimes it doesn't have any.

For instance, if the probability is three weapons is 0.3 ( 30%) each is quite possible to have no weapons spawned and or all three are spawned. Also if the npc doesn't have ammo for the weapon it will not be used.
  14:26:31  29 June 2012
profilee-mailreply Message URLTo the Top
Kocayine
Senior Resident
 

 
On forum: 07/15/2010
Messages: 918

---QUOTATION---
The problem with the vanilla weapon spawn generator in the xml's is that sometimes an npc get spawned a lot of weapons and sometimes it doesn't have any.

For instance, if the probability is three weapons is 0.3 ( 30%) each is quite possible to have no weapons spawned and or all three are spawned. Also if the npc doesn't have ammo for the weapon it will not be used.
---END QUOTATION---



But each inventory in the character_desc files only have one weapon and there's not even a "prob". It's set to definitely give the said NPC the listed weapon.
  18:35:44  29 June 2012
profilee-mailreply Message URLTo the Top
Lijenstina
Doom metal in the shade of the flying radiators
(Resident)

 

 
On forum: 07/23/2005
 

Message edited by:
Lijenstina
06/29/2012 18:42:42
Messages: 1902
All of the some 1000 characters defined in the xmls ?

EDIT:
Interesting. It does seem to be set to spawn for the most part.

Hm. The other possibility is that amk_offline did sell the weapon of the npc.
  18:38:11  29 June 2012
profilee-mailreply Message URLTo the Top
Kocayine
Senior Resident
 

 
On forum: 07/15/2010
Messages: 918

---QUOTATION---
All of the some 1000 characters defined in the xmls ?
---END QUOTATION---

I have been thru almost all of them, atleast the bandits. Besides, if that was the source of the problem wouldn't it be like that every time the NPC spawned?
  20:50:55  29 June 2012
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349
I had this a few times in my megamod. No idea of the cause. I had no ai packs in it and nothing out of the ordinary, except a few hacks of my own. I guess the engine is very particular (actually i now know it is) to some changes regarding npc's.
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2021 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.