API FAQ

Discussion in 'Empyrion API' started by Xango2000, Apr 27, 2017.

  1. Xango2000

    Xango2000 Captain

    Joined:
    Jun 15, 2016
    Messages:
    385
    Likes Received:
    202
    I could have swore I tried that. I've been working on figuring that out for the last 3 days
     
    #41
  2. Nyfaria

    Nyfaria Ensign

    Joined:
    Feb 12, 2017
    Messages:
    14
    Likes Received:
    0
    Anyone know how i can Check if someone has a BP "started" in their factory?
    i basically want to do this:
    Pseudocode:
    if(BPStarted = True)
    {
    do something
    }
    else
    {
    so something else
    }
     
    #42
  3. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    In the PlayerInfo event you get the bpInFactory and those that are in finished (producedPrefabs). Its just the names of the BP, so if there is a name in, they started a BP.
    You also get the bpRemainingTime.
     
    #43
  4. Xango2000

    Xango2000 Captain

    Joined:
    Jun 15, 2016
    Messages:
    385
    Likes Received:
    202
    Q: does CmdId.Request_Player_List work?

    A: Yes
    Code:
    GameAPI.Game_Request(CmdId.Request_Player_List, (ushort)CmdId.Request_Player_List,  null );
    
    You get an event response, use it like so
    Code:
    IdList PlayerIDs = (IdList)data;
    
    Edit: Found my error, corrected my post
     
    #44
    Last edited: Aug 3, 2017
  5. <Darth Sidious>

    <Darth Sidious> Lieutenant

    Joined:
    Jul 4, 2017
    Messages:
    57
    Likes Received:
    25
    How can I get information that the structure has been removed from the server? How to find out the reason for the deletion? decored, wiped, deleted?
     
    #45
  6. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    You can use the Event_Statistics
    'StructDestroyed = 4,// int1: structure id, int2: type (0=wipe, 1=decay)

    Another way is to keep all structures in memory and compare them to what you get from the game.
     
    #46
  7. SilvRav

    SilvRav Moderator

    • Moderator
    Joined:
    Jan 13, 2017
    Messages:
    539
    Likes Received:
    882
    How can i display a message if a player enters an area (co-ordinate parameters) that will tell the player you have now entered, lets say, the trading area and its a no fire zone
     
    #47
  8. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    You can check his coordinates every x seconds and set for yourself a coordinate range that you say is a trading zone. Then you send him a message.
     
    #48
  9. <Darth Sidious>

    <Darth Sidious> Lieutenant

    Joined:
    Jul 4, 2017
    Messages:
    57
    Likes Received:
    25
    How to learn the structure's ownership of a player or NPC, how to find out the name of the creator? this information is in dat files, but it can not be obtained through api?
    It would be nice if you expand the amount of data in GlobalStructureInfo
    byte core (0 - no, 1 - the core of the player, 2 - admin core, 3 - alien core, 4 - admin alien core)
    and
    PlayerInfoSet
    byte origin (player origin)
    int permission (permission)
     
    #49
  10. Jascha

    Jascha Administrator

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

    Thats all available over the API.
    You have the factionGroup
    Faction = 0
    Privat = 1
    Alien = 2
    Public = 10
    None = 12
    Decored = 255
    and factionId
    which gives you the Id of the player or faction.

    The Creator is also easy if you just remember the owner the first time the structure was read.


    I'll add that to the list. thanks
     
    #50
  11. <Darth Sidious>

    <Darth Sidious> Lieutenant

    Joined:
    Jul 4, 2017
    Messages:
    57
    Likes Received:
    25
    I just do not like the standard mechanism for removing structures when the player is inactive. And the cases with the loss of the building immediately after the removal of the core, generally got it, I already thought of it and started to do it, but I stumbled into the fact that I can not distinguish POE from the player) keep the table of all POE IDs - which is not very good)
     
    #51
  12. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Why dont you turn it off (not API related topic btw)

    This will be adressed in an update (also not API related)

    not sure what you mean. The data the API gives is very clear about the owner.
     
    #52
  13. <Darth Sidious>

    <Darth Sidious> Lieutenant

    Joined:
    Jul 4, 2017
    Messages:
    57
    Likes Received:
    25
    I mean that the structures initially belong to POI alien, then they can capture the player or destroy the core. And these structure should not be destroyed. They need to update. If the structure selected refresh, then there can only destroy the core, but still need to exclude from deletion. I need to determine a player created building or it was installed originally as a POI.
     
    #53
  14. <Darth Sidious>

    <Darth Sidious> Lieutenant

    Joined:
    Jul 4, 2017
    Messages:
    57
    Likes Received:
    25
    You really need the TeleportToStructure command (int entid, int structid, string nameofdevice = "") where nameofdevice is the device name of the selected structure
    this command must teleport the player with the selected id to the structure with the specified id to the device with the given name. For example in a clone chamber or medical capsule.
     
    #54
  15. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    that might be difficult if there are more then one device of it. But I will note the request
     
    #55
  16. <Darth Sidious>

    <Darth Sidious> Lieutenant

    Joined:
    Jul 4, 2017
    Messages:
    57
    Likes Received:
    25
    if there are several devices, even selects the first, as is now happening in the teleport or when it appears in the medical station
     
    #56
  17. SilvRav

    SilvRav Moderator

    • Moderator
    Joined:
    Jan 13, 2017
    Messages:
    539
    Likes Received:
    882
    ok find the location to do it in the EAH tool :)
     
    #57
  18. sillyrobot

    sillyrobot Captain

    Joined:
    Aug 21, 2016
    Messages:
    153
    Likes Received:
    370
    Q: From a brief scan, it looks like the API is designed to support server-side mods. Is this correct?

    Q: If that is correct, is there current or planned support for client-side mods?
     
    #58
  19. Jascha

    Jascha Administrator

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

    Not yet. But why/for what would you need it?
     
    #59
  20. sillyrobot

    sillyrobot Captain

    Joined:
    Aug 21, 2016
    Messages:
    153
    Likes Received:
    370
    A few places spring to mind:

    • adjusting game behaviour away from norm -- for example, closing a dialog (constructor or cargo box inventory) when an attack is detected
    • adding a tool to help guide the player in making choices -- for example, what components in the inventory will best fulfil the factory's requirements? Which ones even offer the correct resources?
    • augmenting available on-screen information to cope with player deficiencies -- for example, putting a dark grey box behind white-on-white text in the mini map or dark red-on-black in space, changing colours or providing a different cue to help with colour blindness
    • tracking time-limited messages (gathered, xp, whatever) for later review
     
    #60

Share This Page