Modding Support (502898)

Is it possible to integrate modding into Unity 4? I mean, I need to be able to load resources from outside of main asset files. Also, I will really need to have some kind of scripting, which works with release builds of the game. I’m thinking about deploying some kind of game API, binded to some scripting language, like LUA. Users would be able to write code which would access game systems, through that API. Is that doable, I mean reliably, for production purposes?

I researched this a bit.

Lets say, I would build a custom C# assembly and put it outside my Assets folder. I would then have to load it somehow without Resource.Load. I can use WWW class for loading most other assets. This kind of setup would, in theory, allow me to have scripts (C# assembly) and data (models, png etc.) outside of main resource bundles. Can this be done?

Essentially, what I want is an ability to create full mods, with data and scripts, which users would be able to plug-in by copying files to appropriate folders.

BTW, can WWW class load models? In examples it loads some PNG, but I’m not sure what other types of assets it can load.

WWW can load PNG and JPG. You can load any kind of file other than those, but you need to write or buy (if it exists) an importer for it.

–Eric

LOL, at first when I stumbled upon Unity 3D, I thought you can make a full game by just clicking in the editor. Now, when I’m getting deeper into it, I start to get this DIY C++ feel. XD

You cant make anything functional with clicks only. You need at least behaviour scripting.

One more thing.

Can I use System.Reflection.Assembly.Load to attach an assembly which is outside of the Assets folder? The key thing is, I want it to be OUTSIDE of Assets, so that I can bring in new assemblies without building in Unity.

I’m thinking about something like this. Main game folder:

Data
Mods
Game.exe

In the Mods folder would be “Something.dll”, which would load at run-time, enabling new functionality through mod. Something.dll would be built against API exposed by my game in Mono. Doable?

1 Like