Library Support for Mods, and ModID Suggestion

Marco Zechner shared this feedback 17 days ago
Not Enough Votes

# Library

Allow easier reference/usage of other mods in mods.

If another modder makes a UI Library Mod that makes it easier to create custom UI elements for our mods, it would be cool to use it like any library.

And btw. keen, please provide a Modding API for Hud Elements. I want fancy Hud Elements/Icons for my mods, but SE1 doesn't make that easy.

The current situation is that if I want 2 mods to work together, (like my mod using a HUD Framework) then I need to copy some "shared" code (classes) from the other mod into my mod, so both mods have the same structure which can be sent over SendModMessage or something.


It would be much better if I could just write

using OtherModderNameSpace.ModName;
Assuming the other Modder defined "OtherModderNameSpace.ModName" as his namespace. 

This would keep mod projects so much simpler, and the original modder could still change stuff in his mod and implement new behavior without me needing to change anything in my code (as long as he kept the method heads that I used the same (but the method body doesn't matter anymore)

I know this system could cause some conflicts like if 2 mods use the same namespace and then try to define a class with the same name each. But this could be solved by either just trusting the modders to keep a good standard and using unique names like "modder.modName.subsection" to prevent that, or enforcing that a mod namespace contains its own modID. "modder.modName{modID}.subsection" or "modName{modID}.subsection"

could be done by just looping over all namespaces provided by the mod and checking if the modID is contained in it.


# ModID

And since we are talking about the ModID.

Steam already provides a unique ModID for each Mod, please let's use this ID universally for everything.

Server/Client communication on a channel? No more guessing if the channel I chose is free, just get and plug in my own Mods ModID.

Mod to Mod communication?

Just look up the ModID on Steam and use that ID

In SE1 that is not always possible since the channel uses "long" and I guess SteamID uses "ulong" so we would have to shift everything.


Besides that also enforces that if a mod opens a channel (Client/Server or Mod/Mod) it needs to register that channel with its name&SteamID and any other loaded mod can find that registered Channel and also figure out which other mod created it.

This would save so much headache if you have multiple mods installed and get a "malformed package" on your mod (which means that another mod sends some stuff that your mod doesn't know how to deal with) then I could see which of the other installed mods send it and contact that mod developer if am of the opinion that our mods need to be compatible.


In Summary, it would just be great if we had a system that clearly defines each mod, makes them all accessible from other mods so easily detect which other mods are active, and for any system where we need channels/IDs we should just use ONE clearly defined, for each mod unique, number to avoid collisions. The Steam WorkshopID for each Mod just offers itself here, since it is already unique and neither we nor Keen will have to keep track of which numbers are already taken.


Ps: (if there will ever be another workshop, like ModIO for example, make sure that the same mod on Steam & ModIO gets the same ID


I think that is everything. More opinions from other ModDevs welcome, maybe I missed something

Leave a Comment
 
Attach a file