Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to create a mod that adds new buildings or items? #4

Open
NeoRider7 opened this issue Jan 29, 2022 · 9 comments
Open

Comments

@NeoRider7
Copy link

Is it possible to create a mod that adds new buildings or items?
For so many years, not a single mod has been added yet that adds new buildings or items.
Why?
Perhaps this is due to the fact that for this we need to involve designers who will make the graphics?
Or is it solely due to problems in programming?

There were many attempts to add new buildings and items, but they remained unfinished.
Example-1: https://steamcommunity.com/workshop/discussions/18446744073709551615/1849197902670717252/?appid=403190
Example-2: https://forums.nexusmods.com/index.php?/topic/9719608-is-this-game-still-alive-for-further-mods/

Is it possible to expect that we will have new mods about buildings and objects in the future? Or is it technically impossible to do so?

@Tahvohck
Copy link
Owner

It should be doable, but the building array is hard-coded. Mods that add buildings would likely conflict with each other unless there was a modding interface designed to do the addition for the modder. The bigger question is how to go about loading new models into the game.

@NeoRider7
Copy link
Author

solidDoWant told me now that it is possible to create mods on its framework that will be able to add new buildings and items to the game.
Here is his post about it: link.


I'm copying a couple of sentences from his post here:
solidDoWant: "Yes, currently this is only possible (AFAIK) with my framework, or mods that use my framework.
See here for details.
Alternatively this can be done without any code (similar to challenges) via my XML modloader.
In short, a mod creator can build a model in Blender/similar tool, export it as .obj and .mtl files, then bundle it with their mod.
The model will then be automagically loaded on startup and can be used for buildings/items/etc.

Here's a couple of proof of concepts I built (artwork/models are placeholders):"

https://steamcommunity.com/sharedfiles/filedetails/?id=1266169042
https://steamcommunity.com/sharedfiles/filedetails/?id=1266168517


Tahvohck, what do you think about this?
a) If it is already possible to add buildings and items to the game using the framework created by solidDoWant, then how is it possible to add buildings and items using your engine based on Unity Mod Manager Configuration?
b) Is it possible to use the solidDoWant framework with your mods?
c) Is there enough information in the solidDoWant message and pictures about how to load new models into the game?

@Tahvohck
Copy link
Owner

Oh wow. He's done a pretty impressive job with that, just from the glance I took. It looks like it might be better to use his framework wholesale, I can't say if there would be collisions with the way Unity Mod Manager loads mods - most likely they'd break, since it looks like he's still using the older patcher-style injection and my code assumes an unmodified codebase.

I'll hit solidDoWant up and see what we can hash out about this.

@solidDoWant
Copy link

Hey all. I've been going back and forth with Tahvohck on Discord this week and I am pleased to announce that I have a working prototype of a compatibility layer for making all of JPFarias's mods compatible with my framework. This means that issues like this can be solved by simply dropping this new mod I'm working on into the Mods folder. Once I release the mod it should (hopefully) make the community less fragmented.

These screenshots don't look like much, but they represent some fairly complex code that's loaded the "AutoBuildingRotate" mod via my framework:
Rotated one way
Rotated another

Log:

Instantiated mod "AutoRotateBuildings.AutoRotateBuildings"
[MOD] AutoRotateBuildings activated
INITed AutoRotateBuildings.AutoRotateBuildings
Loaded mod "Planetbase Framework compatibility layer for jpfarias mods"
Successfully loaded 1 out of 1 mods from "C:\Users\Fred\Documents/Planetbase\Mods\Planetbase-Compat-Jfarias.dll"
Successfully loaded 2 of 2 mods

@solidDoWant
Copy link

Quick update - I've gotten a feature working that will change Redirector calls to Harmony patches. This was important to implement as roughly half of JPFarias mods rely on the Redirector mod, which conflicts/causes problems with Harmony. The only thing I have left to do before release is some code base cleanup, and adding a couple of doc files.

@solidDoWant
Copy link

I am pleased to announce the first release of my Planetbase Framework compatibility layer for JPFarias mod mod. @Tahvohck, if you get a chance can you tell me if this provides feature parity with the work you've done here?

@Zemogiter
Copy link

I'm trying to modify the vanilla mine to turn it int a interior structure (connects to base via corridors, eliminating the dealy caused by airlocks and protects workers/drillers from disasters) but I'm not sure what to do. Any help?

@NeoRider7
Copy link
Author

NeoRider7 commented Mar 23, 2024

Pics-001-v1 4 0-v01-400x225
Hi! How are you? From the description of the game update news 1.4.0 about Unity versions: "Planetbase was initially developed in 2015, using Unity 5, this update brings is up to date to Unity 2022.3, which is the latest stable. "

In light of this, has anything changed now in your Framework, "Unity Mod Manager Configuration", "Planetbase Utilities" , and mods?

Maybe now there will be more possibilities to create mods (textures, items, buildings)?

@Tahvohck
Copy link
Owner

Tahvohck commented Mar 26, 2024

Hey, thanks for checking in. I've been out of the modding scene for longer than I'd like to admit, and it's wild that planetbase actually got a mainline update.

Honestly, my advice at this point would be to drop UMMC, etc, or anything in this framework - it was never really even in a state where it was suitable for public release, since I lost the drive to keep up with it (when I first started work on this, the modding community was functionally dead, so I was just tinkering with it on my own). Instead, you should look into porting old mods over to BepInEx, which is a much more robust solution than I was attempting to work with using UMMC, and likewise basically works with any Unit game. The difference is that BepInEx is easy to drop into place and doesn't need manual configuration like UMMC does, and it has a robust set of helper utilities that would basically avoid the bits I was trying to work on here.

Additionally, modern unity tools are well documented so loading additional asset packs is probably not too hard - that said, the code structure that holds different isn't really conducive to adding new ones out of the box, so a helper mod will need to be set up for that. I was working on that for a while, but never really got anywhere: it's doable, but will be a headache to hijack the relevant structures and allow injecting new items into them.

Unfortunately, this probably WILL have to happen for anyone wanting to play on 1.4.0, since there's likely no chance that the now-ancient modding methods will work on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants