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
  01:01:51  25 March 2008
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4302
That is very interesting information, arras. Thanks for posting it.

---QUOTATION---
shotguns -ef_weapon_type 7 -ef_main_weapon_type 1
automatic weapons -ef_weapon_type 6 -ef_main_weapon_type 2
---END QUOTATION---


Sounds like a possible class hierarchy to me. This implies that the shotgun "class" is ranked higher than the automatic weapon "class". It might be just a number, but it is consistent with the NPC preference of a shotgun over the automatic rifle if they don't have the ammo in their inventory.

This speculation should be easy to test, though...

Also, I'm wondering about the choice of single-shot versus auto for the MP5. I can give Kruglov a normal MP5 set to full auto in Yantar, and he will still use single-fire mode with it.

Musky Melon, you may need to qualify your statement. One CANNOT trade guns with generic NPCs in vanilla. You must be using a modified game. Trading does not have the same result as throwing the weapon at the NPC in vanilla.

The problem with writing scripts to solve problems is that the problems might be more of a C++ engine issue. Scripts would only be workarounds, at best. Perhaps changing ef_main_weapon_type in the weapon .ltx files per the data supplied by arras and then programmatically giving each NPC ammo commensurate with their rank or community would work. (You can manually edit the character_desc_*.xml files to give them ammo; I've successfully done this for Shaggy Sergei and others so that they can actually use the AK-74 for more than thirty shots...)

Bjossi, re: NPCs not smart enough to change ammo types: >> Then someone can simply teach them how to do so.

I nominate Bjossi!

I think you are right, though. Sigh. So much to do...
  01:39:03  25 March 2008
profilee-mailreply Message URLTo the Top
Musky Melon
Senior Resident
 

 
On forum: 07/28/2007
Messages: 212
It's been a long time since I played vanilla I forgot that weapons couldn't be traded.

At any rate, I was more suggesting a specific weapon versus weapon hierarchy more-so than a weapon classification hierarchy. For example: explicitly rating the Obakan (AN94) as being superior to the AK-74. To me, it seems the existing system has no method of comparing weapons within the same class.
  01:52:56  25 March 2008
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
That would be about right. The way I see it with the existing system for rifles it would have to go something like (worst to best) bm16, ak74su, toz34, ak74, winchester, abakan etc etc.
  04:10:36  25 March 2008
profilee-mailreply Message URLTo the Top
Bjossi
(Novice)
 
On forum: 03/21/2008
Messages: 27

---QUOTATION---
Bjossi, re: NPCs not smart enough to change ammo types: >> Then someone can simply teach them how to do so.

I nominate Bjossi!

I think you are right, though. Sigh. So much to do...
---END QUOTATION---



An experienced programmer could add extra code to make NPCs use other ammo types to their advantage. But lots of experience with STALKER modding is also necessary.
  07:13:27  25 March 2008
profilee-mailreply Message URLTo the Top
arras
(Senior)
 
On forum: 03/08/2008
 

Message edited by:
arras
03/25/2008 7:16:39
Messages: 72
NatVac >> I think that NPC calculate value of weapon like this: ef_weapon_type plus ef_main_weapon_type so automatic weapons and shotguns would have the same value. In such case status of weapon will prevail. But again this is only my guess.


---QUOTATION---
An experienced programmer could add extra code to make NPCs use other ammo types to their advantage.
---END QUOTATION---


For this you would need not only Cpp skill (if stalker was done in Cpp ) but also good knowledge of whole source code in order to find part which is responsible for NPC weapon evaluation and overall knowledge of different variables. And then still, you need to recompile whole project.

(Why the hell I can't submit key "plus"? ...it disappears after submitting message...)
  17:22:22  25 March 2008
profilee-mailreply Message URLTo the Top
BobBQ
2007-2017
(Resident)

 

 
On forum: 07/30/2007
Messages: 3336
I'd also be interested to see if anything comes of this.

My own experimentation is based mostly on what happens when the use_single_item rule is disabled. NPCs can carry several weapons at once, provided that each NPC has ammo for all of those weapons. With this setup, NPCs will not throw weapons away but will pick up new ones if they are higher ranked or if I temporarily buy out all the ammo they have for their current weapon of choice. NPCs seem to know by default how to switch between weapons when empty and when engaging at different ranges: a stalker with a Dragunov trying to kill a snork will swap to his LR300 and sometimes to his SPAS-12 as the target gets closer. When not fighting, NPCs always carry whichever weapon is highest ranked: pistol < SMG < assault rifle < shotgun < sniper rifle < RPG.

The one flaw with this setup as it currently stands is that killed NPCs drop only the last primary and secondary weapons they had equipped. Giving quest item status prevents the problem, but is presently only practical for unique weapons and armor.
  12:02:21  11 March 2010
profilee-mailreply Message URLTo the Top
Meltac
messing with code
(Resident)

 

 
On forum: 01/21/2010
Messages: 1519

---QUOTATION---
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.

---END QUOTATION---



Would that mean an NPC would take and use ANY assault rifle I give him, when its ef_main_weapon_type and ef_weapon_type value are the same as with the gun he had before, as long as it is completely NEW and his own weapon isn't?

In other words, can I force an NPC to use my completely new gun over his already used one (when both are of the same type / class)?
  12:08:54  11 March 2010
profilee-mailreply Message URLTo the Top
Steelhawk92
Average Joe - Used to be Jamie1992
(Resident)

 

 
On forum: 03/16/2008
Messages: 5051
Why are you reviving a 2 year old topic? :S
  12:16:45  11 March 2010
profilee-mailreply Message URLTo the Top
Fulcrum
Senior Resident
 

 
On forum: 12/15/2007
Messages: 555

---QUOTATION---
Why are you reviving a 2 year old topic? :S
---END QUOTATION---



At least hes searching the forums. This post is kinda useful to everyone as well
  12:18:52  11 March 2010
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349

---QUOTATION---
Why are you reviving a 2 year old topic? :S
---END QUOTATION---


because it was never answered
 
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.