Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

[Solved] Research in Mods, clobbering, etc.

Discussion in 'Modding' started by pipakin, May 11, 2017.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. pipakin Apprentice Engineer

    Messages:
    182
    Is there anyway we could open up the ability for multiple mods to add research items? Right now we have to redefine the default MyObjectBuilder_SessionComponentResearchDefinition to add ours, but if another mod adds one as well it will clobber ours and the research won't be required.

    I can see that there is a method for you to process overrides made by mods. This could be used to merge the set of researches into a set, perhaps with a flag added to your definition, in case for some reason you WANT to clobber the list of researches. Alternatively, if the types were opened up to modders, we could make those changes in code ourselves. For now, it appears ALL of the classes around research are restricted in the modding scripts.

    Hopefully, someone will chime in and tell me I'm wrong and there's currently a way to do this right.
    --- Automerge ---
    So, in my ongoing saga of figuring things out myself after asking the question, it turns out the solution is thus:

    When defining your own MyObjectBuilder_SessionComponentResearchDefinition, use your own subtype. Example:

    Code:
    <Definition xsi:type="MyObjectBuilder_SessionComponentResearchDefinition">
        <Id Type="MyObjectBuilder_SessionComponentResearchDefinition" Subtype="Minting" />
        <Research Type="ResearchDefinition" Subtype="Minting"/>
    </Definition>
    This adds the minting research, without clobbering the default! :)

    Might be nice if that were documented somewhere.
     
Thread Status:
This last post in this thread was made more than 31 days old.