Simplified Mod API Framework

Discussion in 'Empyrion API' started by cmwhee, Mar 13, 2018.

  1. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    Hey everyone,

    I've been working on a couple of mods, and I found that it was kind of hard to work with the API in it's original form, so I made a framework to make it a lot easier

    https://github.com/lostinplace/EmpyrionAPITools

    The upshot is, strongly typed API requests with callbacks, and native C# event management.

    I implemented it using T4 templates, so if the API changes, it will be really easy (1-2 lines of simple code) to update.

    Let me know what you think! If there's a demand I might set up a stream to walk through creating an Empyrion mod.
     
    #1
    Ephoie, ASTIC and Exacute like this.
  2. Len Auphydas

    Len Auphydas Ensign

    Joined:
    Mar 24, 2018
    Messages:
    3
    Likes Received:
    0
    Hi!
    I'm interested, but, I don't know how moddable the game is and it kinda depends on that. For now I'm kinda holding off until theres more information available and hopefully more tools to work on modding with.

    but since you've been modding already I'd like to ask just a couple of questions. 1) is it possible to make regenerating blocks 2) is it possible to make armor that consumes energy?

    ...sorry if these are stupid questions I like, just started playing the game so I dont know much.
     
    #2
  3. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    Hey there, You're right, the mod API is pretty limited at this point but there's just enough that a lot of things that people want may be within reach.

    So to start off, regenerating blocks isn't really possible, since none of the APIs allow access to specific blocks on structures/ships. It would be super cool if we had access to that level, maybe in the future.

    Regarding armor, Can you clarify what armor you mean? If you're talking about personal armor, that's not quite within reach, but I can think of a few ways you might be able to simulate it. If you're talking about ship / base armor, yeah, I'm pretty sure that's achievable using the EnergyIn of the blocks, but I haven't tried that myself.

    Let me know if I can help!
     
    #3
    Ephoie likes this.
  4. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    456
    Likes Received:
    307
    That's nice. I was considering doing something similar at a point, but got sidetracked. Cheers for doing it! ;)

    Looks like a decent start on a project like this :)
     
    #4
    Ephoie likes this.
  5. Len Auphydas

    Len Auphydas Ensign

    Joined:
    Mar 24, 2018
    Messages:
    3
    Likes Received:
    0
    if you cant modify specific blocks, then how do you affect their energy consumption....?
     
    #5
  6. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    456
    Likes Received:
    307
    Okay. So there's two different things:
    -Blocks and how they work
    -Blocks and how they are used (blueprint)

    The first, you can adjust in the config.ecf file.
    The second, you'd have to be able to manipulate the blueprint files.
    Geostar have made an attempt at that, but it is neither real-time (ingame) (it only adjusts the *blueprint*, not any spawned structures), nor bulletproof. It's the best we got atm tho.
     
    #6
    Ephoie likes this.
  7. Len Auphydas

    Len Auphydas Ensign

    Joined:
    Mar 24, 2018
    Messages:
    3
    Likes Received:
    0
    ok. More API's are being added though, right? like, hopefully we'll get it sometime?

    I want to make biomechanical ship blocks that self-regenerate at the cost of energy.
     
    #7
  8. Joyful Dreamer

    Joyful Dreamer Ensign

    Joined:
    Aug 24, 2019
    Messages:
    1
    Likes Received:
    0
    Keep up the good work. I may try this very soon. I noticed you have an Alpha 10 branch; good stuff. ;) do you know to what extent we can modify the game? For example, is it possible to have conversations with NPCs? Not sure if there is any dialogue system. Just wondering, if one was creative enough, to what extent we can modify a custom server with custom game logic. Seems we can affect about as much as anyone could through the console only.
     
    #8
  9. Mortlath

    Mortlath Commander

    Joined:
    Jul 26, 2017
    Messages:
    49
    Likes Received:
    26
    #9
    Ephoie likes this.
  10. Dreuseff

    Dreuseff Lieutenant

    Joined:
    Jan 13, 2017
    Messages:
    24
    Likes Received:
    31
    Wow! This is sexy! Are you still committed to this project or should I use the GitHub-TC fork?
     
    #10
  11. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    993
    Likes Received:
    707
    #11
    Dreuseff likes this.
  12. imlarry425

    imlarry425 Captain

    Joined:
    Jan 10, 2019
    Messages:
    460
    Likes Received:
    338
    Hello @ASTIC, after looking at your EmpyrionNetAPIAccess framework I've been doing my first request/response ModGameAPI dedi interface code using it. A big "me too" on the previous "Wow!"

    There were a couple of changes since the original readme.md (I'll take a cut at a readme.md revision and issue a pull request once I get everything working as described- just little stuff like "SimpleMod" changing to "EmpyrionModBase" and calling out the local package directory dependency (I didn't have an F: on my machine) sorts of stuff.

    The hello world example that sends a Request_InGameMessage_AllPlayers(msg) Hello on player_connect is working from a co-op test but I can't get the MSBuild.ILMerge.Task described in the readme to work. I keep getting...

    ILMerge.Merge: ERROR!!: Duplicate type 'UnityEngine.MovieTexture' found in assembly 'UnityEngine.AudioModule' from the MSBuild.ILMerge.Task

    ...and there are no explicit unity references anywhere I can find. Guessing they are buried in Mif or ModAPI (or maybe in both? => dups?)

    Have you run into this? Not sure what the fix is, but bundling the dlls into a single file would be a big deployment simplification over copying everything from bin into the mod folder. Any pointers greatly appreciated.
     
    #12
  13. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    993
    Likes Received:
    707
    Set all external EGS references to "CopyLocal=false", because they can/must be loaded at runtime and must not be fixed in the DLL via ILMerge.
     
    #13
    imlarry425 likes this.

Share This Page