ok, so there are a few misconceptions about my mods function and integration here. so im going to try and address them one by one. please feel free to correct me if i didn't understand what you were saying when i try to address things, as i am very tired and dont function the best well tired.
the fact that it requires to jump through extra hoops to add a commodity reskin
I suppose it does require one to jump a few hops, to add the library, and read the documentation and what not. but i fail to see how i could make it simpler. but i would be willing to hear any suggestions to have on ways i could make it more accessible.
it works only for crew
crew replacer works for any commodity I can get my grabby little hands on, in any event i can find a way to edit. not just for crew. the name 'crew replacer' is kind of a relic from when i was first developing the mod, as back then my primary objective was to have it effect crew. i didn't know at the time how simple it would be to replace every commodity with crew replacers functionality.
it doesn't address the fundamental cause for it's existence, rather it does a roundabout shenanigans to "catch" the crew consumption event and process it with alternative commodity
this is not correct, but i understand your confusion, given the name
crew replacer does not simply swap one commodity for another. rather, it replaces the commodity for a something i call a 'job' (please note: each events commodity has its own 'job', so one can customize things more) (a 'job' is basically just a list of commodity's (although they can be other things. but that's something i would need to create a tutorial for), and how good they are at replacing the replaced commodity at this task). it uses the combined 'power' of everything in said 'job' when deterring how mush of the replaced commodity you have, and running through a complicated equation to determine what is lost, and in what numbers.
how losses are calculated (copied from a post on AI-Retrofits from like a year ago or something. some info here is out of date (I think i describe priority backwards, for example) but it explains how losses work well))
Order of losses for drones vs humans
order of losses is kind of complicated, and the current version might have the priority set wrong. so here how it should work though:
first crew replacer gets the crew a job wants, so if it wants 45 crew to salvage something, and you have 300 'crew' and 40 'salvage robots',
it will look at the priority for both ('crew' = 10 and 'salvage robots' = 9) and try to get the 'required crew' in order of best priority to worst.
(so 40 'salvage robots' and 5 'crew')
if you had more 'salvage robots' then 'required crew', it would only call 'salvage robots'.
if 'crew' had a lower priority then 'savage robots', it would call 'crew' first, and because there is more 'crew' then 'required crew', it would call only 'crew'.
if 'crew' and 'salvage robots' had the same priority, it would try to get random 'crew' and 'salvage robots' using some math that acts like all the available crews were picking straws.
now how this relates to crew losses:
when calculating crew losses, the code looks at the crew used in a job example: (40 'salvage robots' and 5 'crew') then randomly try's to get crew losses using the 'drawing straws' math thing, using crew used in the job as who draws the straws. so in this case, it would be 8X more likely to loss a 'salvage robot' then a 'crew' (there is 8x more 'salvage robots' then 'crew'), but it would still be random, if that makes sense. so there is a change that you would lose all 5 'crew' anyways. or would lose only 'salvage robots', even if you were set to lose 40 crew.
both the loses and crew for job functions are also effected by something called power. think of it as a multiplier for how mush each unit is work in calculations. but 'salvage drones' and 'crew' have the same power, so it dose not matter here.
way too complicated solution for a simple issue that i would deem unsolvable otherwise.
again, i try to keep things as simple as possible one can for example, add a 'crew' to a 'job' (or to all 'jobs' that replace a certain commodity) with a single line of code.
example i gave someone else
in the 'onApplicationLoad()' function
'crewReplacer_Main.getJob("job name goes here").addNewCrew("the commodity id of you crew",power,defence,priority);'
what all the stats do
"job name goes here" is the jobID that you want this crew to do. i have a list of them somewere ask me about it.
"the commodity id of you crew" is the commodityID of your crew. this should be a thing after step 1.
power is how strong your crew is. 1 is the default.
defence is how many losses your crew tends to take. the default is 1.
priority is what order your crew is used in. higher numbers go first. the default is 10
i am apprehensive to tie my own mod to it, despite it fulfilling a crucial feature that i need, simply because i don't want to deal with issues i cannot understand
I can understand this, as its always a risk. crew replacer is inherently difficult to test and make function at all (on my end. i make sure users of crew replacer can do things as easily as possible (although who knows if i succeed.)) do to the fact that i as a modder cant access all the base games code. making it extremely difficult to replace some events code.
if you ever decide that you want to utilize crew replacer, but don't want to make it a 'dependency' you can do the following:
1) create a class and make all your crew replacer code run there.
2) were ever you would put your 'crew replacer' code, run if(Global.getSettings().getModManager().isModEnabled("aaacrew_replacer")){ class.function()}
this should make it so you can have whatever crew replacer jobs you want if crew replacer is enabled, and should prevent crashes from missing a imported class (provided crew replacer is only called in this class)
(if you try this and doing so causes a crash when crew replacer is not installed, I might have misremembered. send me a message and i will amend my words)
ok, i think i addressed everything i saw here. I hope im not missing the point though. I also hope my words were understandable. i can struggle to exsplain myself sometimes.
have yourself a good day