dynamic faction loadouts depending on progress and other factors

Issue #117 new
strelocc
created an issue

here's the idea, all faction start only with bad equipment (pistols, shotguns) and traders only stock those, and as game progresses (player rank, in game days passed, etc) npc start spawning with better stuff and traders start selling better equipment

player can pay the faction trader (sid for loners, petrenko for duty etc) to "unlock" weapon tiers or categories (maybe gated by number of territory and resource owned, or need to provide X hostile faction patches) before they naturally unlock by progress to give own faction the edge, eg allow new npc to spawn with .45 for better damage or 9x19 smg

after the new weapons are unlocked, npc can spawn with them and appear in faction traders inventories

trader inventories can be easily triggered by buy_supplies functors and custom functions in xr_conditions

i wrote a script (which sometimes leads to crashes i couldnt point out or reproduce consistently yet, needs some review, it's 90% copypaste from unpacked vanilla coc scripts snippets mashed together) that strips npc of their weapons and gives them new ones according to their rank and faction, this makes npc weapons completely indipendent from character_desc.xml and easy to manage via flags, game values etc., with some little tweaks every other loadout resource like medkits/food/etc could be made completely script sided to allow more customization

https://pastebin.com/gQBXpby6

it uses stcop weapon names, didn't implement any game time check yet and only got few things done just to see if the logic behind it works but it should be easy to expand

will try to make a proper full version with all the features i thought for vanilla coc but the "framework" is there if you want to give a look


just read in another issue that you don't plan to do any weapon related stuff because the need to support different weapon packs, using the script above there is no need to redefine the hundreds of npc definitions or generate compatibility version of character_desc.xml, but just to create different sets of arrays for weapon names and theoretically it could even be possible to find on the fly which pack is being used (find a unique weapon for each major pack, check if that weapon section exists) then use that pack rules as loadout logic

or maybe not even have different logics depending on the pack, make one logic using macro categories (eg 9x18 pistols, 9x19 pistols western and slav, sawn off/hunting/military shotguns) and try to fit weapon packs weapons into those generating different macro category arrays by pack and then using the correct one when running the script

now it's mostly words but i'm trying to make a working version of all this stuff for vanilla and might repropose this later

Comments (9)

  1. xarshi repo owner

    The reason I don't want dependence on weapon packs is because AO3 has weapons that STCOP doesn't and both have weapons OWR and vanilla don't have. There are a lot of variables. Realistically, it wouldn't take but an hour or so to smooth out. I just have higher priorities.

    It seems you're handling it pretty well, if you're willing to make a version that works for ALL weapon packs, I will gladly include it with warfare. Although to be honest I may just begin modifying yours for use anyways because I have a custom weapon pack I use where I need to add a bunch of new weapons to NPCs which is tedious as fuck.

  2. strelocc reporter

    i'd advise against using my script as it is now because i found out it eventually leads to crashes that i can't even reproduce consistently, let alone find out why happen and fix, see here http://forum.epicstalker.com/viewtopic.php?f=32&t=728

    i suspect the problem is related to the weapon stripping procedure that messes up the "which of weapons i currently have is the best" npc logic, as last resort i can just empty <supplies> parts in the xml, that would prevent upgrading of already spawned stalkers without causing on long games to have npc drop dozens of weapons

  3. xarshi repo owner

    I was using a random weapon script I had made for a weapon pack I threw together a bit back. I'll dig it out, dust it off, and post it. Worked pretty well.

  4. Log in to comment