Fractal Softworks Forum

Starsector => Mods => Topic started by: alaricdragon on March 10, 2022, 02:23:00 PM

Title: [0.97a] Crew Replacer
Post by: alaricdragon on March 10, 2022, 02:23:00 PM
Crew Replacer v0.7
an modders utility library thing.
have you ever wanted to create a mod, were you had 'mega salvage rigs' to perform salvage jobs instead of 'crew'? have you every wanted to stop using 'marine's' and start using 'heavy titan walkers' when raiding a world? have you ever wanted to do away with 'heavy machinery' when salvaging, and instead use your newly modded in 'salvage equipment'? maybe you wanted to create a task in one for your mods, were other modders could set things to be consumed in said task but thought 'why bother'? maybe you wanted to have an diverse ground army when attacking an world? but could never find a way to mod that into the game easily and quickly?
well now you can. with CREW REPLACER!

what is Crew Replacer?
Crew Replacer is a mod library built with one goal in mind: to make it easy and quick to mod in new items to be used in jobs. crew replacer lets multiple modders modify the same tasks, by adding a system that lets a modder add an 'crew'(really any type of commodity) to an 'job'. were said 'job's replace all the instances of crew i could find in code.

but what dose that mean? it means that modders now have a system to to change what is used/required when the one tries to 'salvage' or 'survey' or 'raid'. it also means that modders have a system to add new jobs into the game, then let other modders change what is used/required in said task.

still dont understand? feel free to ask me questions. and i will do my best to explain.

Compatibility:
Spoiler
not compatible with anything that changes:
Spoiler
plugins:
   SurveyPluginImpl
rules.csv:
   sal_showRatingAndCost
   sal_optionCheckAccidents
   sal_salvageOptionSelected
   sal_scavengeDebris
   sal_forceRecoveryOptSel
   sal_demolishOptionConfirmed

   marketHostileRaidSel
   marketHostileRaidNonMarket
   marketHostileRaidValuableSel
   marketHostileRaidDisruptSel
   marketHostileRaidConfirmSel
[close]
known incompatible mods and there patches (if they have one)
Spoiler
[close]
[close]
Download (https://github.com/Alaricdragon/Crew_Replacer/archive/refs/heads/master.zip)

how to use the mod (for modders.)
look at the documentation https://github.com/Alaricdragon/Crew_Replacer/tree/master/jars/src/desing/documentationurl (https://github.com/Alaricdragon/Crew_Replacer/tree/master/jars/src/desing/documentation)
available 'basic' Jobs in the this mod:
NOTICE: the tutorial / documentation below is a little outdated. im going to make a new one in a while. like the things here work, but its very incomplete.
(note: an Task is not a Job. only an Job is an Jobs)
Job ID's are in quotes. example: Job:"this is an job ID"
Spoiler
Note: quests have not had there requirements modified because I don't want spoilers when I do them. feel free to make your own add-ons that change quest items.

Task:survey(done)
Spoiler
-there is a possibility of a issue in wish the code calls on getXP from the survey pluggin, then you loss some supplys. but hopefully i succeeded in minimizing that possibility hopefully
Job:"survey_crew"(done)
Job:"survey_supply"(done)
 -crew added to the supply_job are not consumed when they should be.
 -the only way i can make then consumed, is if i make it happen every time someone mouses over a planet. and thats a no go for me thanks
 -this dose not effect normal supply.
Job:"survey_heavy_machinery"(done)
[close]
Task:salvage(done/tested)
Spoiler
-DONE in theory. might have a bug or 50, but i simply don't know for sure. i think its working though
Job:"salvage_crew"(done)
Job:"salvage_heavyMachinery"(done)
[close]
Task:raiding(done/tested)
Spoiler
-DONE in theory.
Job:"raiding_marines"(done)
[close]
task: steal a starship mission (done/tested)
Spoiler
functional
job:"Mission_hijack_marines"(done)
[close]
task: repair Coronal HyperShunt (functional/display not yet working)
Spoiler
Almost done, it works, but the display is not respecting me
job:"CoronalHyperShunt_repair_Metals"(done)
job:"CoronalHyperShunt_repair_RareMetals"(done)
job:"CoronalHyperShunt_repair_Crew"(done)
[close]
[close]
for adding crew (basic):
Spoiler
how to get crewReplacer_Job:
Spoiler
crewReplacer_Main.getJob(String job)
   returns: an crewReplacer_Job with the same name. or creates one if none exists.
   job: is an ID that you wish for this job to have. most be no other jobs with this ID.
[close]
how to add a 'crew' to a 'job':
Spoiler
crewReplacer_Job.addNewCrew(String crew,float crewPower,float crewDefence,float crewPriority);
crew:
   is the ID of the commodity that you want to add to this job.
   there can only be one instance of an name in each job. make sure its something distentct.
crewPower:
  is the multiplier to the number of 'crew' already in the fleet. so if you have 10 of this item with a crew power of 2, the game will treat it as though there are 20 of this 'crew' in this fleet.
  default value is 1.
crewDefence:
  is the multiplier to the amount of defense per crew in fleet. so if you were set to lose 10 of this crew, and your crew had 2 crew power, you would only loess 5 crew instead (10 / 2)
  default value is 1.
crewPriority:
  is the order in wish the 'crew' will be used in a job. smaller numbers go first in a job.
  default value is 10.

you can also run:
crewReplacer_Job.addCrew(crewReplacer_Crew crew);
however, you must set crew.name first.
this method is only recommended if you plan on creating your own crewReplacer_Crew class.

crewReplacer_Job.organizePriority();
you MUST run this code after doing adding/changing any crew in a crewReplacer_Job. things WILL GO BAD otherwize.

[close]
[close]
for adding/running jobs (basic):
Spoiler
how to create a new job:
Spoiler
crewReplacer_Main.getJob(String job)
   returns: an crewReplacer_Job with the same name. or creates one if none exists.
   job: is an ID that you wish for this job to have. most be no other jobs with this ID.

crewReplacer_Main.addOrMergeJob(crewReplacer_Job job);
   you can also run this command. however, this is for people who want to create there own crewReplacer_Job class.
   make sure to set your job.name first.
[close]
when running job data there is 3 commands you need to know:
to get available crew power:
Spoiler
crewReplacer_Job.getAvailableCrewPower(CargoAPI cargo)
   returns: (float) the availableCrew * crewPower in this cargo
   cargo: is the cargothat you want to get crew from.
[close]
to display available crew for this job:
   
Spoiler
crewReplacer_Job.displayCrewAvailable(CargoAPI cargo,TextPanelAPI text)
   displays all the crew in the fleet to the inputted TextPanelAPI
   cargo: is the cargo that you want to get crew from.
   text: is the TextPanelAPI you want to display to
[close]
to apply and display crew losses for this job:
   
Spoiler
crewReplacer_Job.automaticlyGetDisplayAndApplyCrewLost(CargoAPI cargo,int crewPowerRequired, float crew_power_to_lose,TextPanelAPI text)
   removes crew from the fleet, and displays how mush crew was lost to the inputed TextPanelAPI
   cargo: is the cargothat you want to get crew from.
   crewPowerRequired: an float that should be equal to the required amount of crew to complete this job.
   crew_power_to_lose: the number of crew you want to remove from this fleet. should never be more then crewPowerRequired.
   text: is the TextPanelAPI you want to display to
[close]
[close]
Changelog
Spoiler
V0.7:
    save compatible with v0.6.2+
    added the following classes and variables:
        crewReplacer_Job:
            public float loadPriority;
            public ArrayList<CrewReplacer_BlackListCrew> blackListCrews = new ArrayList<>();
            public boolean addBlackListCrew(String crew,float loadPriority)
            public CrewReplacer_BlackListCrew getBlackListCrewIfExists(String crew)
            public boolean removeBlackListCrew(String crew)
            protected boolean addBlackListCrew(CrewReplacer_BlackListCrew EC)
        crewReplacer_CrewSet:
            public ArrayList<CrewReplacer_BlackListCrew> blackListCrews = new ArrayList<>();
            public boolean addBlackListCrew(String crew,float loadPriority)
            public CrewReplacer_BlackListCrew getBlackListCrewIfExists(String crew)
            public boolean removeBlackListCrew(String crew)
            protected boolean addBlackListCrew(CrewReplacer_BlackListCrew EC)
            public crewReplacer_CrewSet getAllLinkedCrewsSets()
            getAllLinkedCrewsSets(int maxDepthForGathering)
        crewReplacer_Main:
            static public boolean addOrMergeJob(crewReplacer_Job job, float loadPriority)
    changes:
        crewReplacer_Job.addNewCrew now runs addCrew.
        made crewReplacer_Job.addCrew and crewReplacer_CrewSet.addCrew respect blacklist.
    removed:
        crewReplacer_Job:
            mergeCrew
        crewReplacer_CrewSet:
            mergeCrew
    fixes:
        made crewReplacer_Job.applyCrewSets() get all the inherent crew sets form its crew sets like it was suppose to.
        added some crash protection onto some variable bits of code that related to getting strings.
    readme:
        updated the readme with info on the blacklist system, and on the crewSet system
    mod compatibility:
        added some random mod compatibility for forge production. crew replacer now supports its mothership quest
V0.6.10:
    save compatible with v0.6.2+
    fixes:
        fixed a issue were 'metals' might have been a valid commodity for founding a colonly provided market retrofits was not installed. sorry
V0.6.9:
    save compatible with v0.6.2+
    fixes:
        fixed spam in the starsector logs every time crew replacer did anything (sorry)
        fixed logs failing to name there crewReplacer_Job and crewReplacer_Crew. as well as some other things probably.
V0.6.8:
    save compatible with v0.6.2+
    fixed broken combatability and crashes with Perilous Expanse
V0.6.7:
    save compatible with v0.6.2+
    updated to the latest starsector version
    fixed some a broken button from the last alpha release.

V0.6.6: (the never released alpha)
    save compatible with v0.6.2+
    changes:
        updated the following plugins to (hopefully) be easyer to keep up to date.
        please note: this might cause unknown issues. i did all i can to keep things stable, but crew replacer might have some growing pains for a bit.
        -survey Plugin.
        -salvage plugin

        updated the strings from (hopefully) every none log instance in the game to be in the config, so i can change them and spellcheck them because i suck
        -also did this for some of the logs. mainly, the crewReplacer_Job logs, and the crewReplacer_CrewSet logs.
    fixed:
        fixed a possible issue were it might have been possible to remove items from players inventory because it was thought that you colonized somewhere.

V0.6.5:
    save compatible with v0.6.2+
    new:
        (hopefully) added working version checker support
        added colonization suooprt. you can now add new commodities that will be used in place of crew, supplies, and heavy machinery when colonizing.
            -NOTE: this will not work when using market retrofits until i patch it. hopefully i can do that soon.
    fixes:
        fixed the issue of items: apearing on top of each other, not being were they look like, and grabbing items that were not the ones you meant to pick up.
        it was me. 100%. sorry guys. I had no clue it was me, but some in depth investigation proved it 100%. and thank you so very mush to the person who suggested the CargoScreenListener. it was something i desperately needed.
        PS: this does create a slight issue were survey data apears at the 4th empty sloot, (and likely some other items at random. anything you didnt put there by opening your cargo basicly. but only if you looked at a not surveyed world after you last opened your cargo bay, and -then- had items inputted. no clue how to fix this send help.), but that is nothing compared to the beep bop beep that was happing before.

        maybe fixed a issue were sometimes surveying would use 2x the supply? i hope that was not a thing though.
    changes:
        disabled the endless spam of 'preparing to removing items for survey....(from crew replacer.)' in the logs. now off by default.
        crewReplacer_Job:
            addCrew(crewReplacer_Crew crew) now compleatly replaces the old crew. instead of whatever it was doing before.
            (NOTE: other instances of addCrew still use merge crew when 2 of the same crew show up, maintaining whatever strange class they might have.)

            added a 'loadPriority' variable to most add instances of addCrew
            added a new addCrew that has a default 'loadPriority' of zero.
        crewReplacer_Crew:
            added the 'public float crewLoadPriority = 0;' variable.
                -crew will only replace other crew in a job provided there load priority is >= to the old crew.
        reasoning:
            the reason i added the 'crewLoadPrioirity' system is because before if a user wanted to override someone elses crew,
            they would have to load there mod after that persons, and that... did not seem right. at all.
            hopefully this help avoid some headache

V0.6.4.1:
    save compatible with v0.6.2+
    fixes:
        refactored the name of one, and only one, file in the inter code.
V0.6.4:
    save compatible with v0.6.2+
    fixes:
        fixed the survey plugging only being able to reduce the amount of crews visable, and not provide you with the amount of crew you have available.
        finaly.
        i wanted to do this since i created this mod. i win
v0.6.3:
    save compatible with v0.6.2+
    mod compatibility:
        added compatibility with 'nomadic survival'. tested and found no bugs. enjoy.
    documentation:
        added the missing documentation from the last update.
    settings:
        added a setting to activate nomadic survival logs.
v0.6.2:
    updated to 0.96a
    mod compatibility:
        still not done
    fixes:
        fixed a missing log in crewReplacer_Job.getCrewDisplayNames(CargoAPI)
    new functions: (NOTE add this to documentation).
        crewReplacer_crew:
            getCargoSpaceUse(CargoAPI cargo,float amountOfCrew)
            getCargoSpaceUse(CargoAPI cargo)
            getCargoSpacePerItem(CargoAPI cargo)
            getFuelSpacePerItem(CargoAPI cargo)
            getFuelSpaceUse(CargoAPI cargo,float amountOfCrew)
            getFuelSpaceUse(CargoAPI cargo)
            getCrewSpacePerItem(CargoAPI cargo)
            getCrewSpaceUse(CargoAPI cargo,float amountOfCrew)
            getCrewSpaceUse(CargoAPI cargo)
        crewReplacer_job:
            getCargoSpaceUsed(CargoAPI cargo,String cargoType)
            getCargoSpaceRange(CargoAPI cargo,float power,boolean includeDefence,String cargoType)
    background:
        added a better way to organize arrays. that's untested, because i needed to update this....
v0.6.1:
    save compatible with V0.5+
    IMPORTANT:
        if you downloaded the V0.6 that was available, download this instead. at least if you use normadic suvival. i thought it worked but i found GAME BREAKING bug sorry 5 mins after i posted sorry =(
v0.6:
    save compatible with V0.5+
    mod combatability:
        now fully compatible with normadicSurvival. feel free to mod in new crews for the -many- jobs available.
    changes:
        disabled most console logs be default
    new:
        added a bunch of new crew sets for all already created jobs. will improve on that latter.

        new functions:
            crewReplacer_Job:
                boolean hasCrew(String crew)

                boolean addCrewSet(String jobSet)
                boolean removeCrewSet(String jobSet)
                void applyCrewSets()
            crewReplacer_Main:
                crewReplacer_crewSet getCrewSet(String crewSet)
                boolean removeCrewSet(String crewSet)
                boolean addOrMergeCrewSet(crewReplacer_crewSet crewSet)
        new classes:
            crewReplacer_crewSet.
                -a 'crew set' represents a set of crews, that are all replaceing the same commodity in the base game.
                example: the commodity 'crew' is used in salvaging, surveying, and repairing hyper realys.
                adding a Crew to the crew set 'crew' would add that Crew to all jobs that replaced the commodity 'crew'.
    fixes:
        fixed a bug that might have been letting 'crew' steel starships? opps?
v0.5.1:
    save compatible with V0.5+
    documentation:
        finished the main part of the documentation for now.
    fixes:
        fixed crew defence not being set right on initialization.
v0.5:
    should be save compatible with V0.4+.
    background work:
        raids and marines:
            raid plugin things. see fixes
        started to do battle with the survey code. its making ghost sounds at me.
    fixes:
        made it so crewReplacer_Job.displayCrewAvailable() does not display crew available if you have none of said type of crew.
        made it so marine XP only effects marines.
        changed the way marines are removed again. hopefully it works this time.
        made it so raids can comprehend the fact that you did not deploy every force you had

        enabled 'marketHostileRaidConfirmContSel', 'marketHostileRaidResultSel' in my rules.csv maybe fixing a crash on raid non market
        -NOTE: its possable this fix failed. if someone notices the game giving a null point exception when you raid objectives somehow, plz tell meplz tell me.
    new:
        added 6 new function to crewReplacer_Job:
            applyExtraDataToCrew();
            applyExtraDataToCrew(Object newData);
            applyExtraDataToCrewAndJob(Object newData);
            resetExtraDataToCrews();
            resetExtraDataToCrewsAndJob();

            public boolean addNewCrew(String crew,float crewPower,float crewDefence,float crewPriority)
        added 5 new function to crewReplacer_Crew:
            resetExtraData();
            setExtraData(Object newData);

            displayCrewAvailable(CargoAPI cargo, float numberOfItems, TextPanelAPI text)
            displayCrewLost(CargoAPI cargo, float numberOfItems, TextPanelAPI text)

            public float getCrewDefence(CargoAPI cargo)
        added a new variable to both crewReplacer_Crew and crewReplacer_Job:
            public Object ExtraData;

        added a new variable to crewReplacer_Crew:
            public float crewDefence = 1;
        explanation:
            sometimes, one wants to send / process some random data to crews or jobs. this was hard before, but now its simple.
            this is currently used in the raid plugin for marines to get XP. will be explained farther when i update the documentation
        explanation 2:
            displayCrewNumbers was a effective way to display crew, but it needed to be split into two for modability sake. something i forgot to do earlier.
        explanation 3:
            i find myself wanting to have differences between crew ability to do a job, and how many losses they receive and the weight of said losses. this is the best way i think.
    changes:
        marine in raiding:
            made it so the marine displays its XP and related bonuses on it, instead of on the inter ground combat force.
        file names:
            changed the 'crew' and 'marine' files to 'CrewReplacer_CrewType_crew' and 'CrewReplacer_CrewType_marine' resepctively
        job data handling:
            made it so crew use there defence when handling crew losses, not there power. should be no difference so long as power and defence are the same
        other:
            made 'static ArrayList<crewReplacer_Job> Jobs' in 'crewReplacer_Main' 'private'
v0.4.3:
    save compatible with V0.4+
    fixes:
        fixed a missing crewReplacerRefrence on line 1139 in CrewReplacerMarketCMD.getMarineLossesStat(List<GroundRaidObjectivePlugin> data), that was getting marrines instead of crew
    changes:
        changed how marines are removed from a fleet. should change nothing.
        changed two lines of dialog in the raid plugin, to hopefully avoid confusion between ground troops and ground support ability.
    changed the following functions:
        crewReplacer_Crew:
            DisplayedCrewNumbers(float,TextPanelAPI) -> DisplayedCrewNumbers(CargoAPI,float,TextPanelAPI)
            getDisplayName()                         -> getDisplayName(CargoAPI)
            getCrewIcon()                            -> getCrewIcon(CargoAPI)
            getCrewPower()                           -> getCrewPower(CargoAPI)
        crewReplacer_Job:
            getCrewLost(ArrayList<Float>,float)             -> getCrewLost(CargoAPI,ArrayList<Float>, float)
            getCrewDisplayNames()                           -> getCrewDisplayNames(CargoAPI cargo)
            displayCrewLost(ArrayList<Float>, TextPanelAPI) -> displayCrewLost(CargoAPI,ArrayList<Float>, TextPanelAPI)
        reasoning:
            it was difficult before to have more dynamic custom stats and names for crew.
            routing cargo through everything in crewReplacer_Crew (and by requirements, some things in crewReplacer_Job),
            a user will be able to get anything from fleet to faction to other things in cargo, allowing more interesting crew options.
        NOTICE: anybody that uses any of the changed functions should look into updating there code, as it is now outdated. sorry.
    more prep work on the raiding plugin. its confusing.
v0.4.2:
save compatible with V0.4+
    fixes:
        fixed a bug that caused the player to lose 2X the marines from rading.
    changes:
        changed the name of CrewReplacerLog to CrewReplacer_Log to match the rest of my code.
    the following functions were added. they are now considered the primary form of said functions
        crewReplacer_Job:
            getAvailableCrewPower(CargoAPI cargo)
            getAvailableCrew(CargoAPI cargo)
            automaticlyGetDisplayAndApplyCrewLost(CargoAPI cargo,int crewPowerRequired, float crew_power_to_lose,TextPanelAPI text)
            automaticlyGetAndApplyCrewLost(CargoAPI cargo, int crewPowerRequired, float crew_power_to_lose)
            applyCrewLost(ArrayList<Float> crewLost,CargoAPI cargo)
            getCrewForJob(CargoAPI cargo, float crewPowerRequired)
            displayCrewAvailable(CargoAPI cargo,TextPanelAPI text)

        crewReplacer_Crew: the following function were added
            removeCrew(CargoAPI cargo,float CrewToLost)
            getCrewInFleet(CampaignFleetAPI fleet)
            getCrewPowerInFleet(CampaignFleetAPI fleet)

        the reason said functions were added, is because i realized that making a moder input a fleet just to get cargo is a pointless.
        the old functions (that are the same, just they get CampaignFleetAPI instead of CargoAPI) will remain. they will simply run the new functions from them, so no change to your code is required, unless you are overwriting parts of a crewReplacer_Job, or a crewReplacer_Crew

    prep work:
        started to prepare my code for a rework of large parts of the raid plugging, to fix many issues
        started to prepare my code for more improvements and customization to crewReplacer_Job and crewReplacer_Crew
v0.4.1
    save compatible with V0.4+
    polish
        -made the 'repair Coronal Hyper Shunt' jobs display respect crew replacer.
    improvements
        -added a way to use Starsector's fancy display rules thing with crew replacer jobs. its called CrewReplacer_showResCost.

    crewReplacer crew:
        added 3 more functions:
        -getDisplayName()
        -getCrewIcon()
        for use when you want to have a crew that is not a commodity, and dont want to rebuild the inter display to do it,
        you can now simply override both functions, and everything will work
        -getCrewPower()
        a better way to set a non static power for your crew.

    crewReplacer Job:
        added 1 more function:
        getCrewDisplayNames()
        (the old getCrewNames) gets the crew name stats (that double as a ID). not the display name
    debugging:
        added a option to display logs of everything crew replacer is doing, for debugging. turn it on/off in the config file.
    error handling:
        added a bunch of error handling. it will output tot he log when a issue is detected, and help prevent crashes.
V0.4
    -new jobs:
        task: steal a starship mission
            job name:                               replaces
            Mission_hijack_marines:                 marines
        task: repair Coronal HyperShunt
            job name:                               replaces
            CoronalHyperShunt_repair_Metals:        metals
            CoronalHyperShunt_repair_RareMetals:    rare_metals
            CoronalHyperShunt_repair_Crew:          crew
    -issues:
        steal a starship mission has no feedback on what crews can do a mission. will be fixed later
        repair Coronal HyperShunt's fancy looking display that shows what is available/required dose not respect crew replacer yet. will be fixed in a week or so
V0.3.4
    -fixes:
        fixed supplyDemandChange crashing the game because of bad code when supply change was ran.
         -this is no longer functional. my update broke everything about this. expect this to be moved into an diffrent project when it is fixed.
v0.3.3
made crewReplace_Job.organizePrioirty(); public (thanks for the bug reports)
made marines in the job "raiding_marines" correctly have the right crew priority.
V0.3.2
(thanks Histidine, the person who added this change) improved display of crew lost with little pictures of items and colored numbers. it looks like the rest of the game now =)
v0.3.1
fixed an indexing bug that caused issues that i missed
v0.3
 updated crewReplacer_Job
  -fixed an bug were crewReplacer_Job could not select crew randomly when they were the same priority.
  -optimized some random things.
  -made it so when displaying crew, it displays an integer, and not an float.
 crewReplacer_Crew
  -i forgot to keep track of what i did, but i think i added an function or three to this. or maybe not. please don't judge me.
 added an new thing called supply demand class
  -this is nothing specials, that's to say, you could do this on your own without crew replacer, but it fits here well, and its not big enough for its own project.
  -supply demand class is an collection of functions and data that makes it a little easier to edit an industry's supply and demand without having to override said industry. it might be moved to its own project someday, but for now its going to sit here, as something useful, but not really needed that mush.
v0.2
 updates crewReplacer_Crew.DisplayedCrewNumbers
  -added the starsector function "getAOrAnFor()" to the default display (thanks anonymous user.)
  -made the code properly display commodity name, as apposed to its ID.
v0.1:
 release
[close]
Title: Re: [0.95.1a] Crew Replacer
Post by: Omnicast on March 10, 2022, 02:40:13 PM
Wait wait wait... so are you telling me we can Titanfall some poor hapless farming colony now? Drop pod deadly Elvish Blade Singers upon the annoying pain in the ass Hegemony? Flood a Luddic world with Rabid Furries? Unleash a tide of mechanical horrors that is the Necrons? Deploy an army of clones?! Horatio clones... or maybe Clone Troopers. I am right to assume this mod enables all this and MORE?!

Wait... couldn't the mods that introduce these units also have buildings that manufacture/grow/breed them?!

ZERGS! Xenomorphs! Sentinels! Power Armor! Terminators!

I can't wait for modders to go crazy with this library.
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 10, 2022, 02:44:10 PM
Wait wait wait... so are you telling me we can Titanfall some poor hapless farming colony now? Drop pod deadly Elvish Blade Singers upon the annoying pain in the ass Hegemony? Flood a Luddic world with Rabid Furries? Unleash a tide of mechanical horrors that is the Necrons? Deploy an army of clones?! Horatio clones... or maybe Republic clones. I am right to assume this mod enables all this and MORE?!

Wait... couldn't the mods that introduce these units also have buildings that manufacture/grow/breed them?!

ZERGS! Xenomorphs! Sentinels! Power Armor! Terminators!

I can't wait for modders to go crazy with this library.
now you understand. the universe is at our fingertips and we (the modders) shall be the gods of this new world. I hope the modding community enjoy this as well =)
Title: Re: [0.95.1a] Crew Replacer
Post by: Omnicast on March 10, 2022, 02:51:06 PM
I forgot dragons... someone mod in dragons. It's Necessary!
Title: Re: [0.95.1a] Crew Replacer
Post by: Kakroom on March 10, 2022, 04:59:08 PM
Wait wait wait... so are you telling me we can Titanfall some poor hapless farming colony now? Drop pod deadly Elvish Blade Singers upon the annoying pain in the ass Hegemony? Flood a Luddic world with Rabid Furries? Unleash a tide of mechanical horrors that is the Necrons? Deploy an army of clones?! Horatio clones... or maybe Clone Troopers. I am right to assume this mod enables all this and MORE?!

Wait... couldn't the mods that introduce these units also have buildings that manufacture/grow/breed them?!

Dad i need it
Title: Re: [0.95.1a] Crew Replacer
Post by: briansd9 on March 10, 2022, 05:33:53 PM
Not compatible with Nexerelin? But almost everyone will have it...

Would it be possible to include the compatibility patch in the main mod, instead of requiring a separate download? Many mods do stuff like this:
Code
if (Global.getSettings().getModManager().isModEnabled("nexerelin")) {
  /* your code here */
}

Title: Re: [0.95.1a] Crew Replacer
Post by: AppleMarineXX on March 10, 2022, 06:56:32 PM
Does this mod allow the replacement objects to be "better" than the default objects?

For example, could I make a custom Super-Soldier commodity that acts as 10 marines at once?
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 10, 2022, 08:07:20 PM
Does this mod allow the replacement objects to be "better" than the default objects?

For example, could I make a custom Super-Soldier commodity that acts as 10 marines at once?
yes. that is what 'crew power' dose. the default crew power is 1, so if you set your Super-Soldier to have 10 crew power when you make it, it will be worth 10 marines.
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 10, 2022, 08:22:43 PM
Not compatible with Nexerelin? But almost everyone will have it...

Would it be possible to include the compatibility patch in the main mod, instead of requiring a separate download? Many mods do stuff like this:
Code
if (Global.getSettings().getModManager().isModEnabled("nexerelin")) {
  /* your code here */
}

I have no idea at all if this will work in this case, as my compatibility patch functions by extending Nexerelin's custom marketCMD that it has, well my mod works by extending the default marketCMD. and I am unsure how to merge the two classes, without having to update every time Nexerline dose. regardless, ill give it a try sometime. but probably not right now.
Title: Re: [0.95.1a] Crew Replacer
Post by: Liral on March 11, 2022, 01:05:59 PM
Does Crew Replacer extend to ships?  For example, could the Salvage Rig replace (or be required alongside) Heavy Equipment when salvaging derelict stuff, and can this mod add new requirements to actions that previously did not require them; e.g., requiring Heavy Equipment or Salvage Rigs to recover derelict ships?
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 11, 2022, 07:43:18 PM
Does Crew Replacer extend to ships?  For example, could the Salvage Rig replace (or be required alongside) Heavy Equipment when salvaging derelict stuff, and can this mod add new requirements to actions that previously did not require them; e.g., requiring Heavy Equipment or Salvage Rigs to recover derelict ships?
yes to your first question. you can make an class that extends crewReplacer_Crew and overwrite the removeCrew, getCrewInFleet, and DisplayedCrewNumbers function. then add that to a crewReplacer_Job. you can then put your custom code into said functions, to make it so a ship can be used. or do anything truely. 'extends' and 'overwrite' is kinda like magic. (just started to learn about them a week ago sorry for nerding out about them)

regarding your second question, no. crew replacer cannot add new requirements. it was never built with such an idea in mind.
it is built with the idea that someone would want to replace its scripts in mind though. so if you are feeling crazy you can always try to make your own mod that changes salvage to have new requirements.
Title: Re: [0.95.1a] Crew Replacer
Post by: SonnaBanana on March 11, 2022, 09:40:30 PM
You are a genius, I salute you.
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 11, 2022, 10:04:53 PM
You are a genius, I salute you.
*Salutes you back* just doing my duty for the modding community
(Thanks for the complement though. Complements on my things make me happy :))
Title: Re: [0.95.1a] Crew Replacer
Post by: Thaago on March 12, 2022, 03:46:50 PM
Huh, cool extension of capabilities! Nice idea to make this a library for the community.
Title: Re: [0.95.1a] Crew Replacer
Post by: Kat Tsun on March 19, 2022, 04:44:15 AM
based

finally i have a use for this (https://www.dropbox.com/s/60j6o31stg3oixs/CELE_crewcl.png?raw=1)
Title: Re: [0.95.1a] Crew Replacer
Post by: XeroNecross on March 19, 2022, 10:25:19 AM
I can't wait to learn to mod like ya'll can. I am still learning basics before I get into Java or Python... but one of these days. Skyrim had peaked my interest in modding, but StarSector has actually made me go out of my way to start learning this stuff and the more you guys make the more excited I get to learn! I'm literally only learning coding because of this game and the mods ya'll make -_-
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 22, 2022, 02:53:09 PM
based

finally i have a use for this (https://www.dropbox.com/s/60j6o31stg3oixs/CELE_crewcl.png?raw=1)

cant wait to see what 'this' is used for =)
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 22, 2022, 02:56:02 PM
I can't wait to learn to mod like ya'll can. I am still learning basics before I get into Java or Python... but one of these days. Skyrim had peaked my interest in modding, but StarSector has actually made me go out of my way to start learning this stuff and the more you guys make the more excited I get to learn! I'm literally only learning coding because of this game and the mods ya'll make -_-

Well im glad your enjoying the mods the community makes and that it inspired you, and i do wish you luck on your future coding/moding projects =)
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 22, 2022, 02:56:30 PM
Huh, cool extension of capabilities! Nice idea to make this a library for the community.

thanks =)
Title: Re: [0.95.1a] Crew Replacer
Post by: Sunnyko on April 02, 2022, 06:29:57 PM
Is it possible to make like a generic crew replacement, that can.... say crew ships without being "crew" for if you wanted to give a faction its own unique crew?

If not can this be a possible option?
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on April 02, 2022, 10:08:35 PM
Is it possible to make like a generic crew replacement, that can.... say crew ships without being "crew" for if you wanted to give a faction its own unique crew?

If not can this be a possible option?

unfortunately that's not possible right now, as i have not found were in the code the 'crew for ships' is calculated. same for things acting as ship supply.
if you, or anyone else knows were this code is located so I can get at it with crew replacer, I will add this future immediately, as I also want to be able to do this as well
Title: Re: [0.95.1a] Crew Replacer
Post by: Sunnyko on April 03, 2022, 03:29:24 AM
Is it possible to make like a generic crew replacement, that can.... say crew ships without being "crew" for if you wanted to give a faction its own unique crew?

If not can this be a possible option?

unfortunately that's not possible right now, as i have not found were in the code the 'crew for ships' is calculated. same for things acting as ship supply.
if you, or anyone else knows were this code is located so I can get at it with crew replacer, I will add this future immediately, as I also want to be able to do this as well

Sadly I do not.... but also as a note, you cant launch invasions in Nex with the marine replacments, even with the Nex patch... don't know if the same applies to vanilla, or even if vanilla has invasions if I am being honest, its been literal years since I have played without Nex.
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on April 04, 2022, 04:02:04 PM
Sadly I do not.... but also as a note, you cant launch invasions in Nex with the marine replacments, even with the Nex patch... don't know if the same applies to vanilla, or even if vanilla has invasions if I am being honest, its been literal years since I have played without Nex.

I probably should have said somewhere, that the nex patch was only for raiding (nex overwrites the marketCMD, and that's something crew replacer has to overwrite to work with that job). I have yet to add all the other crazy jobs that nex adds into the game. mostly because I'm kind of sorta scared to try to do so. I also cant right now, but I should probably at least get the invasion job into the nex patch sometime. no idea when that will be though. life can be mean sometimes.

the base game dose not have invasions. that's something nex added itself.
Title: Re: [0.95.1a] Crew Replacer
Post by: Sunnyko on April 04, 2022, 05:14:33 PM
Sadly I do not.... but also as a note, you cant launch invasions in Nex with the marine replacments, even with the Nex patch... don't know if the same applies to vanilla, or even if vanilla has invasions if I am being honest, its been literal years since I have played without Nex.

I probably should have said somewhere, that the nex patch was only for raiding (nex overwrites the marketCMD, and that's something crew replacer has to overwrite to work with that job). I have yet to add all the other crazy jobs that nex adds into the game. mostly because I'm kind of sorta scared to try to do so. I also cant right now, but I should probably at least get the invasion job into the nex patch sometime. no idea when that will be though. life can be mean sometimes.

the base game dose not have invasions. that's something nex added itself.

Thats totaly understandable, and no rush at all, take care of yourself first after all.

Invasions are TBH probaly the only real big thing that would be needed for nex with any priority, like I know there are other uses for marines in it.... but like invasions are the one where most of them are spent you know?
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on April 04, 2022, 05:49:19 PM
Sadly I do not.... but also as a note, you cant launch invasions in Nex with the marine replacments, even with the Nex patch... don't know if the same applies to vanilla, or even if vanilla has invasions if I am being honest, its been literal years since I have played without Nex.

I probably should have said somewhere, that the nex patch was only for raiding (nex overwrites the marketCMD, and that's something crew replacer has to overwrite to work with that job). I have yet to add all the other crazy jobs that nex adds into the game. mostly because I'm kind of sorta scared to try to do so. I also cant right now, but I should probably at least get the invasion job into the nex patch sometime. no idea when that will be though. life can be mean sometimes.

the base game dose not have invasions. that's something nex added itself.

Thats totaly understandable, and no rush at all, take care of yourself first after all.

Invasions are TBH probaly the only real big thing that would be needed for nex with any priority, like I know there are other uses for marines in it.... but like invasions are the one where most of them are spent you know?
it should be noted that most jobs in nex have nothing to do with crew. of course a 'job' as defined by crewReplacer is any time someone uses an item for something. so invasion is two jobs, marines and heavy armaments. the other things i think nex has is an 'outpost' build system, that would have 3 'jobs' in it i think, an 'boost stability' thing, that i think is 3 jobs, and probably more that I'm missing.
uh what im trying to say is that crew replacer is more like item replacer. it replaces more then crew, as crew are functionally the same as supplies or food as far as crew replacer is concerned. just a slightly rambling correction of assumptions.

i do agree that invasions is the top priority on that patch. its by far the most game changing thing crew replacer would edit in nex
Title: Re: [0.95.1a] Crew Replacer
Post by: Kobold on May 04, 2022, 07:12:54 PM
I forgot dragons... someone mod in dragons. It's Necessary!
yea, the dragons from rick and morty, cause once their done soul bonding, we can go and massacre them all because of how inept they would be
Title: Re: [0.95.1a] Crew Replacer
Post by: ebolamorph on September 24, 2022, 05:22:09 AM
Where is the direct download link? I am not seeing it on github
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on September 24, 2022, 04:53:06 PM
Where is the direct download link? I am not seeing it on github
there should be an green button that says 'Code' on the github page, around the top somewere. it should open a drop down menu and the bottom option from said menu should be 'download zip'. that should be the download link, as i understand it.
happy gaming stranger.
Title: Re: [0.95.1a] Crew Replacer
Post by: cptdash on November 29, 2022, 10:35:25 PM
Any thoughts on how to use this to add a "passenger" crew replacer? I'm essentially just looking for a way to have a stack count against the personnel count of fleet, but not get counted for raids, colonization, etc.
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on November 30, 2022, 01:44:15 PM
Any thoughts on how to use this to add a "passenger" crew replacer? I'm essentially just looking for a way to have a stack count against the personnel count of fleet, but not get counted for raids, colonization, etc.
i am somewhat unsure what you mean.
if you are talking about adding new 'crew' to the 'crew storage' of a fleet, I have no clue how that works, but crew replacer could likely work with it if I know how.
if you are talking about having 'crew' to crew your ships, I also don't know how that works, but crew replacer could also get that to work if I knew how.
you also mention not having a crew type count for raids and colonization (colonization is also not yet supported.). getting a 'crew' to not do a job is very simple task, as every job has its own set of 'crew' that is allowed to do said job, to allow for a lot of flexibility in deciding what a crew can do and how good at it they are. in effect, how you do this is you only add your 'crew' to jobs you want them to do.

for real though, I don't quite understand what you are asking. would you be willing to elaborate?
(also if you do happen to have any ideas at all how to do things like change the number of crew storage that is used in a fleets crew storage, or the number of available crew for ships in a fleet, I would be very grateful if you shared so I could add that to crew replacer)
Title: Re: [0.95.1a] Crew Replacer
Post by: MrNage on November 30, 2022, 02:40:25 PM
Any thoughts on how to use this to add a "passenger" crew replacer? I'm essentially just looking for a way to have a stack count against the personnel count of fleet, but not get counted for raids, colonization, etc.

Well, this mod replaces existing vanilla personnel, I am not sure if it it could be used to create personnel exclusively tasked with brand new functions or jobs.
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on November 30, 2022, 03:25:53 PM
Well, this mod replaces existing vanilla personnel, I am not sure if it it could be used to create personnel exclusively tasked with brand new functions or jobs.
If there is a way to set or change the values of the number of crew in a fleet and what percent of required skeleton crew you have with code, then it is possible for me to add a way to do so with crew replacer.
Edit: what I'm trying to say is that if it's possible, crew replacer can be made to do it. Im just bad at saying that.
Title: Re: [0.95.1a] Crew Replacer
Post by: kadu522 on December 25, 2022, 03:00:26 PM
I have a bug to report.

It seams like crew replacer does not take into account incressed raid effectiveness from ships when calculateing marine losses.

The raid strenght its uneffected but then it say's i have a much lower combat strenght total. say's that i lost say 70 marines as intended but i actualy lost around double that.
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on December 25, 2022, 06:47:03 PM
I have a bug to report.

It seams like crew replacer does not take into account incressed raid effectiveness from ships when calculateing marine losses.

The raid strenght its uneffected but then it say's i have a much lower combat strenght total. say's that i lost say 70 marines as intended but i actualy lost around double that.
Thank you for the report. A partly rework is planned for the raiding parts of my mod, to fix some other issues. This will be added to the lists of fixes to do. Soon hopefully, it will be fixed
Title: Re: [0.95.1a] Crew Replacer
Post by: HopeFall on March 14, 2023, 02:01:13 PM
Does any mod use this yet?
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 14, 2023, 02:16:24 PM
Does any mod use this yet?
Right now the only mod I know of that use this is AI-Retrofits. Although nexerlin added invasion support for crew replacer recently, but that's not really using it, just enabling others to use it better.
Title: Re: [0.95.1a] Crew Replacer
Post by: HopeFall on March 14, 2023, 02:57:59 PM
Got it! It does sound like amazingly useful. Just don't want to bloat my save with stuff yet, but am looking forward to see mods using it.
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 14, 2023, 03:00:03 PM
Got it! It does sound like amazingly useful. Just don't want to bloat my save with stuff yet, but am looking forward to see mods using it.
I can understand this. Goodness knows my saves are bloated enough as is. I two am looking forward to people using this utility more.
Title: Re: [0.95.1a] Crew Replacer
Post by: mark.sucka on March 18, 2023, 09:01:14 PM
Any thoughts on how to use this to add a "passenger" crew replacer? I'm essentially just looking for a way to have a stack count against the personnel count of fleet, but not get counted for raids, colonization, etc.
i am somewhat unsure what you mean.
if you are talking about adding new 'crew' to the 'crew storage' of a fleet, I have no clue how that works, but crew replacer could likely work with it if I know how.
if you are talking about having 'crew' to crew your ships, I also don't know how that works, but crew replacer could also get that to work if I knew how.
you also mention not having a crew type count for raids and colonization (colonization is also not yet supported.). getting a 'crew' to not do a job is very simple task, as every job has its own set of 'crew' that is allowed to do said job, to allow for a lot of flexibility in deciding what a crew can do and how good at it they are. in effect, how you do this is you only add your 'crew' to jobs you want them to do.

for real though, I don't quite understand what you are asking. would you be willing to elaborate?
(also if you do happen to have any ideas at all how to do things like change the number of crew storage that is used in a fleets crew storage, or the number of available crew for ships in a fleet, I would be very grateful if you shared so I could add that to crew replacer)

You never got a reply to this from the OP, but I think I sort of understand what the OP was going for and had a similar thought.

In my mind, a "passenger" commodity could exist, which occupies personnel space capacity similar to crew and marines, but these "passengers" serve no useful functions that either crew or marines have.  Instead, these "passengers" would provide a credit income per month.  Perhaps not as high as a standard crew costs, but something ($2 or $5 per month maybe).

In this way, the player could operate sort of a space tourism operation.  Use your excess crew space on your ships to show non-combatants the wonders of the sector, and help offset the costs of operating your fleet.  You would pay a commodity cost per passenger you take on of say $100 (which in an RP sense could be thought as an insurance premium in the event the passenger is killed in action).  If you no longer wanted to keep holding passengers, you could sell these off to stations.  The price variability would add another RP dynamic -- buying passengers at $80 on a crappy planet and selling them for $120 at a better planet is simply a transportation fee the passenger is willing to pay to get to a better world.  Operating with passengers is a gamble that A) you can keep passengers alive long enough to earn back their purchase cost in monthly income and B) that if you need the space for actual crew or marines and need to sell off passengers, that you have brought them to a world they value more than the world from which you initially acquired them.

As an example of how this could play out; your fleet is a paragon and a starliner.  350 required crew, 2500 maximum crew.  Bring along 500 actual crew to operate both ships and have reserves for potential losses, at a monthly cost of $5,000.  Carry 100 marines just in case for raids or bar missions, at a monthly cost of $2,000.  Bring along 1900 "passengers" willing to pay $5 a month, for an income of $9,500.  In total, your fleet generates $2,500 a month of income, which might be enough to pay for the paragon's officer salary.

I see NPC "tourism fleets" in my playthrough, but to be honest I have no idea if this is vanilla or Nex or IndEvo content.  But the concept is already sort of operating out there already for NPCs to take advantage of, so it would make sense for this sort of secondary income stream to be available to the player too.

The main fundamental difference and challenge to what crew replacer does, is that AI retrofits creates cargo commodities, whereas it would be most appropriate to create a personnel commodity with this item type.
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 19, 2023, 10:28:22 AM
In my mind, a "passenger" commodity could exist, which occupies personnel space capacity similar to crew and marines, but these "passengers" serve no useful functions that either crew or marines have.  Instead, these "passengers" would provide a credit income per month.  Perhaps not as high as a standard crew costs, but something ($2 or $5 per month maybe).
I understand. Your talking about a crew job that handles crew storage use, and a way to have crew use a wadge (negative wage in this case).
The crew storage is on the list of things I want in crew replacer, although it's not yet implemented.
As for crew replacer handprint credit cost per month? Maybe I'll add something like that. It depends on if credit cost is something one can already do easily without crew replacer or, or if the game requires a utility to handle changes in income sources.
But ya, I think I understand. Thank you for the explanation.
Title: Re: [0.95.1a] Crew Replacer
Post by: HopeFall on March 20, 2023, 06:14:00 PM
I almost feel the above suggestion should be relegated to certain special ships and hull mods. I know there's some unique ships that add resources by having them in dock somewhere (some sort of paragon with a special farm thing in the middle). Space tourism is cool, but sounds more like something a mod similar to Space Trucking should handle. Technically, you can already act as a ferry service by taking people from a market that sells crew cheap, to a market that buys them for a lot.

I do think it's an interesting concept though. But I'm not sure it make functional sense. You're trading storage for passive income - why not do that for Crew, Storage, and Fuel? Because it doesn't feel balanced/makes little sense. Those passengers are going to want to get off, and certainly aren't going to continue paying premium cash forever to stand aboard a ship for eternity.
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 20, 2023, 10:53:00 PM
I almost feel the above suggestion should be relegated to certain special ships and hull mods. I know there's some unique ships that add resources by having them in dock somewhere (some sort of paragon with a special farm thing in the middle). Space tourism is cool, but sounds more like something a mod similar to Space Trucking should handle. Technically, you can already act as a ferry service by taking people from a market that sells crew cheap, to a market that buys them for a lot.

I do think it's an interesting concept though. But I'm not sure it make functional sense. You're trading storage for passive income - why not do that for Crew, Storage, and Fuel? Because it doesn't feel balanced/makes little sense. Those passengers are going to want to get off, and certainly aren't going to continue paying premium cash forever to stand aboard a ship for eternity.
Some good suggestions here, but I feel the need to remind everyone, that crew replacer is a simple library. Its not going to add a inter passenger cruse liner system to the game itself, just (hopefully) enable someone else to do so with a little more ease, and a little more mod compatible.
That being said, feel free to discuss ideas for crew replacer here if you feel like sharing. Seeing what people are trying to use this for helps me make improvements and understand the shortcomings of my mod.
Title: Re: [0.95.1a] Crew Replacer
Post by: mark.sucka on March 23, 2023, 10:24:58 AM
I think the best enhancements Crew Replacer could be updated to include would be the 2 functions you're already aware of

1)  The ability to actually replace crew :)  Some sort of "Android Crew"-equivalent item that AI Retrofits can create using various commodities like metals, transplutonics, and perhaps organics and food for variety.  Which when assembled provides a functional equivalent for meeting skeleton crew requirements in ships, yet costs $0 in wages.  Perhaps balanced around costing significantly more in production inputs than buying a crew would otherwise cost, thereby only being economical if you can keep your ships alive and not lose these super-expensive "crew" members.  Adding the AI retrofit hullmod on a ship does remove the need for crew, but it has a few unintended side-effects with how the game processes things.  Namely, other hullmods that should increase the crew requirements of a ship no longer increase such cost, and ALL crew loses for a ship are limited to the maximum of the skeletal crew.  So you can launch a condor with expanded deck crews into a fight with 2 talon wings, watch them get chewed up repeatedly in an extended fight, and find that despite 200 talons being blown out of space that there were 0 crew deaths.  Which means that one of the main downsides to using talons (excessive crew loses, which 2 crew is just as expensive as 1 supply) is negated.

2) Full integration with Nex to be able to use combat drones for planetary invasions.
Title: Re: [0.95.1a] Crew Replacer
Post by: alaricdragon on March 23, 2023, 02:08:57 PM
I think the best enhancements Crew Replacer could be updated to include would be the 2 functions you're already aware of

1)  The ability to actually replace crew :)  Some sort of "Android Crew"-equivalent item that AI Retrofits can create using various commodities like metals, transplutonics, and perhaps organics and food for variety.  Which when assembled provides a functional equivalent for meeting skeleton crew requirements in ships, yet costs $0 in wages.  Perhaps balanced around costing significantly more in production inputs than buying a crew would otherwise cost, thereby only being economical if you can keep your ships alive and not lose these super-expensive "crew" members.  Adding the AI retrofit hullmod on a ship does remove the need for crew, but it has a few unintended side-effects with how the game processes things.  Namely, other hullmods that should increase the crew requirements of a ship no longer increase such cost, and ALL crew loses for a ship are limited to the maximum of the skeletal crew.  So you can launch a condor with expanded deck crews into a fight with 2 talon wings, watch them get chewed up repeatedly in an extended fight, and find that despite 200 talons being blown out of space that there were 0 crew deaths.  Which means that one of the main downsides to using talons (excessive crew loses, which 2 crew is just as expensive as 1 supply) is negated.

2) Full integration with Nex to be able to use combat drones for planetary invasions.

1) if its possible, I will be adding the ability for crew replacer to change what items can crew ships/fighters at some point. its not possible yet though.
(slightly off topic here, but I see no reason not to talk about it), I have considered the possibility of having a android type of crew in AI-Retrofits at some point, but have discarded such plans. at least for now. what I plan to do is have the AI-Retrofit hull mod actually have its cost change in some way when you add or remove extra crew requirements for whatever reason.

2) nexerlin invasions do in fact support crew replacer now. although, the release version of AIRetrofits is not yet updated for this, the alpha version is almost ready for release, and it does have its combat robots fight in invasions. expect it to be out in a week or two. provided nothing goes wrong again....
Title: Re: [0.96a] Crew Replacer
Post by: TalRaziid on May 09, 2023, 04:35:55 PM
Is there a tutorial for dummies on how to make a new troop type using this library? I desire to make mech troops and giant crab troops
Title: Re: [0.96a] Crew Replacer
Post by: alaricdragon on May 09, 2023, 05:52:25 PM
Is there a tutorial for dummies on how to make a new troop type using this library? I desire to make mech troops and giant crab troops
sadly, i know of no crew replacer guides other then my own. thankfully, crew replacer is relatively simple. provided you already know the basics of moding. if you don't know the basics of starsector moding, im not up for explaining that, but you should be able to find some help with setting up the basics on the unofficial discord (https://fractalsoftworks.com/forum/index.php?topic=11488.0), or in Misc modding questions that are too minor to warrant their own thread (https://fractalsoftworks.com/forum/index.php?topic=5061.9855). or at least directions to somewhere to set up the basics.

you are going to need to be-able to run a few lines of code in onApplicationLoad(), as well as set up a commodity in data\campaign\commodities.csv in your mod.
i can walk you through how to use the commodities.csv, but i have forgetting how to set up code for your mod. (dont judge me we all forget things now and then)
anyhow, once you got the very basics of your mod set up, if you dont already, you only need to do 3 things to create a crew.
1) set up the commodity
2) make crew replacer a libary for your mod
3) run the following line of code in onApplicationLoad() (for every job you want a given crew to do):
  'crewReplacer_Main.getJob("job name goes here").addNewCrew("the commodity id of you crew",power,defence,priority);'
  a description of the values showed in this line of code:
   "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

its possible i overcomplicated step 3. if your new to moding and code that is. but ya, ask the people in the discord and in the forum how to set up the basics if you need to. i can walk you through how to set up crew replacer from there.
Title: Re: [0.96a] Crew Replacer
Post by: TalRaziid on May 09, 2023, 08:14:54 PM
I see. Do you know how new troop types would work out with Nex's invasions?
Title: Re: [0.96a] Crew Replacer
Post by: alaricdragon on May 09, 2023, 08:56:36 PM
I see. Do you know how new troop types would work out with Nex's invasions?
Yes, Nexerlin invasions do support crew replacer. I believe there is a list of jobs that are useable in crew replacer in the documentation. I can't link it right now because I am on mobile.
Edit: I misread your question.
Nexerlines invasions are split I to 3 jobs, if I recall correctly. One handles crew that you want to act as solders, one handles crew that you want to beable to merge with Hervey weapons for stronger crew, and one acts as Hevey weapons themselves? I don't quite remember this early in the morning. But nexerlin invasions act like any other job, and you can add crew to it like any other. The jobs names are in the documentation under the jobs section. You do not need to add nexerlin as a libary to get the invasion jobs working.
When you have added the new crew to the invasion job(s), you can deploy then like normal Marines. Although I don't think you get to pick what's in a given squad, it just adds things to said squad based on the crews priority.

Edit 2: I forgot to link the documentation. Sorry for that it is here: https://github.com/Alaricdragon/Crew_Replacer/tree/master/jars/src/desing/documentation (https://github.com/Alaricdragon/Crew_Replacer/tree/master/jars/src/desing/documentation)
Title: Re: [0.96a] Crew Replacer
Post by: DartStar on September 27, 2023, 06:09:04 PM
One.
There are not enough screenshots or clarifications.  in a couple of hours I still didn’t see any changes
Title: Re: [0.96a] Crew Replacer
Post by: alaricdragon on September 27, 2023, 06:47:44 PM
One.
There are not enough screenshots or clarifications.  in a couple of hours I still didn’t see any changes
I do agree that I need more of both screenshots and clarifications.
What this mod does will in no way what so ever be viable in game without another mod that uses this one (such as AI-Retrofits). Crew replacer exists to solve a mod compatibility issue when it comes to changing the way things like surveying and salvaging work in the game, so to allow many mods to change the same thing without a massive maze of issues to arise.
So ya. This changes nothing on its own. Thank you for reminding me about clarification on what this mod does though. You are not the first to be confused about this. Or the second. Or the third. Or fourth...
I will get around to clarifying soonish hopefully.
Title: Re: [0.96a] Crew Replacer
Post by: alaricdragon on December 11, 2023, 09:31:04 AM
dear community:
the last update of this mod (V0.6.4) (that I released 6 months ago) introduced a very bad bug that i didn't notice until like a week ago, that could cause the following:
1) items not being were they said they were in cargo, so you could not pick them up
2) items not being were they said they were in cargo, so when you tried to pick up one you got another.
3) moving items sometimes resulting in them appearing on top of each other.
4)items in cargo sometimes moving to the side for no reason at all it would seem.

so yay. turns out that was me. sorry for having this bug here for so long i had no clue, as this somehow didn't come up at all in testing.
well, its fixed now. and texted. a lot. so please if you have this mod installed and are having issues with such things, please update to the latest version. its save combatable, so there should be no issues. but always remember to save copy your saves before updating, just in case.
also thanks to the person who reported this to me. it would have likely stayed around for quite a while longer if they had not.
Title: Re: [0.96a] Crew Replacer
Post by: Shai the Greatest on January 09, 2024, 04:27:27 PM
So, is a mod that can add more selection of crews types (Automated Robot crews or Luddic Motivated crew mates or can diversion of crews?) or equipment like (tanks, IFV, APC,?) Correct me if my understanding is wrong.
Title: Re: [0.96a] Crew Replacer
Post by: vorpal+5 on January 09, 2024, 10:39:19 PM
Can you post in your first entry the list of mods using your library? Because it's cool but if we don't know which ones, we might miss an opportunity  ::)
Title: Re: [0.96a] Crew Replacer
Post by: Shogouki on January 10, 2024, 12:53:40 PM
So, is a mod that can add more selection of crews types (Automated Robot crews or Luddic Motivated crew mates or can diversion of crews?) or equipment like (tanks, IFV, APC,?) Correct me if my understanding is wrong.

I believe just robotic crew and replacements for needing crew to survey and salvage as well as the ability to make robotic colonies.
Title: Re: [0.96a] Crew Replacer
Post by: alaricdragon on January 10, 2024, 03:31:13 PM
So, is a mod that can add more selection of crews types (Automated Robot crews or Luddic Motivated crew mates or can diversion of crews?) or equipment like (tanks, IFV, APC,?) Correct me if my understanding is wrong.
i believe you mostly understand, but some things i would like to explain:
this mod 'adds' nothing on its own, but what it does do is replace most instances of a 'commodity' being used in the vanilla code (like crew for salvaging, or supply's for surveying, or whatever), with a type of 'list' for each commodity. modders can then add commodity's or other things to that 'list'(very oversimplified) to let said item act as a valid thing for.. whatever its set to act as. so you could have another type of thing be used as 'supply' when salvaging, or you could have something else act as 'crew' for colonization. you can read more about this in the documentation (https://github.com/Alaricdragon/Crew_Replacer/tree/master/jars/src/desing/documentation), as well as what Crew Replacer has replaced and has not replaced here (https://github.com/Alaricdragon/Crew_Replacer/tree/master/jars/src/desing/documentation/jobs)
If you have more questions, please feel free to ask them. i know my explanations can suck sometimes.

Can you post in your first entry the list of mods using your library? Because it's cool but if we don't know which ones, we might miss an opportunity  ::)
that sounds like a good idea, although i don't know what mods even use Crew Replacer at the moment, i will try and find out sometime and add said list somewhere.

I believe just robotic crew and replacements for needing crew to survey and salvage as well as the ability to make robotic colonies.
the mod that adds that content is known as AI-Retrofits (https://fractalsoftworks.com/forum/index.php?topic=22261.0), made by myself.
this mod is only a library that enables such things as the robotic crew from AI-Retrofits. It adds nothing on its own.
Title: Re: [0.96a] Crew Replacer
Post by: Shogouki on January 10, 2024, 07:36:11 PM
I believe just robotic crew and replacements for needing crew to survey and salvage as well as the ability to make robotic colonies.
the mod that adds that content is known as AI-Retrofits (https://fractalsoftworks.com/forum/index.php?topic=22261.0), made by myself.
this mod is only a library that enables such things as the robotic crew from AI-Retrofits. It adds nothing on its own.

Oh FFS, I thought that this was the thread for AI-Retrofits...   :P

I'm glad you're paying more attention than I obviously am!   ;D
Title: Re: [0.96a] Crew Replacer
Post by: Shai the Greatest on January 26, 2024, 07:25:18 PM
So, is a mod that can add more selection of crews types (Automated Robot crews or Luddic Motivated crew mates or can diversion of crews?) or equipment like (tanks, IFV, APC,?) Correct me if my understanding is wrong.
i believe you mostly understand, but some things i would like to explain:
this mod 'adds' nothing on its own, but what it does do is replace most instances of a 'commodity' being used in the vanilla code (like crew for salvaging, or supply's for surveying, or whatever), with a type of 'list' for each commodity. modders can then add commodity's or other things to that 'list'(very oversimplified) to let said item act as a valid thing for.. whatever its set to act as. so you could have another type of thing be used as 'supply' when salvaging, or you could have something else act as 'crew' for colonization. you can read more about this in the documentation (https://github.com/Alaricdragon/Crew_Replacer/tree/master/jars/src/desing/documentation), as well as what Crew Replacer has replaced and has not replaced here (https://github.com/Alaricdragon/Crew_Replacer/tree/master/jars/src/desing/documentation/jobs)
If you have more questions, please feel free to ask them. i know my explanations can suck sometimes.

Can you post in your first entry the list of mods using your library? Because it's cool but if we don't know which ones, we might miss an opportunity  ::)
that sounds like a good idea, although i don't know what mods even use Crew Replacer at the moment, i will try and find out sometime and add said list somewhere.

I believe just robotic crew and replacements for needing crew to survey and salvage as well as the ability to make robotic colonies.
the mod that adds that content is known as AI-Retrofits (https://fractalsoftworks.com/forum/index.php?topic=22261.0), made by myself.
this mod is only a library that enables such things as the robotic crew from AI-Retrofits. It adds nothing on its own.
Oh, it's clear as day thanks for clarifying my question. This is the one of the best library mod I ever see and it's easy to use too. I am thinking making of troop,crew and equipment types with different buffs and penalties for vanilla atm (maybe) the only problem for me is the designs  ;D
Title: Re: [0.96a] Crew Replacer
Post by: alaricdragon on January 31, 2024, 11:56:44 AM
Oh, it's clear as day thanks for clarifying my question. This is the one of the best library mod I ever see and it's easy to use too. I am thinking making of troop,crew and equipment types with different buffs and penalties for vanilla atm (maybe) the only problem for me is the designs  ;D
I'm glad your enjoying my mod. i was worried i might have made it a little to confusing, or that my documentation was not sufficient. so im glad that you find it easy to use. and one of the best.
if you ever have any confusion over how things work, or otherwise want to try and do something really wired that you worry might be impossible while designing things related to crew replacer, feel free to contact me and i will attempt to provide additional information and tips on how my mod works
also, good luck with designing your things.
Title: Re: [0.97a] Crew Replacer
Post by: Akarthus on March 29, 2024, 11:07:23 PM
I read the documentation and the coding for AI-retrofit, but I'm still confused about how to implement it since I have no experience with Java. Is there a simpler example that just creates a new crew that can do everything a crew does but better?
Title: Re: [0.97a] Crew Replacer
Post by: alaricdragon on March 30, 2024, 10:41:53 AM
I read the documentation and the coding for AI-retrofit, but I'm still confused about how to implement it since I have no experience with Java. Is there a simpler example that just creates a new crew that can do everything a crew does but better?
hello!
first of all, this is Crew Replacer, but you are not the first to confuse the mods.
as for your question, im not quite sure what you are asking, or rather, the extent of what you are asking for.
if you want to see a example of how to set up your mod plugin, to add a crew, you must do the following:
Spoiler
1) add 'crew replacer' as a library for your mod. (how this works changes depending on how you set up your workplace)
2) in the 'mod_info.json' file of your mod, add
Code
    	"dependencies": [
        {
            "id": "aaacrew_replacer",
            "name": "crew_replacer",
        },
],
somewhere in in said file (look at other mods files for refrence)
3) run the following in your mod plugins 'onApplicationLoad()' function
Code
crewReplacer_Main.getCrewSet("crew").addNewCrew("commodityID", 1, 10);
but replace "commodityID" with the ID of the commodity you want to act as a crew, and '1' with how 'strong' you want this crew to be (so 1.25 would be 25% stronger then crew. 0.5 would be 50% weaker)
here is a example of what your mod plugin could look like (I made it so ore acts as 'crew', but 75% stronger in this example.) (also, were it says 'AI_RetrofitsStartup' should be your mod plugins class name. it should not be mine or you will have issues.)
Code
public class AI_RetrofitsStartup extends BaseModPlugin {
    @Override
    public void onApplicationLoad() {
        crewReplacer_Main.getCrewSet("crew").addNewCrew("ore", 1.75, 10);
    }
}
[close]
if this is your first mod, and you have not created your first jar file yet: this might help, but it might be outdated (https://starsector.fandom.com/wiki/Getting_started_with_mod_programming) I'm bad at finding tutorials. you should likely ask in misc modding questions (https://fractalsoftworks.com/forum/index.php?topic=5061.10590) or in the unofficial starsector discord channal (https://discord.gg/RpgAaJMK)
if you need to create a new commodity to act as your crew, i have a tutorial i built recently donated to that and only that. although, it covers a lot, and looks at some code, it covers everything i could think of. so enjoy that: here (https://fractalsoftworks.com/forum/index.php?topic=29612.msg434214#msg434214)

as always, if you have any questions, feel free to ask questions.

also a note: right now, there is no way to make something other then 'crew' crew starships. so if that's something you wanted, i'm sorry = (
good luck
Title: Re: [0.97a] Crew Replacer
Post by: Akarthus on March 30, 2024, 12:53:07 PM
I read the documentation and the coding for AI-retrofit, but I'm still confused about how to implement it since I have no experience with Java. Is there a simpler example that just creates a new crew that can do everything a crew does but better?
hello!
first of all, this is Crew Replacer, but you are not the first to confuse the mods.
as for your question, im not quite sure what you are asking, or rather, the extent of what you are asking for.
if you want to see a example of how to set up your mod plugin, to add a crew, you must do the following:
Spoiler
1) add 'crew replacer' as a library for your mod. (how this works changes depending on how you set up your workplace)
2) in the 'mod_info.json' file of your mod, add
Code
    	"dependencies": [
        {
            "id": "aaacrew_replacer",
            "name": "crew_replacer",
        },
],
somewhere in in said file (look at other mods files for refrence)
3) run the following in your mod plugins 'onApplicationLoad()' function
Code
crewReplacer_Main.getCrewSet("crew").addNewCrew("commodityID", 1, 10);
but replace "commodityID" with the ID of the commodity you want to act as a crew, and '1' with how 'strong' you want this crew to be (so 1.25 would be 25% stronger then crew. 0.5 would be 50% weaker)
here is a example of what your mod plugin could look like (I made it so ore acts as 'crew', but 75% stronger in this example.) (also, were it says 'AI_RetrofitsStartup' should be your mod plugins class name. it should not be mine or you will have issues.)
Code
public class AI_RetrofitsStartup extends BaseModPlugin {
    @Override
    public void onApplicationLoad() {
        crewReplacer_Main.getCrewSet("crew").addNewCrew("ore", 1.75, 10);
    }
}
[close]
if this is your first mod, and you have not created your first jar file yet: this might help, but it might be outdated (https://starsector.fandom.com/wiki/Getting_started_with_mod_programming) I'm bad at finding tutorials. you should likely ask in misc modding questions (https://fractalsoftworks.com/forum/index.php?topic=5061.10590) or in the unofficial starsector discord channal (https://discord.gg/RpgAaJMK)
if you need to create a new commodity to act as your crew, i have a tutorial i built recently donated to that and only that. although, it covers a lot, and looks at some code, it covers everything i could think of. so enjoy that: here (https://fractalsoftworks.com/forum/index.php?topic=29612.msg434214#msg434214)

as always, if you have any questions, feel free to ask questions.

also a note: right now, there is no way to make something other then 'crew' crew starships. so if that's something you wanted, i'm sorry = (
good luck
I was trying to read the coding for AI-retrofit to get an example of "alternative" crew, i didn't get confused xD

So if I had something like the ore in the example, he can survey and salvage as 1.75 crew, but cannot act as skeletal crew to pilot ships?
Title: Re: [0.97a] Crew Replacer
Post by: alaricdragon on March 30, 2024, 01:11:23 PM
I was trying to read the coding for AI-retrofit to get an example of "alternative" crew, i didn't get confused xD

So if I had something like the ore in the example, he can survey and salvage as 1.75 crew, but cannot act as skeletal crew to pilot ships?
Yes. They can also repair hyper relays, and do anything that a 'crew' can in some other mods (like nomadic survival (and the other version) and  a single event in the forge production mod.
AI-Retrofits is not the best for learning how crew works, as most of the crew there uses a custom crew class (for dynamic stats) and also the configs are confusing. And it has not changed over to the crew set system yet.
Sorry for my confusion in regards to what you were talking about. I try my best.
Anyhow, feel free to ask more questions if you need to. I have nothing to do help. Also, good luck!
Title: Re: [0.97a] Crew Replacer
Post by: Akarthus on March 30, 2024, 01:20:19 PM
sad that alternative crew didn't work...but I think I can still make stuff like domain-era marines, awesome framwork regardless xD
Title: Re: [0.97a] Crew Replacer
Post by: alaricdragon on March 30, 2024, 01:33:28 PM
sad that alternative crew didn't work...but I think I can still make stuff like domain-era marines, awesome framwork regardless xD
Maybe someday I will get the few 'jobs' I have yet to find a way to change working, but for now, crew replacer will remain incomplete : (
Good luck with your things. And remember: crew replacer is for more then just crew and marine things. Gotta remind everyone reading this of that because of the misleading name of this framework.
Title: Re: [0.97a] Crew Replacer
Post by: alaricdragon on April 05, 2024, 09:38:07 AM
I was trying to read the coding for AI-retrofit to get an example of "alternative" crew, i didn't get confused xD

So if I had something like the ore in the example, he can survey and salvage as 1.75 crew, but cannot act as skeletal crew to pilot ships?
i find my own self frustrating sometimes.
I realized that there is a way i could make 'skeleton crew' work, as well as 'use crew space' crew work. its just requires me to accept the fact that the UI will never respect that (and in fact will look janky), but i could make my own like, intel thing or something that shows the 'real' values of the crew on ships. its totally doable. in fact i spent the last hour selling myself on the idea, so if you wanted that 'skeleton crew' give me a week or two and you can have it.
probably.
why do i keep getting myself into messes like this? i hate working with UI...
but now i got to do it. oh well.
I wanted skeleton crew as well, so there is that...
Title: Re: [0.97a] Crew Replacer
Post by: alaricdragon on April 16, 2024, 12:15:33 PM
im going to be late on that thing i promised, not because im lazy, but because im really lazy.
Title: Re: [0.97a] Crew Replacer
Post by: Shogouki on April 16, 2024, 02:08:50 PM
im going to be late on that thing i promised, not because im lazy, but because im really lazy.

xD

No worries, life takes precedent over modding!
Title: Re: [0.97a] Crew Replacer
Post by: mark.sucka on April 16, 2024, 04:31:10 PM
im going to be late on that thing i promised, not because im lazy, but because im really lazy.

Bah!  I can't wait until I can figure out how to combine transplutonics and metals to create 'coder droids' so we can replace lazy humans like you!  I bet you even think you're worth a $10 monthly salary too, hmmmm?
Title: Re: [0.97a] Crew Replacer
Post by: alaricdragon on April 16, 2024, 05:25:10 PM
Bah!  I can't wait until I can figure out how to combine transplutonics and metals to create 'coder droids' so we can replace lazy humans like you!  I bet you even think you're worth a $10 monthly salary too, hmmmm?
*Sobs in less then 10$ an hour from coding for fun*