skairunner / sky-oni-mods

Code for Sky's mods for the game Oxygen Not Included.
MIT License
18 stars 25 forks source link

DLC Compatibility For Drains, Radiation, Radiator #55

Open BaalEvan opened 3 years ago

BaalEvan commented 3 years ago

Additional: Added Radiant Pipes to Radiation

skairunner commented 3 years ago

Hi, thanks for the PR. I mostly have a question about the new tech database methods: does the base game without the DLC also use the new method, or does there have to be some sort of compatibility switch?

BaalEvan commented 3 years ago

Based on what i found on Github (becasue i never made any mod to ONI before) there is no new way in Vanilla but you can select target in Mod_info.yaml and upload mod with Mod Archive with Vanilla support supportedContent: EXPANSION1_ID lastWorkingBuild: 464434

  1. Suppose you've got a mod working with the base version of ONI, on version 441000. Add a mod_info.yaml with these contents:

supportedContent: VANILLA_ID lastWorkingBuild: 441000

  1. You decide to update your mod to work with Spaced Out!, which is at 442000.

First: make a new folder and subfolder in your mod for archiving the base version of your mod, named something like:

/archived_versions/vanilla and copy all your mod files (including the mod_info.yaml) into that subfolder. Then change the mod_info.yaml in the root folder of your mod to these contents: supportedContent: EXPANSION1_ID lastWorkingBuild: 442000 Develop your mod for the new expansion features and publish it in that root folder. Players on the base game will get the version from the archive folder, and players on Spaced Out! will get the version from the top-level folder. 3. Later, we open up a public_testing branch for Spaced Out! that changes the build number to 443000. As before, make a new archive folder called something like: /archived_versions/spacedout_old and copy all your top-level mod files into it (including the mod_info.yaml). Then change the mod_info.yaml in the root folder of your mod to these contents: supportedContent: EXPANSION1_ID lastWorkingBuild: 443000 You can update your mod for the preview branch and publish it in that root folder. Players on the newest preview version of the game will get the newest version of your mod, and players not on the previous will continue playing the previous version from the archive folder. You can of course delete old archived versions as the progress of the game moves forward.

https://forums.kleientertainment.com/forums/topic/126022-setting-up-mod_infoyaml/

BaalEvan commented 3 years ago

So best way to handle Tech Database will be:

#IF VANILLA
 // OLD WAY
#ELSEIF SPACEOUT
 // NEW WAY
#ENDIF

And then building 2 separate DLL for each version example: https://github.com/davkas88/ModNotIncluded/blob/388403d204032dc6aa8c033c546d458233916447/Source%20Code/Insulated%20Door/InsulatedDoors.cs OR... you can use reflection to check if there is field in Techs named Instance and based on that use correct approach second example: https://github.com/v-limc/oni-mods/blob/a369c7848fd0fa3f22d15fbccaa29be04edb7ca3/src/commons/VUtils.cs

skairunner commented 3 years ago

I've talked with some fellow mod devs and I think that I don't want to support the DLC yet, because it's just a big pain. I will wait for full release. However, if you want to please feel free to upload your DLC changes on Steam Workshop! The only thing I ask for is to link back to the original mod & clarify you got permission. Call it "Drains [Spaced Out Beta]" or something, yeah?

BaalEvan commented 3 years ago

Sure ;) No problem ;)