Results 1 to 10 of 10

Thread: [ GUIDE ] Mod and Modlet Naming Conventions for A17+

  1. #1
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,724
    Rep Power
    1

    [ GUIDE ] Mod and Modlet Naming Conventions for A17+

    With the introduction of modlets and the ability to mix and match mods together, it's been discussed that there may be conflicts that will arise if proper care is not taken. These guidelines are based around the modlet concept, where the code is distributable and can be re-used in many different mods.

    With the id system for items and blocks dropped, uniqueness is now based on the block and item name. The system may not throw an error when a duplicate name occurs, but it appears that the last item and block loaded with the shared name, will take priority over earlier references.

    This post will outline some best practices to help modders avoid possible mod conflicts.

    Here are some of the guidelines to help you come up with a unique naming convention for your mods. Some mods may be able to use one method, while others would use another.

    1) Use the mod name as a unique identifer. This identifier should carry forward through your folder name, and a prefix to items, recipes, windows, and asset bundles

    Example:
    Mods/ScrapMetalTools/
    <item name="scrapMetalTools_Axe">
    <item name="scrapMetalTools_Pickaxe">
    <item name="scrapMetalTools_Shovel">

    This goes for adding new XUI elements as well.
    Mods/ScrapMetalTools/
    <window name="ScrapMetalTools_windowJournalList" />
    <window name="ScrapMetalTools_windowTrader" />

    Asset Bundles and item icons as well

    Mods/ScrapMetalTools/Resources/scrapMetalTools_Axe.unity3d
    Mods/ScrapMetalTools/ItemIcons/scrapMetalTools_Axe.png

    Folder name examples:
    Mods/SphereII_WinterProject/
    Mods/RyanJames_WinterProject/
    Mods/SMXmainMenu/
    Mods/SMXhud/

    2) Avoid using excessive abbreviations

    Some mods will be expected to be used a lot in other mods, with some tweaks done each time. It's best to be clear on your named values to make these changes easier. The less questions you have to deal with, with regards to your naming convention, the easier your support efforts will be.

    3) Avoid removing nodes, or changing them drastically, unless its critical to your mod design

    Avoid making assumptions that make changes beyond the expectations of the mod. For example, if you are adding scrap tools, don't make the assumption that stone tools need to be removed, or that iron and steel tools need to be radically adjusted to allow them to fit. Nor would we expect food values change in a scrap tool modlet.

    If you are designing a UI, avoid making an assumption that your UI may be the only one installed. Some may want the menu system to look different than your design. In this case, make two mods: One for the UI, and one for the menu.

    4) Avoid prefacing the mod name by using numbers

    The load order of the mods is currently alphabetical, with the bottom of the list taking priority over any previous changes. A player or modder applying a modlet would be responsible for adding any kind of numeric number or changing the mod's folder to change the load order they so desire.

    Example:
    Mods/AnotherFakeClub/ - Changes stone axe to be a club
    Mods/FakeClub/ - Changes stone axe to be a torch

    Result: The stone axe will be a torch.

    Another Example:

    Mods/0_FakeClub/ - Changes stone axe to be a torch
    Mods/1_AnotherFakeClub/ - Changes stone axe to be a club

    Result: The stone axe will be a club.

  2. #2
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    22,505
    Rep Power
    1
    Please sticky.

  3. #3
    Tracker
    Join Date
    Aug 2016
    Posts
    213
    Rep Power
    1
    I would also suggest using the mod name as the root node tag for all your xml xpath entries.

  4. #4
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,724
    Rep Power
    1
    Quote Originally Posted by Buggi View Post
    I would also suggest using the mod name as the root node tag for all your xml xpath entries.
    I've heard this, but I haven't seen any solid examples of it being long term viable and flexible enough for people.

    If you have a mod with a space in it, you'd have to remove the spacing. <SphereIILootContainerOverhaul> is kind of wordy, for no real benefit. I don' t even think the game sees or uses the root node for anything other than conforming to XML standards.

    I've always felt it was more natural to have a consistent node structure, which reduces possible typos in your root nodes.

  5. #5
    Survivor Myrrah's Avatar
    Join Date
    Dec 2018
    Posts
    64
    Rep Power
    0
    Quote Originally Posted by sphereii View Post
    4) Avoid prefacing the mod name by using numbers

    The load order of the mods is currently alphabetical, with the bottom of the list taking priority over any previous changes. A player or modder applying a modlet would be responsible for adding any kind of numeric number or changing the mod's folder to change the load order they so desire.

    Example:
    Mods/AnotherFakeClub/ - Changes stone axe to be a club
    Mods/FakeClub/ - Changes stone axe to be a torch

    Result: The stone axe will be a torch.

    Another Example:

    Mods/0_FakeClub/ - Changes stone axe to be a torch
    Mods/1_AnotherFakeClub/ - Changes stone axe to be a club

    Result: The stone axe will be a club.
    For this to apply in game (alphabetical rules) do you need to just change the name of the mod folder or the name of the mod itself to load last if you are wanting to be sure a certain mod takes priority over any other mod that may alter the same item/entity?

  6. #6
    Colony Founder sphereii's Avatar
    Join Date
    Dec 2015
    Posts
    3,724
    Rep Power
    1
    Quote Originally Posted by Myrrah View Post
    For this to apply in game (alphabetical rules) do you need to just change the name of the mod folder or the name of the mod itself to load last if you are wanting to be sure a certain mod takes priority over any other mod that may alter the same item/entity?
    Folder, I believe.

  7. #7
    Survivor Myrrah's Avatar
    Join Date
    Dec 2018
    Posts
    64
    Rep Power
    0
    Quote Originally Posted by sphereii View Post
    Folder, I believe.
    awesome. thank you for the info

  8. #8
    Ranger
    Join Date
    Oct 2018
    Location
    Boston
    Posts
    346
    Rep Power
    0
    Has anyone given any thought about how modlet dependencies will be handled?

    For example, I'm hoping that someone will restore the A16 NPCs in a modlet. But, let's say I wanted to alter the behavior of that modlet, say by adding additional AI.

    My modlet would be dependent upon the other modder's NPC modlet, but I'm not sure how that would be represented.

  9. #9
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    22,505
    Rep Power
    1
    Either include it, following the mod rules posted, or specify that it requires the prior modlet?

    Sounds good to me.

  10. #10
    Refugee
    Join Date
    Nov 2017
    Posts
    24
    Rep Power
    0
    My suggestion would be that if you are modding someone else's mod, name your mod directory after theirs, and append your own name...

    so if I named my mod AvimodsAI, you could name yours AvimodsAIKHZModlet or something like that. it would ensure it gets loaded after without having to be too contrived, so people don't name all their mods ZZZMod or something like that just to create priority.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •