Random Weapon Loadouts

User avatar
Diegtiarov
Trespasser
Posts: 52
Joined: 12 Nov 2015, 08:34
Contact:

Random Weapon Loadouts

Postby Diegtiarov » 01 Jan 2017, 06:26

Hi,

I've been lurking around to find any good way of making NPC equipment fully random. Today I found that there's a change in the engine you guys made ( viewtopic.php?f=32&t=549 ).

So, I've done everything as described but the game chooses EVERY item from the [spawn_loadout].
Could be the #include a cause of the problem?

Example:

Code: Select all

  <specific_character id="sim_default_killer_0_default_0a" team_default = "1">
    <name>GENERATE_NAME_stalker</name>
    <icon>ui_inGame2_merc_2</icon>
    <map_icon x="1" y="0"></map_icon>
    <bio>??????? ???????. f???????¤ ?????????¤ ???????????.</bio>

    <class>sim_default_killer_0</class>
    <community>killer</community> <terrain_sect>stalker_terrain</terrain_sect>
    <snd_config>characters_voice\human_03\killer\</snd_config>

    <rank>1747</rank>
   <money min="250" max="1750" infinitive="0"/>
    <reputation>0</reputation>

    <visual>actors\stalker_merc\stalker_merc_2</visual>
    <supplies>
      [spawn]
#include "gameplay\character_gr_primaryweapons_merc_0.xml"
#include "gameplay\character_gr_secondaryweapons_mercenary.xml"
#include "gameplay\character_gr_grenades_mixed.xml"
#include "gameplay\character_gr_medical_mixed.xml"
#include "gameplay\character_gr_food.xml"
#include "gameplay\character_gr_detectors.xml"
     

     
     
    
    
     merc_outfit, prob=0.005 \n




    </supplies>
#include "gameplay\character_criticals_4.xml"
#include "gameplay\character_dialogs.xml"
  </specific_character>


Where #include "gameplay\character_gr_primaryweapons_merc_0.xml" looks like that:

Code: Select all

[spawn_loadout] \n
weapon1 \n
weapon2 \n
weapon3 \n
etc.


Also, there's an order for loading every #include.
Primary weapons are in [spawn_loadout]
Secondary weapons are in [spawn_loadout2]
[spawn_loadout3] only in case of *_medical_mixed.xml
[spawn_loadout4] for detectors.
The .xml containing grenades doesn't use [spawn_loadout(number)]




Happy New Year and hopefully next MOTY in 2017 !

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1371
Joined: 26 May 2012, 22:26

Re: Random Weapon Loadouts

Postby Alundaio » 01 Jan 2017, 08:28

You are missing the \n on [spawn] so in engine it will see [spawn][spawn_loadout] as a single line, which is why it is spawning everything, since it doesn't see [spawn_loadout], it sees [spawn].

Also:
merc_outfit, prob=0.005 \n
won't be in [spawn] section if that is your intention, think of supplies as an INI (ltx). <supplies> is read in as a single string and literally loaded in engine as an INI. This is why the \n (newline) character is necessary. This means your grenades at the bottom of the list won't be considered to be under [supplies] either.


You probably want to do this:

Code: Select all

<supplies>
#include "gameplay\character_gr_primaryweapons_merc_0.xml"
#include "gameplay\character_gr_secondaryweapons_mercenary.xml"
#include "gameplay\character_gr_medical_mixed.xml"
#include "gameplay\character_gr_food.xml"
#include "gameplay\character_gr_detectors.xml"
     [spawn] \n
     merc_outfit, prob=0.005 \n
#include "gameplay\character_gr_grenades_mixed.xml"

</supplies>
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

User avatar
Diegtiarov
Trespasser
Posts: 52
Joined: 12 Nov 2015, 08:34
Contact:

Re: Random Weapon Loadouts

Postby Diegtiarov » 02 Jan 2017, 11:16

Made corrections and I think I've messed something up again. No stalkers spawning at all (in case one spawns he has no items).

I thought it may be caused by too many calls for specific files, so I've replaced the most used ones with items they were containing, but that didn't make any effect.

Now supplies sections look like this (without comments).

Code: Select all

<supplies>

#include "gameplay\character_gr_primaryweapons_merc_0.xml"          <!-- [spawn_loadout] here -->
#include "gameplay\character_gr_secondaryweapons_mercenary.xml"     <!-- [spawn_loadout2] here -->
   [spawn_loadout3] \n
   detector_simple \n
   detector_advanced \n
   detector_elite \n
   [spawn] \n
   grenade_rgd5 = 2, prob=0.25 \n
   grenade_f1 = 2, prob=0.25 \n
   npc_bandage \n
   npc_medkit \n
   npc_medkit_army \n
   npc_medkit_scientic \n
   bread = 3, prob=0.7 \n
   conserva = 3, prob=0.2 \n
   energy_drink = 2, prob=0.2 \n
   kolbasa = 2, prob=0.4 \n
   vodka = 2, prob=0.5 \n





    
    
     merc_outfit, prob=0.005 \n




</supplies>


And gameplay\character_gr_secondaryweapons_mercenary.xml looks like this (primary weapons file also). I didn't put ammo amount because there are 2 packs spawned by default if not added in the file, as you or the changelog said some months ago.

Code: Select all

[spawn_loadout2] \n
wpn_hpsa \n
wpn_beretta \n
wpn_sig220 \n
wpn_usp \n
wpn_walther \n
wpn_colt1911 \n
wpn_desert_eagle \n
wpn_fort \n
wpn_pb \n
wpn_pm \n

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1371
Joined: 26 May 2012, 22:26

Re: Random Weapon Loadouts

Postby Alundaio » 02 Jan 2017, 12:24

I don't see anything wrong with this snippet, maybe you have some syntax issue somewhere.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

User avatar
Diegtiarov
Trespasser
Posts: 52
Joined: 12 Nov 2015, 08:34
Contact:

Re: Random Weapon Loadouts

Postby Diegtiarov » 02 Jan 2017, 15:00

Okay, gonna try with clean files. I will report whether it works or not, later.

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1371
Joined: 26 May 2012, 22:26

Re: Random Weapon Loadouts

Postby Alundaio » 02 Jan 2017, 19:30

okay apparently, you need

section = 1 \n


section \n isn't going to work in the spawn_loadout sections. It will be fixed though.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

User avatar
Diegtiarov
Trespasser
Posts: 52
Joined: 12 Nov 2015, 08:34
Contact:

Re: Random Weapon Loadouts

Postby Diegtiarov » 03 Jan 2017, 10:24

Cool, it works now. :D

Dream came true and now all loadouts can be configured via external files. They will be included in next Gameplay Rebalance addon update in case somebody wants to check this out.

User avatar
Diegtiarov
Trespasser
Posts: 52
Joined: 12 Nov 2015, 08:34
Contact:

Re: Random Weapon Loadouts

Postby Diegtiarov » 06 Jan 2017, 09:40

Well, after adding more than 1 faction it fails out of the blue.

Issues:
- merely NPCs spawn
- main characters do not spawn (traders etc.)
- EVERYTHING works while spawning via debugger's spawner.

I leave the files down there. Just remember to replace these in system.ltx.

Code: Select all

specific_characters_files                = character_desc_general, character_desc_simulation, character_desc_marsh, character_desc_agroprom, character_desc_darkvalley, character_desc_bar, character_desc_escape, character_desc_red_forest, character_desc_yantar, character_desc_military, character_desc_deadcity, character_desc_katacomb, character_desc_zaton, character_desc_pripyat, character_desc_jupiter, character_desc_underpass, character_desc_sarcofag, character_desc_warlab


with

Code: Select all

specific_characters_files                = character_desc_general_gr_loadouts, character_desc_general_gr_duty, character_desc_general_gr_freedom, character_desc_general_gr_bandit, character_desc_general_gr_mercenary, character_desc_general_gr_loner, character_desc_general_gr_military, character_desc_general_gr_monolith, character_desc_general_gr_zombied, character_desc_general_gr_ecolog, character_desc_general_gr_csky, character_desc_general_gr_special, character_desc_marsh, character_desc_agroprom, character_desc_darkvalley, character_desc_bar, character_desc_escape, character_desc_red_forest, character_desc_yantar, character_desc_military, character_desc_deadcity, character_desc_katacomb, character_desc_zaton, character_desc_pripyat, character_desc_jupiter, character_desc_underpass, character_desc_sarcofag, character_desc_warlab



http://www.mediafire.com/file/1pjj73c75zcdq7t/NPCs.7z
You do not have the required permissions to view the files attached to this post.

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1371
Joined: 26 May 2012, 22:26

Re: Random Weapon Loadouts

Postby Alundaio » 06 Jan 2017, 23:08

We'll be doing this for 1.4.23 patch and for Weapon Addons

For our new version character_desc_simulation needs removed from system.ltx

and needs this ai_stalker.script : https://bitbucket.org/revo_lucas/call-o ... ker.script
You do not have the required permissions to view the files attached to this post.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

User avatar
Diegtiarov
Trespasser
Posts: 52
Joined: 12 Nov 2015, 08:34
Contact:

Re: Random Weapon Loadouts

Postby Diegtiarov » 07 Jan 2017, 05:17

I'll be waiting for a new patch then. ;)

User avatar
Diegtiarov
Trespasser
Posts: 52
Joined: 12 Nov 2015, 08:34
Contact:

Re: Random Weapon Loadouts

Postby Diegtiarov » 11 Feb 2017, 17:35

I forgot to add (it just came back to my head now, lol) - were my configs made properly? I mean that if the problem with no stalkers spawning at all was caused by too many calls for loadouts' files or a typo somewhere?

Asking just to avoid the same bug when 1.4.23 comes. :anom:

ChanceTaker
Scavenger
Posts: 1
Joined: 20 Feb 2017, 03:31

Re: Random Weapon Loadouts

Postby ChanceTaker » 21 Feb 2017, 02:07

Diegtirarov wrote:I forgot to add (it just came back to my head now, lol) - were my configs made the Wartrol with https://www.scidacreview.org/wartrol-review-results properly? I mean that if the problem with no stalkers spawning at all was caused by too many calls for loadouts' files or a typo somewhere?

Asking just to avoid the same bug when 1.4.23 comes. :anom:


It's a lot of fund trying out random weapon layouts. Makes things pretty interesting when you have a crappy weapon.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest

cron