Search Unity

Unity-Modding through C#

Discussion in 'Documentation' started by Houzi2004, Jan 23, 2019.

  1. Houzi2004

    Houzi2004

    Joined:
    Jan 15, 2019
    Posts:
    14
    Hello all,
    I apologize if this is not the correct forum for this thread, but it seems to encircle everything I have in mind.

    First: Modding (In General)
    I have a game idea that I think would only be interesting past vanilla play to users that can create/install mods to further enhance gameplay. However, as unity does not have an explicit way to incorporate modding, I'm not sure of how to go about this.

    Second: UCompile+Loading Scripts
    I have tried running scripts in UCompile following the directions listed but it does not work, I think it may have something to do with having been built on the previous .NET framework that is deprecated, but I'm not sure.
    So, my question would be: Is there an easy way to get Unity to load external C# assemblies at runtime? Right now I can't find anything that would work.
    I am looking for a somewhat simple way to do this so that modders have an easier time as well.

    If it helps:
    The kinds of content I would need to implement are new entities, functions, graphics and possibly sound.

    Edit: I can also give the specific UCompile error if necessary, if there is a fix that would be awesome.

    Any help is appreciated.
    CJ
     
  2. Houzi2004

    Houzi2004

    Joined:
    Jan 15, 2019
    Posts:
    14
    Another addition:
    I've seen games made in C++ that use Lua as a modding tool, and this seemed straightforward to me. However, I am not interested in using C++; C# is my language, and I am wondering if it is possible to use Lua integrated with this language and if so how complex.
    Thanks again.
     
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Yeah, Lua is pretty common. There's a ton of Lua implementations for Unity/C#, if you google for "Unity Lua" you'll get quite a few results.

    Haven't used any of them, so I can't vouch for them.

    The Lua approach will probably be a lot easier to handle for modders, and a lot lot easier for you to implement.
     
  4. Houzi2004

    Houzi2004

    Joined:
    Jan 15, 2019
    Posts:
    14
    Thanks, I wasn't sure if Lua could be supported. A quick google gave me this:
    http://www.moonsharp.org/
    ... and it looks like a pretty useful asset. Also luckily it is available in the unity asset store for free. I'll read up on it and see what more it can do.