API Wiki/Documentation support

Discussion in 'Empyrion API' started by joemorin73, Mar 17, 2017.

Thread Status:
Not open for further replies.
  1. Xango2000

    Xango2000 Captain

    Joined:
    Jun 15, 2016
    Messages:
    385
    Likes Received:
    202
    Hope yall don't mind, I've been updating the wiki as I figure things out.
     
    #21
    Mortlath, Jascha and Kassonnade like this.
  2. Nyfaria

    Nyfaria Ensign

    Joined:
    Feb 12, 2017
    Messages:
    14
    Likes Received:
    0
    How does one make this Message a player or faction instead of everyone?
     
    #22
  3. Jascha

    Jascha Administrator

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

    if you are connected with telnet, type help and you get all information. Or if you have the EAH tool, click on the "Help" button and you get all telnet commands.

    Here is what you need:

    Code:
    -----------------
    Command: say
    -----------------
     Sends a chat message to players or factions
     say 'text with blanks'                   -> send a message to all players
     say f:<faction-token> 'text with blanks' -> send a message to a specific faction
     say p:<client-id> 'text with blanks'     -> send a message to a specific player
        (use 'plys' to get client ids)
    
     Examples: say f:Abc 'We deleted the problematic SV'
        say p:3  'I restored your lost HV'
     
    #23
  4. Xango2000

    Xango2000 Captain

    Joined:
    Jun 15, 2016
    Messages:
    385
    Likes Received:
    202
    Use
    Request_InGameMessage_SinglePlayer
    Or
    Request_InGameMessage_Faction

    For more info, try the wiki
    http://empyrion.gamepedia.com/Game_API_CmdId
     
    #24
  5. Nyfaria

    Nyfaria Ensign

    Joined:
    Feb 12, 2017
    Messages:
    14
    Likes Received:
    0
    Nope. That only puts a Message box in the Upper right hand Corner. What Jascha replied with is correct. thanks though.
     
    #25
  6. oshadow

    oshadow Commander

    Joined:
    Dec 10, 2015
    Messages:
    55
    Likes Received:
    21
    Request_Entity_Spawn no longer supports spawn from the directory?

    public class EntitySpawnInfo
    {
    [ProtoMember(1)]
    public int forceEntityId;
    [ProtoMember(2)]
    public string playfield;
    [ProtoMember(3)]
    public PVector3 pos;
    [ProtoMember(4)]
    public PVector3 rot;
    [ProtoMember(5)]
    public string name;
    [ProtoMember(6)]
    public byte type;
    [ProtoMember(7)]
    public string prefabName;
    [ProtoMember(8)]
    public byte factionGroup;
    [ProtoMember(9)]
    public int factionId;
    [ProtoMember(10)]
    public string exportedEntityDat;

    public EntitySpawnInfo();
    }
     
    #26
  7. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Why do you say so? I just tested it, it still works.
     
    #27
  8. oshadow

    oshadow Commander

    Joined:
    Dec 10, 2015
    Messages:
    55
    Likes Received:
    21
    Yes, you are right, spawn from the folder is working fine, but here's to make the spawn work from .dat never happened

    Eleon.Modding.EntitySpawnInfo spawnInfo;
    spawnInfo = new Eleon.Modding.EntitySpawnInfo();
    spawnInfo.forceEntityId = ID;
    spawnInfo.prefabName = Name;
    spawnInfo.exportedEntityDat = ImportDat;
    spawnInfo.pos = pos;
    spawnInfo.rot = rot;
    spawnInfo.factionGroup = facgrp;
    spawnInfo.factionId = facid;
    spawnInfo.playfield = Playfield;
    SendRequest(Eleon.Modding.CmdId.Request_Entity_Spawn, Eleon.Modding.CmdId.Request_Entity_Spawn, spawnInfo);

    returns OK, creates an empty item in the shared folder, in the
    file .txt
    playfield, id, name, type, faction, blocks, devices, pos, rot, core, powered, docked, touched_time, touched_ticks, touched_name, touched_id, saved_time, saved_ticks, add_info
    Tatooine, 12032, 'TEST (SV)', SV, [Private], 0.0, -3659.931 46.16002 -1279.702.0 285.6029 0, False, False, False, 11/14/2017 7:16:08 PM, 238692 , 'Server', Server, 11/14/2017 7:16:08 PM, 238693, REMOVE EMPTY
     
    #28
  9. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Can you give me an example with the exact values of it. Like Name for example. It has to have a certain format.
    Also is the id. is the Id already existing? or did the system gave you the id via Request EntityId?
     
    #29
  10. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    I'm seeing the exact same behavior here, I can provide an example if needed
     
    #30
  11. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    #31
    Last edited: Nov 25, 2017
  12. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    456
    Likes Received:
    307
    So. I need a little help ;)

    I'm trying to determine if *something is a backpack* (ie. dropped on the ground, and the remains of a player)
    From what I can tell, there's two attributes, for PlayfieldEntityList.entities.EntityInfo()
    type, id (from the definition, it seems there's also a third, pos (PVector3))

    I've had a 'quick' look over it, and came up with this:
    https://empyrion.gamepedia.com/Game_API_PlayfieldEntityList
    For my need, I'm really only looking at containers-at-the-ground, so it's far from a complete list.

    From what I can tell, the containers have type:0, and share the same ID-space.
    (no matter if it's a backpack, or 'normally dropped' (not from exploded device-dropped)

    There seems to however, from the ingame 'ents' command be a few differences:
    Their names - One will be named 'Item <id_of_ent>' (dropped)
    Other will be named 'backpack' or 'backpack of <deadplayer>' (I can't quite tell how to trigger the first, but it've happened)
    Aswell as 'normally dropped' seems to have some 'alive' flag, while backpack (from death) have a 'death' flag.

    I can however not find a way to read the entities name, nor these extra data bits.
    Is there a game-request for getting extended information on an entity that I am missing, or anything else?

    As a side-question to this:
    How would you go about getting the inventory-data of an entity? I don't suspect the player get-inventory ones will do the trick?
    (This is non-critical, as I can just every-so-often take a cache of the players gear instead.. But I was wondering, if you can read entity-inventories (such as corpses, and these containers))

    Any help would be appreciated!
     
    #32
    Last edited: Apr 10, 2018
  13. Jascha

    Jascha Administrator

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

    at the moment there is no such request. Also the Entity Request is limited. Actually it should only show a few things like drones. and I think Asteroids where in there too.

    Those would be the possible types (but not all are send yet):
    // Unknown = 0,Player = 1,BA = 2,CV = 3,SV = 4,HV = 5,AstRes = 6,AstVoxel = 7,EscapePod = 8,Animal = 9,Turret = 10,Item = 11,PlayerDrone = 12,Trader = 13,UndergroundRes=14, // EnemyDrone = 15, PlayerBackpack = 16, DropContainer = 17, ExplosiveDevice = 18, PlayerBike = 19, PlayerBikeFolded = 20, Asteroid = 21, Civilian = 22, Cyborg = 23, TroopTransport = 24

    For now its just a basic command. But If you let me know what you need I could put it on the list to adjust that command.

    Only way is to ask for it again and again. Over the Request_Player_GetInventory or Request_Player_Info
     
    #33
    Exacute likes this.
  14. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    456
    Likes Received:
    307
    Ah. I see. Atleast I wasn't blind ;)

    Makes sense. Those would give me the data I'm in need of. I might aswell update the wiki post for those, to save other the trouble ;)

    So, is it correctly understood, that you can use these for regular entities (NPCs, backpacks, POIs even), aswell as player? Perhabs a rename to Request_Entitiy_Info would be proper? (Or just have it as a proto for the same command)

    If you can indeed grab these for all entities, I don't see a need to expand the list with types, as you can use the info one to get their name for instance (I'm speculating.. yet to test it)


    In your types list, I'm taking the 'item' is 'dropped from player with the 'drop' field from interface'?
    Otherwise, I'd suggest seperating the 'backpack' with 'item dropped willingly'
     
    #34
    Last edited: Apr 10, 2018
  15. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    456
    Likes Received:
    307
    As a semi-related note:

    I'm assuming
    Game_Update
    have the purpose of pushing updates, as they happen, yes?

    Is there any way to request updates, such as entitiy_inventorychanged (anything is moved or used or dropped or gained)?
    (Like a webhook)
     
    #35
  16. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    #36
    Exacute likes this.
  17. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    456
    Likes Received:
    307
    Ah, gotcha.
    "It is during the invocation of this function that you are allowed to submit to the ModGameAPI using the Game_Request function" on the wiki suggests that, but I was unsure.

    Then my wishlist consists of having some way to tell if the players inventory (among others) have been modified.

    It appears that you cannot invoke 'player_info' on an entity id however. Hm, that's less than ideal. Any suggestions to get expanded info? (I'd ideally like the actual type, the 'dead/alive' attribute (atleast used in 'ents' ingame cmd) or atleast the name of the entity in question)
     
    #37
  18. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    456
    Likes Received:
    307
    Speaking of the Wiki for the API:

    Would there be a way to easily include a navigation on there?
    I find it inconvenient to get back to the 'main page' for the API for instance (as clicking the logo is the only real 'link to there', but it's to the main wiki instead (which btw doesn't have a link to the API from what I can tell ; Intended?)
     
    #38
  19. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    No they only work for the player. For other entities where it makes sense this has to be created separately.

    I don't think Item is implemented yet. And I don't know what it is/will be for.
     
    #39
  20. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Feel free to edit :)
    My time is a bit limited and docu sadly lands every time on the last spot until I force myselfe to do it again.
     
    #40
Thread Status:
Not open for further replies.

Share This Page