Ludeon Forums

RimWorld => Releases => Mods => Outdated => Topic started by: syntax1993 on July 24, 2016, 10:00:56 AM

Title: [A14] Miniaturisation - Mod support
Post by: syntax1993 on July 24, 2016, 10:00:56 AM
notfood (https://ludeon.com/forums/index.php?action=profile;u=47302) made this mod into a dll which fixes the issues that were happening with this xml-based mod. Please download his version here (https://ludeon.com/forums/index.php?topic=22093.msg242514#msg242514). It's crazy easy to add mod support.


Description:
Enables core game mechanics of miniaturisation for more than just furniture.
This means you can move workbenches like you would move a chair.

This mod can be used by itself and does not require the original mod although it is recommended. Without the original mod, you will only be able to move the mod-specific workbenches and not the vanilla ones.

Suggestions are always welcome, I'll see what I can do. Heck, you might even be able to ask the mod maker to include it themselves.

The original mod was created by hwfanatic (https://ludeon.com/forums/index.php?topic=20619.0 (https://ludeon.com/forums/index.php?topic=20619.0)). I simply modified it to support the mods below:

Download
Changelog EPOE
[25/07/2016] - Changed so this only supports the EPOE workbenches. Download the original mod to be able to move vanilla workbenches
[24/07/2016] - Changed forums link
[24/07/2016] - Initial upload


Changelog Craftable Medicines
[25/07/2016] - Initial upload

License
Can modpack makers include your mod in their modpack? Yes.
Can other modders make derivative mods based on yours? Yes.

Credits
Modders
Expanded Prosthetics and Organ Engineering (https://ludeon.com/forums/index.php?topic=10571.0) by Ykara (https://ludeon.com/forums/index.php?action=profile;u=12564)
Craftable Medicines (https://ludeon.com/forums/index.php?topic=13525.0) by Anonemous2 (https://ludeon.com/forums/index.php?action=profile;u=40212)

Inspiration
Bucketsmith (https://ludeon.com/forums/index.php?action=profile;u=40626)
Title: Re: [A14] Miniaturisation - Expanded Prosthetics and Organ Engineering compatible
Post by: Hargut on July 24, 2016, 04:58:42 PM
Hi,

whats the load order ?

I get some error messages about this mod. (not with the original one)
Title: Re: [A14] Miniaturisation - Expanded Prosthetics and Organ Engineering compatible
Post by: syntax1993 on July 25, 2016, 02:25:04 AM
Quote from: Hargut on July 24, 2016, 04:58:42 PM
Hi,

whats the load order ?

I get some error messages about this mod. (not with the original one)
For me, this mod loads as the very last. It has to be after EPOE.
I will be changing it so that this is sort of an extension to the original Miniaturisation mod, where you would need the original mod for this to work.

So as of right now, disable the original Miniaturisation mod and enable this one.
Title: Re: [A14] Miniaturisation - Expanded Prosthetics and Organ Engineering compatible
Post by: SURU on July 25, 2016, 04:09:26 AM
Imho mod like this should be implemented in basic game. You should have a possibility for moving tables, items or something like that without smashing it with hammer.. It really annoying me when i have to deconstruct and construct again items when i put it 1 square wrong. Argh, thanks for mod.
Title: Re: [A14] Miniaturisation - Expanded Prosthetics and Organ Engineering compatible
Post by: syntax1993 on July 25, 2016, 06:40:50 AM
Quote from: SURU on July 25, 2016, 04:09:26 AM
Imho mod like this should be implemented in basic game. You should have a possibility for moving tables, items or something like that without smashing it with hammer.. It really annoying me when i have to deconstruct and construct again items when i put it 1 square wrong. Argh, thanks for mod.
It indeed should be in the vanilla game. I will probably be making this mod a bit smaller by making it as a sort of addon mod for the original one (since he deserves most/all credit). Perhaps even create some more addons for other mods, so you would only need the base + the addons for the mods you use.
Title: Re: [A14] Miniaturisation - Expanded Prosthetics and Organ Engineering compatible
Post by: syntax1993 on July 25, 2016, 11:18:54 AM
Quote from: Hargut on July 24, 2016, 04:58:42 PM
Hi,

whats the load order ?

I get some error messages about this mod. (not with the original one)

Try it now. I've updated it to be some sort of addon (you don't actually need the original mod, nothing I can do about that). This means you need the original mod to move vanilla workbenches and mine to move EPOE specific workbenches.
Title: Re: [A14] Miniaturisation - Expanded Prosthetics and Organ Engineering compatible
Post by: kaptain_kavern on July 25, 2016, 11:27:37 AM
If you put the "<minifiedDef>MinifiedFurniture</minifiedDef>" in :

<ThingDef Name="BenchBase" ParentName="BuildingBase" Abstract="True">
    <castEdgeShadows>true</castEdgeShadows>
    <staticSunShadowHeight>0.20</staticSunShadowHeight>
  </ThingDef>


any benches (modded or not) that use ParentName="BenchBase" without redefine/overwrite the Parent class will inherit the minified tag.

That something i do in my computer, never wanna realease because of the already existing one. In fact that's how it's coded in vanilla for furnitures

  <ThingDef Name="FurnitureBase" ParentName="BuildingBase" Abstract="True">
    <comps>
      <li>
        <compClass>CompQuality</compClass>
      </li>
    </comps>
    <DesignationCategory>Furniture</DesignationCategory>
    <minifiedDef>MinifiedFurniture</minifiedDef>
    <tradeTags>
      <li>Furniture</li>
    </tradeTags>
  </ThingDef>


That way your mod can become the miniaturisation mod that handle modded stuff if loaded first ;)

On an other hand, i find it nice to see you "reduce" your mod in order to respect/credit the original modders. I'm sure you will find lots of ideas about things to mod (look here (https://ludeon.com/forums/index.php?board=12.0) in the forum, people often request mods/suggest mod idea and some very old dead/abandoned mods just wait for someone to revive them :p )

Cheers
Title: Re: [A14] Miniaturisation - Expanded Prosthetics and Organ Engineering compatible
Post by: syntax1993 on July 25, 2016, 12:49:51 PM
Quote from: kaptain_kavern on July 25, 2016, 11:27:37 AM
If you put the "<minifiedDef>MinifiedFurniture</minifiedDef>" in :

<ThingDef Name="BenchBase" ParentName="BuildingBase" Abstract="True">
    <castEdgeShadows>true</castEdgeShadows>
    <staticSunShadowHeight>0.20</staticSunShadowHeight>
  </ThingDef>


any benches (modded or not) that use ParentName="BenchBase" without redefine/overwrite the Parent class will inherit the minified tag.

That something i do in my computer, never wanna realease because of the already existing one. In fact that's how it's coded in vanilla for furnitures

  <ThingDef Name="FurnitureBase" ParentName="BuildingBase" Abstract="True">
    <comps>
      <li>
        <compClass>CompQuality</compClass>
      </li>
    </comps>
    <DesignationCategory>Furniture</DesignationCategory>
    <minifiedDef>MinifiedFurniture</minifiedDef>
    <tradeTags>
      <li>Furniture</li>
    </tradeTags>
  </ThingDef>


That way your mod can become the miniaturisation mod that handle modded stuff if loaded first ;)

On an other hand, i find it nice to see you "reduce" your mod in order to respect/credit the original modders. I'm sure you will find lots of ideas about things to mod (look here (https://ludeon.com/forums/index.php?board=12.0) in the forum, people often request mods/suggest mod idea and some very old dead/abandoned mods just wait for someone to revive them :p )

Cheers

Thank you. The thing is, it works for the EPOE mod but I just added the Crafting Medicines and their workbench derives from their own BuildingBase. If only it would be consistent, this would indeed be a lot easier.

I've been looking into simply defining the Def and only overriding (or adding in this case) a single value but it seems it doesn't work that way. For some reason, it overrides the whole object.

I'll have a look at the suggestions, although I doubt I'll have the time or experience to make something (actually complex, not like this) myself.
Title: Re: [A14] Miniaturisation - Mod support
Post by: skullywag on July 25, 2016, 12:56:00 PM
Can mods reference abstract classes in other mpds if loaded after? It only kind of works with some classes in core from what i know.
Title: Re: [A14] Miniaturisation - Mod support
Post by: syntax1993 on July 25, 2016, 01:44:42 PM
Quote from: skullywag on July 25, 2016, 12:56:00 PM
Can mods reference abstract classes in other mpds if loaded after? It only kind of works with some classes in core from what i know.

That's a good question... I wonder too.
Title: Re: [A14] Miniaturisation - Mod support
Post by: kaptain_kavern on July 25, 2016, 03:29:10 PM
Yes you have to redefine it for each mods, right?
Title: Re: [A14] Miniaturisation - Mod support
Post by: syntax1993 on July 25, 2016, 04:16:01 PM
Quote from: kaptain_kavern on July 25, 2016, 03:29:10 PM
Yes you have to redefine it for each mods, right?

Yep. Will be trying to find a good solution in the future, but I don't want to make all items able to move. Moving a steel wall would be weird.
Title: Re: [A14] Miniaturisation - Mod support
Post by: BaconBits on July 28, 2016, 06:26:36 PM
I'm not a 100% sure it's your mod, but, I keep getting these errors:

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)

Could not resolve cross-reference to Verse.RecipeDef named CreateJoywire

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)

Could not resolve cross-reference to Verse.RecipeDef named CreatePainstopper

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)

Cannot call ItemFromXmlFile with resolveCrossRefs=true while loading is already in progress.

I made sure before I posted that I had your latest update and I do. I have you mod after EPOE and both mods are very last in the mod order. When I take your mod out the errrors go away.

Any Ideas?
Title: Re: [A14] Miniaturisation - Mod support
Post by: syntax1993 on July 29, 2016, 02:32:10 AM
Quote from: WolfKing on July 28, 2016, 06:26:36 PM
I'm not a 100% sure it's your mod, but, I keep getting these errors:

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)

Could not resolve cross-reference to Verse.RecipeDef named CreateJoywire

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)

Could not resolve cross-reference to Verse.RecipeDef named CreatePainstopper

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)

Cannot call ItemFromXmlFile with resolveCrossRefs=true while loading is already in progress.

I made sure before I posted that I had your latest update and I do. I have you mod after EPOE and both mods are very last in the mod order. When I take your mod out the errrors go away.

Any Ideas?

Are there any more errors? I'm looking at this part in the TableSynthetics workbench:

    <recipes>
        <li>CreateAIChip</li>
        <li>CreateJoywire</li>
        <li>CreatePainstopper</li>
        <li>CreateSyntheticLung</li>
        <li>CreateSyntheticHeart</li>
        <li>CreateSyntheticKidney</li>
        <li>CreateSyntheticStomach</li>
        <li>CreateSyntheticLiver</li>
    </recipes>


It would seem weird that it only throws errors on two of these items, which is why I'm asking.

The workbench contains the references to the recipes, and the recipes are defined in the EPOE mod (I downloaded the latest EPOE and checked whether something changed but not as far as I can see).

EDIT: Can you also make sure you're running the latest version (1.71) of EPOE? Perhaps also provide the other mods you are running.
Title: Re: [A14] Miniaturisation - Mod support
Post by: eberkain on July 29, 2016, 11:35:16 AM
Anyone want to make one for Colony Manager?  There are several workbenches that you can't relocate with that mod.
Title: Re: [A14] Miniaturisation - Mod support
Post by: kaptain_kavern on July 29, 2016, 11:38:16 AM
@syntax1993

Couldn't you add the tag in the abstract benchbase ? That way even Manager benches will be impacted
Title: Re: [A14] Miniaturisation - Mod support
Post by: syntax1993 on July 29, 2016, 05:42:00 PM
Quote from: kaptain_kavern on July 29, 2016, 11:38:16 AM
@syntax1993

Couldn't you add the tag in the abstract benchbase ? That way even Manager benches will be impacted

I probably could, although I need to take a look at which mods don't allow this. I've noticed that some mods don't have benchbase as parent type but rather some buildingbase if I recall correctly. I'll take a look at it as soon as I can.
Title: Re: [A14] Miniaturisation - Mod support
Post by: notfood on July 29, 2016, 10:31:31 PM
This could be tackled more optimal as an injection and an exclusion list.

I... may do it.
Title: Re: [A14] Miniaturisation - Mod support
Post by: voxkoshka on July 30, 2016, 09:49:51 AM
Everything that I've been waiting for! :D
Testing now.
Title: Re: [A14] Miniaturisation - Mod support
Post by: notfood on July 30, 2016, 08:26:08 PM
aaaaaaaand done. I went for an inclusion list instead. I'll publish it as soon as you tell me it's good to go.

(http://i.imgur.com/ngFEE3h.png)

:: Miniaturization Overloaded ::

Description
This mod introduces the MiniaturisationDef, it allows you or anyone to shrink any table, or not necessarily a table. If it has a defName, you can shrink it. You can contribute for MiniaturisationDef.xml files and I can add them (I'll setup a github repo for easier collaboration), or you can make them into their own mod and have this mod loaded, load order doesn't matter. If you aren't using the requiredMod for the file, it gets ignored.

Writing your own
This is the format, example for EPOE:<Defs>
    <Miniaturisation.MiniaturisationDef>
        <defName>MiniaturisationEPOE</defName>
        <requiredMod>Expanded Prosthetics and Organ Engineering</requiredMod>
        <targetsDefNames>
            <li>TableBasicProsthetic</li>
            <li>TableBionics</li>
            <li>TableSimpleProsthetic</li>
            <li>TableSurrogates</li>
            <li>TableSynthetics</li>
            <li>UpgradingStation</li>
        </targetsDefNames>
    </Miniaturisation.MiniaturisationDef>
</Defs>

defName should be unique, requiredMod is the name found in the About.xml of that mod and targetsDefNames are the names of the things you want to shrink. Put it in Defs/MiniaturisationDefs and you are golden.

I have included MiniaturisationDef for Core, EPOE, Craftable Medicines and Mending.

Download
Beta Test 2 (https://ludeon.com/forums/index.php?action=dlattach;topic=22093.0;attach=14611)

Powered by
(http://tinyurl.com/pd78ovl) (https://ludeon.com/forums/index.php?topic=16599.0)
Title: Re: [A14] Miniaturisation - Mod support
Post by: kaptain_kavern on July 30, 2016, 08:40:59 PM
Very clever. Link us the repo once it's up, i'll contribute
Title: Re: [A14] Miniaturisation - Mod support
Post by: syntax1993 on July 31, 2016, 04:53:10 AM
This is great! I checked out the code and it's looking good! Once yours is up, I need to find a way to notify my currently subscribed people of this change, link to yours or something. We might also need to do this for the original mod (it would make a lot of sense).

This is really awesome. Thanks so much!

Will try it soon but I'm assuming it's working as expected.
Title: Re: [A14] Miniaturisation - Mod support
Post by: eberkain on July 31, 2016, 12:37:55 PM
Quote from: notfood on July 30, 2016, 08:26:08 PM
aaaaaaaand done. I went for an inclusion list instead. I'll publish it as soon as you tell me it's good to go.


Thank you so much for making that so easy to add onto.   Here is a config for Colony Manager, I can't remove the normal miniaturization and still load my save, so I just disabled the Core file  in the new one and loaded both. 

[attachment deleted by admin - too old]
Title: Re: [A14] Miniaturisation - Mod support
Post by: notfood on July 31, 2016, 01:02:56 PM
I added a github repo: LINK (https://github.com/notfood/RimWorld-Miniaturisation)

I made a tiny change in the MiniaturisationDef syntax, defNames is now targetsDefNames so it can't be confused with defName.
Title: Re: [A14] Miniaturisation - Mod support
Post by: Master Bucketsmith on July 31, 2016, 01:18:04 PM
Faaaaaaaaaaaaaaantastic!
Title: Re: [A14] Miniaturisation - Mod support
Post by: Elysium on July 31, 2016, 05:53:51 PM
Quote from: notfood on July 30, 2016, 08:26:08 PM
aaaaaaaand done. I went for an inclusion list instead. I'll publish it as soon as you tell me it's good to go.
This is great, I was able to get it to do exactly what I want with no prior knowledge about how to mod this game, thank you.
Title: Re: [A14] Miniaturisation - Mod support
Post by: syntax1993 on August 02, 2016, 01:58:40 AM
Quote from: notfood on July 31, 2016, 01:02:56 PM
I added a github repo: LINK (https://github.com/notfood/RimWorld-Miniaturisation)

I made a tiny change in the MiniaturisationDef syntax, defNames is now targetsDefNames so it can't be confused with defName.

Publish it already! You don't need my permission to do that! :D

Get it out there, it's an awesome mod which (as mentioned above) is super easy to modify without even knowing how to mod.
Title: Re: [A14] Miniaturisation - Mod support
Post by: eskoONE on August 03, 2016, 05:40:52 AM
I don't know if this is a known bug but if u uninstall a bench and configure it to be placed somewhere else it, you won't be able to load the save in that state.

What happened was, I restarted my PC because I was getting performance issues so I saved, rebooted and tried reloading the save resulting in several error reports. It was saying something about crematorium and I quickly remembered that I wanted to move it some where else.

So just as a warning for others, don't move your crematorium (maybe other benches too?) and save leave your game. Even though it's easy to fix the save file. There were a few lines of the crematorium being placed which I removed.
Title: Re: [A14] Miniaturisation - Mod support
Post by: notfood on August 03, 2016, 07:56:15 AM
Alright. I pushed a fix for reloading issue.

Download
Beta Test 2 (https://ludeon.com/forums/index.php?action=dlattach;topic=22093.0;attach=14611)

Seems stable. MiniaturizationDefs contributions are welcomed. Let's get a moderate amount before release.

[attachment deleted by admin - too old]
Title: Re: [A14] Miniaturisation - Mod support
Post by: Serenity on August 03, 2016, 09:23:20 AM
Fantastic. I missed that right away. So annoying to you are forced to deconstruct things. I can see things not fitting through doors. I've had that issue in real life with certain furniture (narrow stair wells are also an issue). But unless it's not too flimsy (or glued together) you can often disassemble things.

There are other things that I'd like to see moved though. Coolers are basically AC units and could be easily moved. Solar panels too maybe. And sandbags
Title: Re: [A14] Miniaturisation - Mod support
Post by: eskoONE on August 03, 2016, 09:28:13 AM
Quote from: notfood on August 03, 2016, 07:56:15 AM
Alright. I pushed a fix for reloading issue.

Download
Beta Test 2 (https://ludeon.com/forums/index.php?action=dlattach;topic=22093.0;attach=14611)

Seems stable. MiniaturizationDefs contributions are welcomed. Let's get a moderate amount before release.

ty for the update. ill try it out later. if it is rly that easy to create the xml files as it looks like, ill see if i can create one for each mod im currently running (arround 40, lol).

i have a question though. where do i find the bench names? there should be an xml in defs/thingdefs folder with the name in the xml am i right?
Title: Re: [A14] Miniaturisation - Mod support
Post by: notfood on August 03, 2016, 09:46:37 AM
Quote from: eskoONE on August 03, 2016, 09:28:13 AM
i have a question though. where do i find the bench names? there should be an xml in defs/thingdefs folder with the name in the xml am i right?

You need to open the xml file, inside you will find a:
<ThingDef ... >
     <defName>This_is_the_name_you_are_looking_for</defName>
     ...
</ThingDef>

Quote from: Serenity on August 03, 2016, 09:23:20 AMThere are other things that I'd like to see moved though. Coolers are basically AC units and could be easily moved. Solar panels too maybe. And sandbags

You can add them easily, paste this into a .xml file in the MiniaturisationDefs folder:
<Defs>
    <Miniaturisation.MiniaturisationDef>
        <defName>MiniaturisationCoreExtra</defName>
        <requiredMod>Core</requiredMod>
        <targetsDefNames>
            <li>Cooler</li>
            <li>SolarGenerator</li>
            <li>Sandbags</li>
        </targetsDefNames>
    </Miniaturisation.MiniaturisationDef>
</Defs>
Title: Re: [A14] Miniaturisation - Mod support
Post by: Serenity on August 03, 2016, 09:57:16 AM
Thanks :)
Title: Re: [A14] Miniaturisation - Mod support
Post by: Elysium on August 03, 2016, 12:07:43 PM
Here is what I have done so far, it isn't much but I thought I'd contribute anyway.  Unfortunately the authors of Medical Training and Modular Tables choose to include the mod version in the modName, which means this will become incompatible with updates to those mods, but it is easy enough to fix on your own.  I'm not aware of any way around this.

[attachment deleted by admin - too old]
Title: Re: [A14] Miniaturisation - Mod support
Post by: eskoONE on August 03, 2016, 12:29:46 PM
i pushed a pull request on github for some mods. also added a few things to core. ignore them if u dont like to add support for those things.

first time ever using github. so if i did something wrong pls bare with me and tell me how to do it properly.

also i tested the new version and it seems it fixes the issue with rebuilding things and save exiting game. gj on that!
Title: Re: [A14] Miniaturisation - Mod support
Post by: notfood on August 03, 2016, 09:37:18 PM
Posted a new thread, congrats everyone. Miniaturisation Overloaded (https://ludeon.com/forums/index.php?topic=22763.0)

Steam comes next.