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 Oldest Up Sort by Ascending
  06:00:27  14 September 2013
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/14/2013 6:38:22
Messages: 1430
The Truth About ef_creature_type

Hey guys, revelation time now.

Intro
I had been experiencing a strange bug with these weapon settings that was doing my head in, I pretty much spent from after dinner time last night until almost dawn this morning testing variables and figuring it out, good thing it was a Friday! And guess what, I still don't really understand the system behind it, the why, but I have figured out the solution now, the how. You can make of it what you will.

The Bug
I found that using these weapon settings that NPCs would prefer to switch to a pistol (if avail) to fight mutants. Further digging revealed that this was only with certain low level mutants, such a dogs, rats, zombies.

The Progress
Wondering why, I started experimenting with the weapon files ef_main_weapon_type and with the creature files ef_weapon_type and ef_creature_type.

From this testing, I now believe that in the weapon files; ef_weapon_type relates to range and fire queueing, while ef_main_weapon_type related to the type of target. This is evaluated against the target's (mutant or human) ef_creature_type and ef_weapon_type

I'm not exactly sure how it deduces this evaluation, but my findings below show a full working solution

Solution
*Weapon Config Files:*
1. Configure all of your weapons to your desired ef_weapon_type parameters as detailed in this thread.

2. Set all slot1 weapons (pistols, machine pistols, single handed weapons, etc) to:ef_main_weapon_type = 0

3. Set all slot2 weapons (smg, rifle, shotguns, sniper, machine guns, etc) to:ef_main_weapon_type = 2

*Creature Config Files:*
4. Ensure all creatures are set not lower than: ef_creature_type = 10.

5. Ensure all creatures are set not lower than: ef_weapon_type = 3.

(note: I don't know what ef_detector_type does, but I didn't need to change this at all.)

Hope this helps, please comment with your feedback and findings from using these settings too.

Regards,

Shad
  03:59:28  4 September 2013
profilee-mailreply Message URLTo the Top
Storm Shadow
A machine, a Shadow Machine.
(Resident)

 

 
On forum: 11/14/2007
Messages: 1430

---QUOTATION---
It is the latest ZRP, man. With the default wpn table, the modified ones are absolutely preferred from AI. Then I did a test with a slightly better wpn table, along your guidelines here, just a few more numbers for AK, AN, SIG and so. Again the xxx_m1 models create confusion.

I believe I have to edit unique_items.ltx and insert specific ef_weapon_type into these models configuration, so they can have a proper ranking against the normal ones.
---END QUOTATION---



you only need to add an ef wpn type varible to unique items if either; it is already modified, or you want it to be in a differant tier to the original.

i cant comment on the latest zrp, as i havn't began my trials of it yet. but, i understand that it involves ai functions that may deal with wpn selection by script.
  23:27:41  3 September 2013
profilee-mailreply Message URLTo the Top
ZaGaR
Skaarj Hybrid - NaPali survivor
(Resident)

 

 
On forum: 07/24/2007
Messages: 647
It is the latest ZRP, man. With the default wpn table, the modified ones are absolutely preferred from AI. Then I did a test with a slightly better wpn table, along your guidelines here, just a few more numbers for AK, AN, SIG and so. Again the xxx_m1 models create confusion.

I believe I have to edit unique_items.ltx and insert specific ef_weapon_type into these models configuration, so they can have a proper ranking against the normal ones.
  04:07:35  3 September 2013
profilee-mailreply Message URLTo the Top
Storm Shadow
A machine, a Shadow Machine.
(Resident)

 

 
On forum: 11/14/2007
Messages: 1430

---QUOTATION---
Shadow my man, the xxxx_m1 and xxxx_m2, a.k.a "unique" pieces seem to be preferred from the engine. I did a test having Cordon NPCs carry mp5_m1 instead of makarovs. After combats, some AI carrying an AN or SIG, dropped it (with ...rule=on) in favor of a good state 9x18-MP5.
---END QUOTATION---



Zag my man, were you testing with vanilla stalker? or with modified ef wpn types? if not, could you repeat the test with suitable ef wpn types for each wpn tier...

cheers my man.
  17:12:06  2 September 2013
profilee-mailreply Message URLTo the Top
ZaGaR
Skaarj Hybrid - NaPali survivor
(Resident)

 

 
On forum: 07/24/2007
Messages: 647
Shadow my man, the xxxx_m1 and xxxx_m2, a.k.a "unique" pieces seem to be preferred from the engine. I did a test having Cordon NPCs carry mp5_m1 instead of makarovs. After combats, some AI carrying an AN or SIG, dropped it (with ...rule=on) in favor of a good state 9x18-MP5.
  11:18:26  8 November 2012
profilee-mailreply Message URLTo the Top
trojanuch
Senior Resident
 

 
On forum: 04/08/2007
Messages: 1444
Very good thread - sincere thanks.

I had my own deal of modifying this stuff previously in CoP (especially fire_queue is a usefull tool) - but its great that you've managed to put it all here in such a systematic form.

I'll be definatelly be digging more into this stuff now.
  20:09:33  10 September 2012
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
Messages: 319
@Shad No I didn't
  17:48:43  10 September 2012
profilee-mailreply Message URLTo the Top
ZaGaR
Skaarj Hybrid - NaPali survivor
(Resident)

 

 
On forum: 07/24/2007
 

Message edited by:
ZaGaR
09/10/2012 17:49:34
Messages: 647
Usually those represent the C classes coded into the engine, not changeable through the script. Most probably, it is another unused script like lua_help.script, just providing documentation for the engine.

It is obvious, that only what's declared WP_AK74 gets a GL.

The WP_LR300 anomaly is maybe related to the lengthy development of the game. In the early 2000s, one of the ZMs experimental products was a "short" 11.5" barrel LR300. Probably at the time, GSC tried to get it in the game as western opposite to AKSU. As the development went on, the LR300 model changed quite a few times. Judging from the weight, 2.7kg and the in-game visual length, the final LR is the real life 14.5" barrel carbine. Yet, we have left in the game the class of a short & light rifle which is not used for anything, even for AKSU which fits perfectly into it.
  10:13:23  10 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/10/2012 10:39:55
Messages: 1430

---QUOTATION---
That's why I questioned how prevalent was the bug once use_single_weapon is set to off.
---END QUOTATION---


@MrSeyker, bro the whole point of this tut is to answer the questions that have been posed and mysterious about all this stuffs, as per the articles that I referenced in the OP.

If this is not an issue for you, then you dont need to worry about it. But as you can see from the years of us wondering about all this stuffs, to some of us, it is an issue.


@Sacipan, good work on adding that additional infos in bro.

also bro, did you know that the classes are defined by class_register.script?
	
cs_register	(object_factory, "CWeaponAK74",		"se_item.se_weapon_magazined_w_gl",	"WP_AK74",	"wpn_ak74_s")
cs_register	(object_factory, "CWeaponLR300",	"se_item.se_weapon_magazined",		"WP_LR300",	"wpn_lr300_s")
cs_register	(object_factory, "CWeaponBinoculars","se_item.se_weapon_magazined",		"WP_BINOC",	"wpn_binocular_s")
cs_register	(object_factory, "CWeaponBM16",		"se_item.se_weapon_shotgun",		"WP_BM16",	"wpn_bm16_s")
cs_register	(object_factory, "CWeaponGroza",	"se_item.se_weapon_magazined_w_gl",	"WP_GROZA",	"wpn_groza_s")
cs_register	(object_factory, "CWeaponSVD",		"se_item.se_weapon_magazined",		"WP_SVD",	"wpn_svd_s")
cs_register	(object_factory, "CWeaponHPSA",		"se_item.se_weapon_magazined",		"WP_HPSA",	"wpn_hpsa_s")
cs_register	(object_factory, "CWeaponKnife",	"se_item.se_weapon",			"WP_KNIFE",	"wpn_knife_s")
cs_register	(object_factory, "CWeaponPM",		"se_item.se_weapon_magazined",		"WP_PM",	"wpn_pm_s")
cs_register	(object_factory, "CWeaponRG6",		"se_item.se_weapon_shotgun",		"WP_RG6",	"wpn_rg6_s")
	
cs_register	(object_factory, "CWeaponRPG7",		"se_item.se_weapon_magazined",		"WP_RPG7",	"wpn_rpg7_s")
	
cs_register	(object_factory, "CWeaponShotgun",	"se_item.se_weapon_shotgun",		"WP_SHOTG",	"wpn_shotgun_s")
	
--cs_register	(object_factory, "CWeaponMagazined","se_item.se_weapon_magazined",		"WP_MAGAZ",	"wpn_magazined_s")
	
cs_register	(object_factory, "CWeaponSVU",		"se_item.se_weapon_magazined",		"WP_SVU",	"wpn_svu_s")
cs_register	(object_factory, "CWeaponUSP45",	"se_item.se_weapon_magazined",		"WP_USP45",	"wpn_usp45_s")
cs_register	(object_factory, "CWeaponVal",		"se_item.se_weapon_magazined",		"WP_VAL",	"wpn_val_s")
cs_register	(object_factory, "CWeaponVintorez",	"se_item.se_weapon_magazined",		"WP_VINT",	"wpn_vintorez_s")
cs_register	(object_factory, "CWeaponWalther",	"se_item.se_weapon_magazined",		"WP_WALTH",	"wpn_walther_s")

(not that I can make heads or tails of it?? lol)

Shad.

PS - for those of you who weren't aware of what he was referanceing, it's all to do with SilverPower's old post here:
weapon classes
https://www.gsc-game.com/main.php?t=community&s=forums&s_game_type=xr&thm_id=13201&sec_id=16

EDITS: Formatting
  22:17:32  9 September 2012
profilee-mailreply Message URLTo the Top
SacriPan
Senior Resident
 

 
On forum: 09/20/2009
Messages: 319
Ok the "weapon_class" is deteminant.

--> for the AK74_sniper example:

I set it to AK_74 which is an assault rifle "class". But as it's derivated from an assault rifle, I still want to be able to mount a GL. For this, I DO HAVE to set it to:

class = AK-74
weapon_class = assault_rifle

If I didn't want to mount a GL, I could set it like that:
class = WP_VINT
weapon_class = sniper_rifle
 
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.