ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
[Tutorial] The Truth about ef_weapon_type

1 2 3 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  07:06:22  2 September 2012
profilee-mailreply Message URLTo the Top
Storm Shadow
A machine, a Shadow Machine.
(Resident)

 

 
On forum: 11/14/2007
 

Message edited by:
Storm Shadow
09/03/2012 3:04:48
Messages: 1430
[Tutorial] The Truth about ef_weapon_type

References:
weapon classes
https://www.gsc-game.com/main.php?t=community&s=forums&s_game_type=xr&thm_id=13201&sec_id=16&page=1
how to make npcs pick up all weapons
https://www.gsc-game.com/main.php?t=community&s=forums&s_game_type=xr&thm_id=13811&sec_id=16&page=1
AMK Weapon Add-on - WIP
https://www.gsc-game.com/main.php?t=community&s=forums&s_game_type=xr&thm_id=14310&page=5&sec_id=16
npc's preferring shotguns?
https://www.gsc-game.com/main.php?t=community&s=forums&s_game_type=xr&thm_id=21512&sec_id=16&page=1


Below are the settings of how the vanilla weapons are grouped together:
ef_main_weapon_type:		ef_weapon_type:		group:
0				1			stabbing
0				5			pistol
1				7			shotguns
2				6			automatic
3				8			sniper
4				8			grenade launcher
0				10			hand grenade

you will want to look in m_stalker.ltx and take note of the settings in your fire queues. note that there is nothing wrong with the vanilla settings here, but you can make them more aggressive as you see fit. below i've noted the ranges that are hard coded for each of the fire queues:
;---FIRE QUEUE PARAMETERS
;far range 	= 30 - 1000m.
;med range 	= 15 - 30m. 
;close range 	= 0  - 15m. 

i've listed below what i've found from my testing. how ef_weapon_type relate to how an NPC will utilise a weapon:
ef_weapon_type:		NPC use of weapon:
1 - 4			as per fire queue
5			3 round burst at close and med range. as per fire queue at far range
6			as per fire queue
7			single shot at approx 1sec intervals
8			single shot at 3sec intervals
9			if range is farther than 20m, then as per the medium fire queue. if range is closer than 20m, then change weapon.
10			if range is between 3 - 20m, then as per fire queue. else change weapon
11			if range is farther than 3m, then as per fire queue. if range is closer than 3m, then change weapon
12 - 99			as per fire queue.

Notes:
- the weapon hierarchy is numerological. ie they will equip a weapon with a higher value in ef_weapon_type over a lower one.
- except that, all pistols must be ef_weapon_type = 5 & ef_main_weapon_type = 0 or you're going to have a bad time. (or the NPCs will choose their pistol instead of their rifle, i dont know why this is).
- once they have a new weapon, they might not equip it until next combat.
- as we all know, NPCs must have the correct ammo type in their inventory’s or they wont be able to reload their new weapons once the mag runs out.
- i really dont have any idea what ef_main_weapon_type does at all.
- the upper limit is not known, i just put 99 as a place holder.
- you will want to set use_single_item_rule = off in m_stalker.ltx
- min_radius, max_radius & fire_distance settings in each weapons .ltx file have no effect at all. these functions are instead determined by the fire queue
- as far as i can tell; mp_ranks.ltx has nothing to do with the hierarchy of NPC wpn evaluation, this is done solely by the ef_weapon_type value.

In my mod i've set every weapon in the game in a logical hierarchies and given each group its own unique ef_weapon_type.

using this method i have been able to successfully answer the age old questions of how to get an NPC to take an AKSU-74 off you when he already has a BM-16!

if someone would want to add this to the mod wiki as an article, that would be great.

(edits: formatting)
  07:56:46  2 September 2012
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340
Could you also explain how the "weapon_*_queue_size_far_*" and "weapon_*_queue_interval_*" relate the the fire queue, or don't you know what those parameter affect yet?
  08:13:44  2 September 2012
profilee-mailreply Message URLTo the Top
Storm Shadow
A machine, a Shadow Machine.
(Resident)

 

 
On forum: 11/14/2007
 

Message edited by:
Storm Shadow
09/02/2012 9:16:23
Messages: 1430

---QUOTATION---
Could you also explain how the "weapon_*_queue_size_far_*" and "weapon_*_queue_interval_*" relate the the fire queue, or don't you know what those parameter affect yet?
---END QUOTATION---



in m_stalker.ltx you will find:

;---FIRE QUEUE PARAMETERS
;far range = 30 - 1000m.
weapon_min_queue_size_far		= 1
weapon_max_queue_size_far		= 6
weapon_min_queue_interval_far		= 500
weapon_max_queue_interval_far		= 1000

;med range = 15 - 30m. 
weapon_min_queue_size_medium		= 4
weapon_max_queue_size_medium		= 6
weapon_min_queue_interval_medium	= 500
weapon_max_queue_interval_medium	= 750

;close range = 0 - 15m. 
weapon_min_queue_size_close		= 4
weapon_max_queue_size_close		= 10
weapon_min_queue_interval_close		= 300
weapon_max_queue_interval_close		= 500



min_queue_size & max_queue_size determines the upper and lower limits for a randomly generated figure that will be how many rounds an NPC fires in each fully automatic burst.

min_queue_interval & max_queue_interval determine the amount of time gap between each burst.

these are determined differantly depending on the range the NPC is from the target. being close, medium or far range. as you can see, the closer they are, the bigger and quicker the bursts, further away, they will use smaller and more spaced out bursts.

i've noted the range in meters for each of the 3 pre-determined ranges. these are hardcoded and i've based them on the observations from my testing.

of course, as per my OP, depending on the ef_weapon_type will determine whether or not an NPC will even use the fire queue for a each differant weapon.

EDIT: ref the intervals, 1000 = 1sec.
  08:19:02  2 September 2012
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340
'kay. Now we seem to have a specialized subset of variables for controlling how many rounds get fired at which range, and how rapidly in addition to the general ones in the various m_<faction> configs.
  08:21:52  2 September 2012
profilee-mailreply Message URLTo the Top
Storm Shadow
A machine, a Shadow Machine.
(Resident)

 

 
On forum: 11/14/2007
 

Message edited by:
Storm Shadow
09/02/2012 8:38:50
Messages: 1430

---QUOTATION---
'kay. Now we seem to have a specialized subset of variables for controlling how many rounds get fired at which range, and how rapidly in addition to the general ones in the various m_<faction> configs.
---END QUOTATION---



what are m_<faction> configs?

EDIT: if you are refering to m_army.ltx & m_bandit.ltx, then know that these files are not used by the vanilla game. all NPCs who spawn with section_name = stalker in the all.spawn, use the varibles from m_stalker.ltx (including those who spawn as section_name = stalker_trader)
  16:57:36  3 September 2012
profilee-mailreply Message URLTo the Top
ZaGaR
Skaarj Hybrid - NaPali survivor
(Resident)

 

 
On forum: 07/24/2007
 

Message edited by:
ZaGaR
09/03/2012 17:19:35
Messages: 647

---QUOTATION---

.....

Notes:
- the weapon hierarchy is numerological. ie they will equip a weapon with a higher value in ef_weapon_type over a lower one.
- except that, all pistols must be ef_weapon_type = 5 & ef_main_weapon_type = 0 or you're going to have a bad time. (or the NPCs will choose their pistol instead of their rifle, i dont know why this is).
.....

---END QUOTATION---



I played recently a russian mod that had the pistols = ef_weapon_type = 4 with no visible problems. It seems that this setting made the pistols a kind of "lesser choice", when the sawed-off is set bm_16 = ef_weapon_type = 5 . Don't know if you tested such combo.



EDIT (forgot to ask):

Another engine coded problem is the strange glitch AKSU - over - AK? With use_single_item_rule=on NPCs will NEVER pick up an AK (thrown to them) when they have an AKSU. This latter seems to be of more value than AK , but will gladly take AN over either of those. Can you repeat this test with your new classification?
  03:10:26  4 September 2012
profilee-mailreply Message URLTo the Top
Storm Shadow
A machine, a Shadow Machine.
(Resident)

 

 
On forum: 11/14/2007
 

Message edited by:
Storm Shadow
09/04/2012 9:09:26
Messages: 1430

---QUOTATION---
I played recently a russian mod that had the pistols = ef_weapon_type = 4 with no visible problems. It seems that this setting made the pistols a kind of "lesser choice", when the sawed-off is set bm_16 = ef_weapon_type = 5 . Don't know if you tested such combo.
---END QUOTATION---

All i know is that from my initial testing, i had pistols in differant tiers from ef_wpn 2 thru to 5 depending. and i had problems with NPCs prefering to use their pistol at ef_wpn 4 over there rifle which was ef_wpn 40. but the ones that had pistols at ef_wpn 5, didnt have this problem, they chose to use their rilfe (same rifle). so now i have all my pistols at ef_wpn 5 and i dont have any problems.

also note that in my mod, BM-16 acts the same as a pistol in every way. so its also set to ef_wpn_5. and everything works well.
---QUOTATION---
EDIT (forgot to ask):

Another engine coded problem is the strange glitch AKSU - over - AK? With use_single_item_rule=on NPCs will NEVER pick up an AK (thrown to them) when they have an AKSU. This latter seems to be of more value than AK , but will gladly take AN over either of those. Can you repeat this test with your new classification?
---END QUOTATION---

I've just tested this now. and yes i was able to give an NPC (who had only a pistol) an AK74u, which he accepted and changed to. then i gave him an AK74 and he changed to that. then I gave him an abakan and he took it, but didnt change to it until i equip'd my wpn.

i only ever use single_item off. if you turn this setting on, then you're gonna have a bad time.

cheers, Shad.



EDIT: did the same test again with use_single_item_rule = on (dont know why anyone would want to use this setting, but it is the vanilla setting) and it still worked perfectly.

same NPC with pistol, i gave him an AKSu and he equipped it, gave him an AK74 and he dropped the Su and equipped the 74. gave him an abakan and he equipped that and dropped the AK. no prob.

for those who are interested, in my mod's thread i've posted the list of all my mod's weapons and their corresponding ef_wpn_type here:
https://www.gsc-game.com/main.php?t=community&s=forums&s_game_type=xr&thm_id=21537&page=6&sec_id=16
  23:11:49  4 September 2012
profilee-mailreply Message URLTo the Top
ZaGaR
Skaarj Hybrid - NaPali survivor
(Resident)

 

 
On forum: 07/24/2007
Messages: 647
Then it really works my man.
Cheers
  00:06:14  5 September 2012
profilee-mailreply Message URLTo the Top
MrSeyker
Senior Resident
 

 
On forum: 03/21/2010
Messages: 433
I was testing some guns with use_single_item to off and the default shotguns and rifles.

Gave that NPC you save at the garbage a Sawn-Off and ammo, and then gave him an AK-74U and ammo. He never equiped the rifle, until I attacked him.

He then switched to the rifle and kept using it until I was dead.

So, how common is this problem really?

I know that if the use_single_item rule is ON, for whatever reason they won't pick the rifle if they have the shotgun (I've also seen some NPCs pick the rifle, drop the shotgun, and then drop the rifle and pick the shotgun again once they notice it on the ground).

Just in case, I changed the ef_weapon_type of the BM16 and the TOZ34 from 7 to five.

The NPC uses the shotgun like a pistol, firing the shotgun's two shells as fast as possible, then reloading.

The Garbage newbie behaved exactly as with the unmodded weapons (rifle not equiped immediately, but used once in combat).

Granted, those are the only weapons I tested. Maybe I also tested with an AK-74, but I can't remember.
  00:28:44  5 September 2012
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340

---QUOTATION---
Just in case, I changed the ef_weapon_type of the BM16 and the TOZ34 from 7 to five.

The NPC uses the shotgun like a pistol, firing the shotgun's two shells as fast as possible, then reloading.
---END QUOTATION---


I noticed this behaviour as well a while ago, when I was messing around with the ef_weapon_type values. After that, I reverted to the vanilla values.
I think its just the assault rifles that need ef_weapon_type values higher than 10, so npc's will favour them over shotguns.
I'm still trying to sort through all this info, and figure out the best way to apply it without getting glitches like this.
 
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-2020 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.