[mod] EmpyrionPassenger

Discussion in 'Empyrion API' started by ASTIC, Sep 15, 2018.

  1. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    334
    Likes Received:
    380
    FAQ
    Eine übersetzte Version findet ihr im EmpyrionPassenger/bin Verzeichnis falls ihr die Mod nicht selber prüfen und compilieren wollt ;-)
    Oder hier:

    https://github.com/GitHub-TC/EmpyrionPassenger
    https://empyrion.gamepedia.com/Game_API_ModList#Empyrion_Passenger



    Wo für ist das?
    Man fliegt mit einer Gruppe von Leuten in einem Raumschiff und muss sich ausloggen.
    Wenn die anderen weiterfliegen befindet man sich nach einem Login aber immer noch an der gleichen Position nur ist das Raumschiff ganz wo anders. Mit diesem Mod kann kann sich als Passagier an das Schiff binden und wird automatisch bei einem Login an dessen aktuelle Position teleportiert.

    Wie steuert man den MOD?
    Die Kommandos funktionieren NUR im Fraktionschat!

    Hilfe
    • /pass help : Zeigt die Kommandos der Mod an

    Passagiersteuerung
    • /pass => Passagier einrichten wenn man auf Pilot des Schiffes ist
    • /pass <Id> => Passagier einrichten zu der Stuktur mit der <Id> - diese muss in der gleichen Fraktion sein
    • /pass help => Liste der Kommandos
    • /pass back => Falls ein Teleport schiefgegenen sein sollte kann sich der Spieler hiermit zu der Position VOR dem Teleport zurück teleportieren lassen
    • /pass delete <Id> => Löscht alle Passagierinformationen von zum Schiff <Id>
    • /pass list <Id> => Listet alle Passagiere von <Id> auf
    • /pass listall => Listet alle Passagierinformationen auf (nur ab Moderator erlaubt)
    • /pass cleanup => Löscht alle Passagierinformationen die zu gelöschten Strukturen führen (nur ab Moderator erlaubt)
    Beispiel:
    - Als Pilot des CV 4004: /pass
    - Als normaler Passagier des CV: /pass 4004

    Hinweis: Man kann sich aber auch in einem angedockten Schiff befinden und nur mit dem /pass Befehl seinen Passagierstatus anmelden

    Konfiguration
    Eine Konfiguration kann man in der Datei (wird beim ersten Start automatisch erstellt)
    [Empyrion Directory]\Saves\Games\[SaveGameName]\Mods\EmpyrionPassenger\PassengersDB.xml
    vornehmen.

    • HoldPlayerOnPositionAfterTeleport: Zeit in Sekunden die ein Spieler nach dem Teleport auf Position gehalten wird bis die Strukturen (hoffentlich) nachgeladen sind
    • PreparePlayerForTeleport: Zeit in Sekunden die der Spieler sich auf den Teleport vorbereiten kann (Chat schließen, Finger auf die Jetpacktaste und die Leertaste legen... ;-) )
    • AllowedStructures: Liste der erlaubten Strukturen für Passagierinformationen hierbei sind folgende Werte erlaubt
      • EntityType: CV, SV, HV
    • PassengersDestinations: Hier werden die gespeicherten Passagierinformationen hinterlegt
    Was kommt noch?
    Zunächst erstmal und damit viel Spaß beim Mitreisen wünscht euch
    ASTIC/TC

    Version 1.1.0:
    • Mod klingt sich nicht mehr in Player_Disconnect ein sondern muss per Chatbefehl aktiviert werden

    ***
    English-Version:
    ---
    FAQ
    You can find a translated version in the EmpyrionPassenger / bin directory if you do not want to check and compile the mod myself ;-)
    Or here:

    https://github.com/GitHub-TC/EmpyrionPassenger
    https://empyrion.gamepedia.com/Game_API_ModList#Empyrion_Passenger

    What is this?
    You fly with a group of people in a spaceship and have to log out.
    If the others continue to fly, they are still in the same position after logging in, only that is
    Spaceship where different. With this mod can bind as a passenger to the ship and is automatically at a
    login to its current location.

    What are all the commands?
    All commands only work in faction chat!

    Help
    • / pass help: Displays the commands of the mod
    Passengerscontrol
    • / pass => Passenger set up when piloting the ship
    • / pass <Id> => Passenger set up to the structure with the <Id> - this must be in the same faction
    • / pass help => list of commands
    • / pass back => If a teleport should be counterfeit, the player can be teleported back to the position BEFORE the teleport
    • / pass delete <Id> => Deletes all passenger information from to the ship <Id>
    • / pass list <Id> => Lists all passengers from <Id>
    • / pass listall => Lists all passenger information (only allowed from moderator)
    • / pass cleanup => Deletes all passenger information leading to deleted structures (only allowed from moderator)
    Example:
    - As a pilot of the CV 4004: / pass
    - As a normal passenger of the CV: / pass 4004
    Note: You can also be in a docked ship and register your passenger status only with the / pass command

    Configuration
    A configuration can be found in the file (automatically created on first startup)
    [Empyrion Directory]\Saves\Games\\[SaveGameName]\Mods\EmpyrionPassenger\PassengersDB.xml
    make.

    • HoldPlayerOnPositionAfterTeleport: Time in seconds that a player is held in position after the teleport until the structures are (hopefully) reloaded
    • PreparePlayerForTeleport: Time in seconds the player can prepare for the teleport (close the chat, touch the jetpack key and the space bar ... ;-))
    • AllowedStructures: list of allowed structures for passenger information the following values are allowed
      • EntityType: CV, SV, HV
    • PassengersDestinations: The stored passenger information is stored here
    Is that it?
    First of all, and have fun traveling with you
    ASTIC/TC

    Version 1.1.0:
    • Mod no longer receive in Player_Disconnect and must be activated by chat command
     

    Attached Files:

    #1
    Last edited: Apr 28, 2019
    Ephoie, Liang and Sephrajin like this.
  2. Emperor Johnny

    Emperor Johnny Commander

    Joined:
    Dec 27, 2015
    Messages:
    188
    Likes Received:
    160
    Would you be willing to share source code with me? I'm learning the Game API now and lots of parts in this mod are things I'm attempting to do in other mods.
     
    #2
  3. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    334
    Likes Received:
    380
    You wil find the sourcecode of all my mods here:
    https://github.com/GitHub-TC

    PS: what mod do you plan? do you know this site?
    https://empyrion.gamepedia.com/Game_API
     
    #3
    Last edited: Apr 9, 2019
  4. Aricus

    Aricus Ensign

    Joined:
    Jun 22, 2019
    Messages:
    4
    Likes Received:
    0
    I installed this right and even tried compiling it on my machine before loading it. Everytime it looks like it loads right but if we do \pass # it crashes the entire server and the only thing it says in the logs are:
    23-19:54:26.650 15_54 -LOG- {:EmpyrionPassenger} **HandleEmpyrionPassenger 5#Save:\pass 54596 ID/54596

    Also, on a side note this:
    "PassengersDB.xml" is never created when the game is launched
    Also, there is no Passengers.JSON. I saw the code points to this some

    Any idea what would cause this? We're on the newest version of the game running a dedicated online game on my own server.
     
    #4
    Last edited: Jun 23, 2019
  5. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    334
    Likes Received:
    380
    I'm working on a more robust version, please try the latest ZIP from
    https://github.com/GitHub-TC/EmpyrionPassenger/releases
    and in your savegame have to be a file
    "[savegame]\Mods\EmpyrionPassenger\Passengers.json"

    To decouple the mods from the EGS you can use the
    https://github.com/GitHub-TC/EmpyrionModHost
    so a mod exception cannot crash the server.
     
    #5
  6. Aricus

    Aricus Ensign

    Joined:
    Jun 22, 2019
    Messages:
    4
    Likes Received:
    0


    This is what I get in the server log now when I use the new version:

    TimeoutException: The operation has timed out.
    at EmpyrionNetAPIAccess.TaskWait+<For>d__1`1[TResult].MoveNext () [0x001d8] in <e763304179c34067a286bb81a0635cfc>:0
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at EmpyrionNetAPIAccess.TaskWait+<For>d__1`1[TResult].MoveNext () [0x0021a] in <e763304179c34067a286bb81a0635cfc>:0
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at EmpyrionNetAPIAccess.EmpyrionModBase+<Request_Player_Info>d__116.MoveNext () [0x00083] in <e763304179c34067a286bb81a0635cfc>:0
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at EmpyrionPassenger.EmpyrionPassenger+<TeleportPlayer>d__53.MoveNext () [0x00119] in <e763304179c34067a286bb81a0635cfc>:0
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at EmpyrionPassenger.EmpyrionPassenger+<EmpyrionPassenger_Event_Player_Connected>d__48.MoveNext () [0x00083] in <e763304179c34067a286bb81a0635cfc>:0
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at EmpyrionPassenger.EmpyrionPassenger+<<Initialize>b__47_0>d.MoveNext () [0x0007d] in <e763304179c34067a286bb81a0635cfc>:0
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <d7ac571ca2d04b2f981d0d886fa067cf>:0
    at UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () [0x00002] in <ec6cdd2ecdd2497ab1221eaddc1cd404>:0
     
    #6
  7. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    334
    Likes Received:
    380
    ok i have secure 'player_connect' with try catch now, it logs the error but without a crash. please try the latest version from
    https://github.com/GitHub-TC/EmpyrionPassenger/releases
     
    #7
  8. Aricus

    Aricus Ensign

    Joined:
    Jun 22, 2019
    Messages:
    4
    Likes Received:
    0
    Still crashes
    24-20:53:26.233 16_53 -LOG- {:EmpyrionPassenger} **HandleEmpyrionPassenger 5#Save:/pass 106985 ID/106985

    I tried to use the mod you made that is the loader, but the english directions seemed to have been missing steps from the German one.
     
    #8

Share This Page