I did some Stalker Anomaly modding again.
I modified starting loadouts, now you have no items by default, there's a lot more items to choose from, and you can pick as many of them as you want. Limiting the choices makes sense, but if you've played the game a lot and have self-control, then it's better to have the ability to customize freely.
I've had all my story quests break too many times due to some bug, so I decided to start playing on "azazel mode" instead (special game mode where dying causes you to switch to another NPC instead of getting a game over). I modified the script so the equipment you get are both less predictable and more fair (it used to always give you a silly starting loadout). I also changed which NPC is picked, it now prioritizes NPCs from the same faction, and NPCs that are in adjacent maps. I can't seem to be able to spawn ammo, I'm doing it exactly the same way as in other scripts but it doesn't work, so the only ammo you'll have is the ones in your guns. I'll probably check what you have on you and spawn something similar, I play with Toxic Air so it would be nice to give you a gas mask if you had one previously. If you had an artifact detector, increase the chance of giving the new character a detector too. Give a random backpack that's lower tier than your previous one. Wouldn't have to start completely from 0.
I found the script where enemy loot drops are handled, so I added a filter that downgrades their ammo. Now there's % chance to downgrade to a "weaker" variant (e.g. AP -> FMJ), and another % chance to downgrade from normal to old/broken ammo. Lower ranked NPCs have higher % chance. I'm considering completely overhauling how loot is generated, but I also need to be able to manage stash loot or else it's wasted effort.
---
Following the loot drop stuff, I explored the script where loot stashes are created, but I don't understand how it works. It seems simple at first but then just.. what? It splinters into different directions and the function names don't seem to match what they do. get_random_stash will actually create a stash, it also calls set_random_stash which spawns loot, but there's also a spawn_treasure function which spawns loot and it's called when the stash is opened, but get_random_stash which spawns loot is called when the game starts, so the loot is spawned twice?
It doesn't help that there's a callback "on_game_load", but nowhere is it explained when it gets called. When you start the game? When you start a new run? Every time you load a save? This script creates the stashes from it which implies that it's only called when a new playthrough is started, but based on context in other scripts, it seems to be when you start playing a save but there's a "load_state" callback for that, and in others it seems like when the game is booted but there's a "on_game_start" function which does that.
I tried to look into how quests are generated because I'm tired of there being so many "bring me 8 of this highly specific item that you've never had any of and if you did then you'd want to use it yourself" quests, but jesus christ it's a convoluted mess too.