API Methods Request

Discussion in 'Empyrion API' started by cmwhee, May 19, 2017.

  1. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    I would like the ability to:

    Spawn alien CVs in a playfield from blueprint (with drone carrier behavior)
    Spawn alien space stations in a playfield (With drone base behavior)
    Detect when a CV/Space station was destroyed
    Conquer a base (swap its faction to alien, kill all associated neutral NPCs and begin spawning Alien NPCs)
    List all Playfields
    List all structures on a playfield
    Assert that a structure is a drone base with specified properties

    If I had this, then I could implement everything needed for suggestion here:

    http://empyriononline.com/threads/enemy-escalation.11229/
     
    #1
  2. joemorin73

    joemorin73 Captain

    Joined:
    Aug 24, 2016
    Messages:
    319
    Likes Received:
    170
    You have the ability of about half of your list.

    The API currently supports the following through various requests and events:
    The following are the only missing:
     
    #2
  3. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    really? you can set a structure to alien and swap out its spawner behavior?

    what is the protocol for that?

    Also, I don't know how you would set the drone base property with an API request
     
    #3
  4. joemorin73

    joemorin73 Captain

    Joined:
    Aug 24, 2016
    Messages:
    319
    Likes Received:
    170
    I believe you can set a structure to alien, but you can not modify block behaviour in a structure.

    I also didn't notice the assertion for drone bases. I don't believe that is available.
     
    #4
  5. huhlig

    huhlig Captain

    Joined:
    Nov 5, 2015
    Messages:
    12
    Likes Received:
    20
    While were requesting Features. Can we get the following added to each data class:

    Code:
    public string ToString() { return String.Format("{0}<{1}>", this.GetType().FullName, JsonUtility.ToJson(this)); }
    JsonUtility is part of UnityEngine BTW.
     
    #5
    Daede likes this.
  6. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    Whoa. That makes my life slightly easier. Beilieve it or not, I never considered looking into unityengine for utilities.
     
    #6
    Daede likes this.
  7. huhlig

    huhlig Captain

    Joined:
    Nov 5, 2015
    Messages:
    12
    Likes Received:
    20
    Yep, basically when you build you can include everything in unityengine.dll, mif.dll, and protobuf-protocol.dll for free since the game already loads them. I've started working on an API bridge to make people able to write plugins in python and reload them without bouncing the server. and being able to spit out json is incredibly helpful.
     
    #7
    Xango2000, Dietrich and Daede like this.
  8. Xango2000

    Xango2000 Captain

    Joined:
    Jun 15, 2016
    Messages:
    385
    Likes Received:
    202
    My Hero! All I know is Python.
     
    #8
    Daede likes this.
  9. huhlig

    huhlig Captain

    Joined:
    Nov 5, 2015
    Messages:
    12
    Likes Received:
    20
    I will need beta testers once I get baseline functionality in place.
     
    #9
  10. Xango2000

    Xango2000 Captain

    Joined:
    Jun 15, 2016
    Messages:
    385
    Likes Received:
    202
    I volunteer!
     
    #10
  11. piddlefoot

    piddlefoot Rear Admiral

    Joined:
    Mar 4, 2015
    Messages:
    1,849
    Likes Received:
    1,615
    Awesome !
     
    #11
  12. Alexandra

    Alexandra Ensign

    Joined:
    Apr 9, 2017
    Messages:
    22
    Likes Received:
    2
    I use your API plugin ;) I'm tester! )))
     
    #12
  13. Furious Hellfire

    Furious Hellfire Rear Admiral

    Joined:
    May 3, 2017
    Messages:
    644
    Likes Received:
    2,402
    Heya guys, with this api system and empyrions current code.
    Is it a possibility to create timer events.
    Any api function that can record say, the time it took a player to get from point a to point b, and to list that time publically ?

    Seeing more and more ideas for race tracks or races, and such an event would be good for recording the results.
     
    #13
  14. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Hey,

    with the Coordinate request you should be able to do that. There is no Timer itself yet. But that should be easy to manage over a mod.
    Our EAH tool for example has a coordinate log that logs the coordinates of each player and structure every x seconds. Out of such data you could calculate possible speed and so on.
     
    #14
    Furious Hellfire likes this.
  15. Furious Hellfire

    Furious Hellfire Rear Admiral

    Joined:
    May 3, 2017
    Messages:
    644
    Likes Received:
    2,402
    Ahh thats good to know, captain jack will be pleased XD

    Thank you jascha.
     
    #15
  16. <Darth Sidious>

    <Darth Sidious> Lieutenant

    Joined:
    Jul 4, 2017
    Messages:
    57
    Likes Received:
    25
    how did you limit the possibility of entering the planet of belonging to a faction? It is possible to catch the event on the server through the API?
     
    #16
  17. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Hey,
    yes just request a player update or use one of the events Player Changed Playfield or EnityPlayfield changed (names might be different). The rest you have to build manually.
     
    #17
  18. Xango2000

    Xango2000 Captain

    Joined:
    Jun 15, 2016
    Messages:
    385
    Likes Received:
    202
    good question
    I imagine you could grab the player coordinates of when they change playfields
    then teleport the player back to those coordinates when you detect that they are on an "invalid playfield"
    you could probably check periodically using ticktime.
     
    #18
  19. <Darth Sidious>

    <Darth Sidious> Lieutenant

    Joined:
    Jul 4, 2017
    Messages:
    57
    Likes Received:
    25
    I'm yet to understand )
    but I would very much like to catch the event, not to allow to teleport )
     
    #19
  20. <Darth Sidious>

    <Darth Sidious> Lieutenant

    Joined:
    Jul 4, 2017
    Messages:
    57
    Likes Received:
    25
    I understand that there is no method to edit the equipment and settings of the player offline?
     
    #20

Share This Page