I’ve been working on a modder’s resource that adds various tools into the game to be used by other mods.
One of the things I’m looking to make are working computers. To make the process more real, variable, and interesting, I’m going with “making a computer” → “installing an OS to make it useful”. The mod offers a default OS that could probably be used for most projects, and the list could be expanded in mods that use it.
What would be the best way to handle installing an OS onto a computer?
One thing I’m considering is making the OS a “component” of the computer. There’s a “conditional naming” system that allows items to be named differently based on what they’re made of. For example, you can have “a pair of gloves” if they’re made of cotton, and “a pair of leather gloves” if they’re made of leather. Having a similar system – e.g. “laptop computer with Ubuntu”, “laptop computer with EulerOS” etc. – would be neat, although it would also require overwriting the base item, which is less than ideal for modularity.
Currently I’m working with a rather crude solution which creates an item for each OS used. It’s excellent for modularity – it allows different OS-loaded computers to co-exist peacefully because they don’t overwrite each other in any way – but I feel like there must be a better solution to this.
There seems to also be a way of putting an OS “into” the computer, by turning it into a container (in in-game terms). This is how software spawns right now: it’s defined as a generic item that is contained within a USB drive, so that it never spawns on its own (i.e. as an item “MatheMAX” or “hackPRO”): only as a USB drive with said software.
Another thing I’m wondering about is the process of installation itself.
I think the best way to go about it would be via pseudo-crafting. Take a computer you want to install on, take a USB drive with an OS on it, and smash the two together for several minutes until there’s a computer ready for use. Simple enough.
The question is: what’s the best way to do so?
One way I can see is making dozens of recipes for every combination of computer type (desktop, laptop, smartphone) and every existing OS. Needless to say, this is less than ideal, not the least because it present a challenge for every person that would like to use the mod for their own creation.
Ideally, there would be one recipe for all types of computers and all kinds of OSes, where you could match the device with the OS and receive said device, now with an OS installed, in the end. This may or may not be possible within the constraints of the current engine.
Barring that, there could be as many recipes as there are specific types of devices, where for each an OS could be chosen. Same deal as above, just longer list and each platform could be given its own list of OSes. Perhaps such a recipe would produce a base item “laptop computer with OS”, and have the kind of OS defined as a contained item? (“laptop computer with OS (Ubuntu)” or similar)
How would one go about it?