Is this still limited to servers?

Discussion in 'Empyrion API' started by LiftPizzas, May 26, 2019.

  1. LiftPizzas

    LiftPizzas Rear Admiral

    Joined:
    Sep 28, 2015
    Messages:
    1,444
    Likes Received:
    2,574
    Just wondering, in the yaml it says there's a "Client" option. Can mods be used in a single-player game without running a dedi?
     
    #1
  2. Xango2000

    Xango2000 Captain

    Joined:
    Jun 15, 2016
    Messages:
    385
    Likes Received:
    202
    API 2.0 can be used in single player.
    It's still a work in progress so many of the features from API 1.4 haven't been implemented yet.
     
    #2
  3. Taelyn

    Taelyn Guest

    The old API wont work in SP. If you want mods to work in SP you need to convert them to the new API. We wont add the old API to the SP API

    For old mods this means that they have to be rewritten. If the mod owner doesnt want to do that then that mod wont work in SP

    Mods in SP also only work with EAC off, we will see if we can get it with EAC on working
     
    #3
  4. LiftPizzas

    LiftPizzas Rear Admiral

    Joined:
    Sep 28, 2015
    Messages:
    1,444
    Likes Received:
    2,574
    Yeah I never use EAC since I only play SP or with friends who aren't going to cheat.

    I can't get empyrion to recognize the demomod dll. Where am I supposed to put it? I'm currently trying in
    C:\Program Files (x86)\Steam\steamapps\common\Empyrion - Galactic Survival\Content\Mods\ModName

    Also:
    - Is there an example that works in SP so I can go from there?
    - Is there some sort of console message or other indication that a mod has been successfully loaded, or an unsuccessful attempt was made?
    - Does the .dll have to have the same name as the folder?
    - Does the namespace have to be anything specific?
    - Does the info.yaml have to have a specific filename or any yaml will be shown as an info file? (Does contents of this show up in game somewhere?)
    - How do I tell (in Visual Studio) which API a mod is using? (I'm guessing the legacy will use different references.)
     
    #4
  5. Taelyn

    Taelyn Guest

    Empyrion - Galactic Survival\Content\Mods\DemoMod\DemoMod.dll
    Empyrion - Galactic Survival\Content\Mods\DemoMod\DemoMod_info.yaml

    open the info file and change : ModTargets: none to ModTargets: Client (if its already set to client then let it be)

    Startup EGS > Start a SP Game > Open Chat > Type in SERVER the word "echo" without "

    Result it should say something back to you :)


    The DemoMod is the example. Its highly experimental

    1. We dont recoment to write mods yet since the API will change in the next updates
    2. the LegacyAPI doesnt work in SP and wont get to work either


    there will be a small guide later (what will contain all calls but not how to code) but for now we dont explain it yet since we advice people to leave the API alone for now


    Yes the dll needs afaik be the same name as the folder

    We wont provide a full example. The DemoMod is all we provide the source code comes with the mod you can take a look from there

    All folder names, dll name, info file name need to be the same that name reflects to the namespace

    Example if your namespace is test then the dll, folder and info file should have the name test (Info file will be then test_info.yaml)

    The DemoMod will give some message in the Client log i believe. But it depends if logging is enabled inside the mod + how the mod loads. For instance if the mod loads on the PlayfieldServer the log will be inside the playfieldserver.log and not the dedicated.log

    Hope this helps you :)
     
    #5
    LiftPizzas likes this.
  6. LiftPizzas

    LiftPizzas Rear Admiral

    Joined:
    Sep 28, 2015
    Messages:
    1,444
    Likes Received:
    2,574
    Thanks, I got it to work. :)

    Since you guys are adding SP and there's no text output like on the dedi window, it would be really nice to get a list of loaded mods. (Bonus if they can be chosen for a particular save/game.)

    BTW the popup doesn't happen. This line doesn't execute:
    ModApi.GUI.ShowGameMessage("The demo mod says 'Hello' :)", prio: 1);

    I'm guessing that's a missing functionality, but just FYI in case it is supposed to be working. (I was able to get chat messages to fire from the Game_Update event.)
     
    #6
  7. Taelyn

    Taelyn Guest

    We know about that line doesnt work :)

    you mean a list of mods in game that shows? Or the log file?
     
    #7

Share This Page