ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
how to make npcs pick up all weapons

« Previous 10 events | 1 2 3 4 5 6 7 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  18:50:07  23 March 2008
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4303
If the NPC has a shotgun shell in his inventory, he will pick up a shotgun over another weapon for which he does not have ammo. Plus there is the silverpower discovery that the class hierarchy is weird, as indicated in part by Shadow State's link. Maybe the shotgun class has a higher rank than it should.

You can give any weapon to an NPC that is higher in rank, and it doesn't even have to be loaded if they already have ammo for it. However, you should not give a weapon with AP ammo loaded to an NPC with non-AP ammo. They don't seem to be smart enough to realize that they can change ammo types.

I've never had a problem giving a weapon to an NPC if they will take one. I don't drop it, I equip it and then throw it at them.
  19:04:21  23 March 2008
profilee-mailreply Message URLTo the Top
Bjossi
(Novice)
 
On forum: 03/21/2008
Messages: 27

---QUOTATION---
They don't seem to be smart enough to realize that they can change ammo types.
---END QUOTATION---



Then someone can simply teach them how to do so.
  09:08:54  24 March 2008
profilee-mailreply Message URLTo the Top
arras
(Senior)
 
On forum: 03/08/2008
 

Message edited by:
arras
03/24/2008 9:23:44
Messages: 72
Class hierarchy does nothing to do with NPCs choice of weapon.
By testing I did find 3 things that influence if and what weapon NPC choose to use:

1. ef_main_weapon_type (w_"weaponname".ltx).
2. ef_weapon_type (w_"weaponname".ltx).
3. worn out status of weapon.

ef_main_weapon_type and ef_weapon_type sort all weapons in to groups:
stabbing weapons -ef_weapon_type 1 -ef_main_weapon_type 0
pistols -ef_weapon_type 5 -ef_main_weapon_type 0
shotguns -ef_weapon_type 7 -ef_main_weapon_type 1
automatic weapons -ef_weapon_type 6 -ef_main_weapon_type 2
sniper rifles -ef_weapon_type 8 -ef_main_weapon_type 3
grenade launchers -ef_weapon_type 9 -ef_main_weapon_type 4
grenades -ef_weapon_type 10 -ef_main_weapon_type 0

NPCs prefers weapon which have those two numbers higher. However those numbers also define how NPCs use weapon. Change those numbers in w_mp5.ltx in to sniper rifle and NPC is going to shot HK submachine gun in single shots as it would do with Dragunov.

What difference is between ef_main_weapon_type and ef_weapon_type in game I don't know yet. I did not notice some differences but I guess it have to do something with primary/secondary role of weapon.

Problem with this is, that AKS-74U is in the same group as AN-94 and so NPC do not know that second one is better.

If NPC owns two weapons from the same category it seems to choose one which is in better state (less worn out).

Of course, NPC have to have some ammo for weapon which itself can be empty. Otherwise it would not use it.
If NPC have some ammo (single piece is enough) then he is going to get unlimited supply of it.

NPCs do not have to switch to better (in his logic) weapon immediately as he obtain one but can switch it at the start of next combat.

All this are just my finds made by testing and do not have to be entirely correct. There may be some other factors influencing it which I do not known about.
  09:26:43  24 March 2008
profilee-mailreply Message URLTo the Top
Musky Melon
Senior Resident
 

 
On forum: 07/28/2007
 

Message edited by:
Musky Melon
03/24/2008 9:27:08
Messages: 212
Why do people throw weapons at the NPC instead of just trading with them? Trading has the same result and you get money for the weapon.
  13:24:24  24 March 2008
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432

---QUOTATION---


Problem with this is, that AKS-74U is in the same group as AN-94 and so NPC do not know that second one is better.


---END QUOTATION---



In that case, what about putting the better weapon in the list first? Basically have weapons in the order of best-in-class to worst-in-class.
  17:28:42  24 March 2008
profilee-mailreply Message URLTo the Top
Bjossi
(Novice)
 
On forum: 03/21/2008
Messages: 27

---QUOTATION---
Why do people throw weapons at the NPC instead of just trading with them? Trading has the same result and you get money for the weapon.
---END QUOTATION---



You need to make some changes in trade_generic.ltx and m_stalker.ltx for that to work out.

I did give that a try and it works. But one of my savegames stopped loading during synchronization process. I'm suspecting if I give any weapon to a NPC, the savegames to follow will malfunction.

But I have to do more testing with this, so it's just a theory still.
  22:30:28  24 March 2008
profilee-mailreply Message URLTo the Top
Musky Melon
Senior Resident
 

 
On forum: 07/28/2007
Messages: 212
^ I haven't had a problem with that.

Anyway, has anyone ever considered writing a script for NPCs that dictates the hierarchy of weapon superiority to them? I'd imagine that you could link it to the trading scripts for the NPCs so that in the event of a trade it'd force them to automatically switch their equipped weapon or perhaps even destroy their previous weapon (assuming there is a method allowing you to make an explicit call to the destructor for the object).
  00:14:26  25 March 2008
profilee-mailreply Message URLTo the Top
Bjossi
(Novice)
 
On forum: 03/21/2008
Messages: 27
I did further testing and turns out it was just a coincidence that the savegame broke. Good thing I have many to fall back to.

Anyway, giving NPCs guns is good and all, but most of them suck at shooting and end up getting owned by just a bandit, like in the hangar near Agroprom. (I gave the rookies NATO ARs, and they ended up getting killed by Viper 5 and pistol fire from bandits...)
  00:21:21  25 March 2008
profilee-mailreply Message URLTo the Top
Lucian04
Inglorious Bastard
(Resident)

 

 
On forum: 02/10/2008
Messages: 1422

---QUOTATION---
I did further testing and turns out it was just a coincidence that the savegame broke. Good thing I have many to fall back to.

Anyway, giving NPCs guns is good and all, but most of them suck at shooting and end up getting owned by just a bandit, like in the hangar near Agroprom. (I gave the rookies NATO ARs, and they ended up getting killed by Viper 5 and pistol fire from bandits...)
---END QUOTATION---





I try not to give rookies anything more than an MP5 or AK74U.. I reserve anything better for more experienced Stalkers and other friendly factions.
  00:54:07  25 March 2008
profilee-mailreply Message URLTo the Top
Bjossi
(Novice)
 
On forum: 03/21/2008
Messages: 27
I figured as much. It was just a test.
But on the other hand, there is usually a rookie upstairs in the hangar. If I grab the bandits' attention, the shooter upstairs could kill them one after another with his shiny NATO assault rifle.

But I guess I'll be giving them less powerful guns, I don't want to face superbandits if they happen to spot one of the NATOs near a fallen rookie.

But why are the rookies so hopeless at shooting? It seems to me like the weakest, least experienced bandits are pretty damn good at it even at long distances.
 
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-2022 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.