[tutorial] How To Set Up For Modding in Custom IDEs (A10)

Discussion in 'Empyrion API' started by JCD, Jun 24, 2019.

  1. JCD

    JCD Lieutenant

    Joined:
    Jun 4, 2019
    Messages:
    14
    Likes Received:
    7


    Description from YouTube:

    This video shows how to setup a modding environment for Empyrion: Galactic Survival using the new modding API released in Alpha 10 with Visual Studio 2019. The included Demo module that comes with the game only works in the older 2017 version of the Visual Studio, so you will need to remake it from scratch if you want to use a different IDE. It is also possible to set up for modding in other IDEs as well, as long as you follow the steps described in post #7 on this page: tinyurl.com/demomodempytut

    Note that in this video, I use Notepad++ to copy the source files from the Demomod included with the game. Any text editor like Notepad will work fine.
     
    #1
    Jascha likes this.
  2. JCD

    JCD Lieutenant

    Joined:
    Jun 4, 2019
    Messages:
    14
    Likes Received:
    7
    I have heard that some people have gotten the demomod working fine in 2019. However, this is very much system dependent as well, so you may or may not have trouble. If you have any questions please ask in this thread, and I will try to help (or someone else can help).

    The first parts of this video are blurry. Not sure why, but it gets clearer after a bit (0:12) so just keep watching. I do many important steps in this video, such as setting up the startup projects, and following name requirements for the classes and namespaces. Be sure you take note of things like that while watching.

    If you are wondering about the names:
    1. Class names need to be the same name as the dll. There can only be one mod class per dll. The dll name is the project's name by default.
    2. Generally, its a good to make all your mods share the same namespace. You can even make sub-namespaces for separate mods you make, if you choose.
    (If I got anything wrong, please point it out to me and I will fix the errors.)
     
    #2
    Last edited: Jun 24, 2019
  3. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    226
    Um, the video is no longer available for some reason.
    Looking for some basic getting started steps.
     
    #3
  4. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    993
    Likes Received:
    707
    maybe my git repros help you a litte bit
    https://github.com/GitHub-TC
     
    #4
  5. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    226
    I have been looking at the repos, damn, coding skillz. Getting ones head around the API surface area without a rough guide to get you going must be hard work enough. I am confused by the youtube clip got taken down/moved, but any kind of hello world would be appreciated. I stopped coding for a living a few years ago and have very little C# experience. The amount of fuzz for someone new to this all is a bit much to get a picture of how to get started.


    Some of the older docs talk about a C++ interface, and others (.\Empyrion - Galactic Survival\Content\Extras\Modding Doc)talk about a C# interface, what is the native plugin interface binding to?
    .\Empyrion - Galactic Survival\Client\Empyrion_Data\Managed\Mif.dll ? This is the resources or what is in there?
    .\Empyrion - Galactic Survival\Client\Empyrion_Data\Managed\ModApi.dll This looks like a C# Assembly? Correct? I'm not seeing any C++ style exported entry points there.
    .\Empyrion - Galactic Survival\Content\Extras\Modding Doc - is pretty much only useful to someone who has C# experience, so I'm setting up an environment in VS code blind, because someone said something about a plugin at some point, that it "is" broken, I mean it's a C# project, what other support do people need? Just fighting to get the demo to load because I am still setting up toolchain. which nobody seems to have described up to date notes on.

    I am seeing something about the mods target .NET v4.6.1 ==> https://dotnet.microsoft.com/download/dotnet-framework/net461 . So I need that SDK I gather. I hope I'm heading in the right direction here.

    In vscode I next go dotnet resotre , and at that point, I get lost because i dont know what is in the proejct (demomod) and how to add the references to the 2 mod api dlls' sicne I am not getting any "easy mode menus". I thus ? have to know what to type or edit into the solution files by hand I guess?
     
    #5
    Last edited: Feb 27, 2020
  6. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    993
    Likes Received:
    707
    It's all in .NET whether you use VB.NET or C # doesn't matter.
    You integrate the (old) API with Mif.dll and you can find a document here https://empyrion.gamepedia.com/Game_API
    Important: This only works in a server setting - you have to set up a local EGS server.
    You get the (new) API with ModAPI.dll and you can find the documentation / demo mod in the game directory.
    Use the .NET 4.6 as a framework because you have fewer problems with it.
     
    #6
    zaphodikus likes this.
  7. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    226
    Ah, the docs completely failed to mention the bit about modding only being for Servers, so it's impossible to write mods for the single player game?
    l was getting the wrong end of more than one stick , but that document linky does explain a lot. Thanks a tonne for your patience and pointers.
     
    #7
  8. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    993
    Likes Received:
    707
    The new ModAPI works also in SP mode, you have to disable the EAC and have "Single" target in the info yaml for the mod
     
    #8
    Dreuseff and zaphodikus like this.

Share This Page