[MOD EXT] Empyrion Scripting - Scripts

Discussion in 'The Hangar Bay' started by Ephoie, Mar 22, 2020.

  1. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    #281
    Ephoie likes this.
  2. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
  3. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    a precise landing, even from the tower
    [​IMG]

    the back landing tower (the red on top is the CV)
    [​IMG]

    the boarding ramp from the CV to the base (the concrete blocks lower left) in the lower front
    [​IMG]
     
    #283
    Sup likes this.
  4. Ageless

    Ageless Ensign

    Joined:
    Jun 7, 2018
    Messages:
    10
    Likes Received:
    2
    I can not for the life of me get this script to work, the output lcd wont show anything and the switch will not move the cargo? what am i doing wrong. please help, also i saw that there are addons to the script and i dont know what the completed script looks like, please help.
     
    #284
  5. Khas

    Khas Ensign

    Joined:
    Oct 18, 2020
    Messages:
    7
    Likes Received:
    4
    Just a bunch of things you can check:

    the script must be placed in an LCD called Script:InsertNameOfTheLCDOutputHere

    you need a lever witch give the signal called sw_automove

    the ship's loot needs to be in a container box, or container controller that has a name starting with "Loot" for ex. "LootCrate" or "LootBox 1" etc.

    the ship needs to be docked properly with landing gears

    the ships needs to be powered down

    the base, or receiver entity, need a container or box or controller called "Drop Box"

    also the switch must be ON.

    as for the Output LCD (not necessary for the script to works anyway), it follows strictly rules for the size, if i remember right must be something like a 1x2.

    Hope it helps
     
    #285
    Ageless likes this.
  6. Ageless

    Ageless Ensign

    Joined:
    Jun 7, 2018
    Messages:
    10
    Likes Received:
    2
    can someone help me set this up? i do not understand german.
    Cargo Teleporter:
    there is no info on the post and i tried to look through the script but i do not know what i am looking for or at
     
    #286
    Myrmidon likes this.
  7. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    You have to copy the SaveGamescripts into your savegame like this
    upload_2021-7-2_7-1-23.png

    and the named the input (receiving) box on you faction structure "CargoIn" and the output (sending) boxes "CargoOut@IdOfTarget" thats all.

    Note: The structures have to set to faction
     
    #287
    Ageless likes this.
  8. Ageless

    Ageless Ensign

    Joined:
    Jun 7, 2018
    Messages:
    10
    Likes Received:
    2
    Thank you for the assist, i would have never thought about bringing over the script and adding it right to the server
     
    #288
    Myrmidon likes this.
  9. Ageless

    Ageless Ensign

    Joined:
    Jun 7, 2018
    Messages:
    10
    Likes Received:
    2
    Dynamic Transfer/Sorting System does not seem to be working anymore, could this be caused by the recent update?
     
    #289
  10. Alex Ringess

    Alex Ringess Ensign

    Joined:
    Apr 1, 2018
    Messages:
    5
    Likes Received:
    1
    I just tested the CargoTeleporter.cs script and followed all the instructions word by word and i worked fine.

    Double check if :
    0 The CargoTeleporter.cs file is in the mod\EmpyrionScripting\Scripts folder under your actual savegame folder.
    1 The source container is called "CargoOut@IdOfTheTarget" (in my case, it's CargoOut@3718, on the ship I use to salvaging, 3718 is the Id of the space station where all my stuffs is located)
    2 The destination container, in the targeted structure (in my case, the space station I mentionned above), is called "CargoIn".
    3 If there is enough room to let the transfer operate.
    4 all the implied structure are under your faction ownership.
    5 the output lcd is named "CargoOutInfo*" (without quotes, and don't forget the *)

    If you followed that word by word and it still not work, restart the game (or the server) and before that, delete the Configuration.json file located at the same place than the CargoTeleporter.cs file.
     
    #290
    Last edited: Jul 5, 2021
  11. Ageless

    Ageless Ensign

    Joined:
    Jun 7, 2018
    Messages:
    10
    Likes Received:
    2
    this is the one im trying to get working, the cargo transfer script works great, however, this one does not
    Code:
    {{fontsize 2}}{{~set 'F' '1'}}
    {{~set 'I' 'Input'}}{{set 'CI' 'Constructor Input'}}{{set 'O' 'Constructor Output'}}{{set 'U' 'Unsorted'}}
    {{~devices @root.E.S 'SorterDB'}}{{set 'DB' .0}}{{gettext .0}}{{split . '\n'}}{{set 'C' .}}{{/split}}{{/gettext}}{{/devices}}
    {{~#devicesoftype @root.E.S 'Container'}}{{#each .}}{{set 'T' ''}}{{set 'M' 0}}
    {{#split CustomName '-'}}{{set 'n' .}}{{/split}}
    {{~#test @root.data.n.0 in (concat @root.Data.I ',' @root.Data.O ',' @root.Data.U)}}
    {{~#items @root.E.S CustomName}}{{set 'G' @root.data.U}}
    {{#each @root.data.C}}{{#split . ':'}}{{~#test ../../Id in .1}}{{~#test @root.data.CI neq .0}}{{set 'G' .0}}{{/test}}{{/test}}{{/split}}{{/each}}
    {{~#test ../CustomName neq @root.Data.G}}
    {{~move this @root.E.S (concat @root.Data.G '*')}}{{set 'M' 1}}
    {{set 'T' (concat @root.data.T '
    ' ../Name ' - '  Count '<indent=55%>❲' Source ' ➤ ' Destination '❳</indent>')}}
    {{/move}}{{/test}}{{/items}}{{else}}{{set 'x' ''}}
    {{~#each @root.Data.C}}{{#split . ':'}}{{#test @root.data.n.0 eq .0}}{{set 'x' .1}}{{/test}}{{/split}}{{/each}}
    {{~items @root.E.S CustomName}}{{#test Id in @root.data.x}}{{else}}{{set 'x' (concat @root.data.x Id ',')}}{{/test}}
    {{~#test Id in @root.data.CID}}
    {{~move this @root.E.S (concat @root.Data.CI '*') 50}}{{set 'M' 1}}
    {{set 'T' (concat @root.data.T '
    ' ../Name ' - '  Count '<indent=55%>❲' Source ' ➤ ' Destination '❳</indent>')}}
    {{/move}}{{/test}}{{/test}}{{/items}}
    {{~#if @root.data.x}}{{#if @root.data.n.1}}{{else}}{{set 'D' (concat @root.data.D @root.data.n.0 ':' @root.data.x "
    ")}}{{/if}}{{/if}}{{#test @root.data.n.0 eq @root.data.CI}}{{set 'CID' @root.data.x}}{{/test}}{{/test}}
    {{#if @root.data.M}}
    <align=center><color=#FFD><size=120%>Transfer - {{datetime 'HH:mm'}}</size></color></align>
    {{@root.data.T}}
    <align=center><color=#FFD><size=4>{{bar 1 0 1 10 '╼╾'}}</size></color></align>
    {{/if}}{{/each}}{{/devicesoftype}}
    {{settext @root.Data.DB @root.Data.D}}
     
    #291
  12. Ageless

    Ageless Ensign

    Joined:
    Jun 7, 2018
    Messages:
    10
    Likes Received:
    2
    I have tried several times to get this code to work, It will not move items to the unsorted container and will not create a bd and keeps throwing out errors. is there a save game script that im missing?
     
    #292
  13. Tyrion

    Tyrion Lieutenant

    Joined:
    Sep 14, 2016
    Messages:
    39
    Likes Received:
    26
    Bei dem Script mit der Übersicht der Materialien kann man die Ausgabe der Item-Bezeichnung auf eine bestimmte Länge begrenzen?
    Beispielsweise nur 20 Zeichen. Einige Bezeichnungen sind ja sehr lang und dann sieht das sehr unschön aus.
    Was müsste ich dafür in das Script einbauen?
     
    #293
  14. Alex Ringess

    Alex Ringess Ensign

    Joined:
    Apr 1, 2018
    Messages:
    5
    Likes Received:
    1
    I can't help you with this one. I never try it so I don't know if there is some issues with it. Sorry
     
    #294
  15. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    Code:
    {{substring text startindex length}}
    
    also z.B.
    
    {{substring (i18n id) '0' '20'}}
    
    alternativ kannst du auch
     {{format ...
    benutzen ist aber komplexer - aber auch mächtiger
     
    #295
  16. Blackmadman

    Blackmadman Ensign

    Joined:
    Aug 5, 2019
    Messages:
    15
    Likes Received:
    4
    Hi, ich habe 2 Fragen:
    1. Kann ich den Mod für Spieler sperren (wenn nötig) so das er nur für Admins zugänglich ist?
    2. Kann ich einen Text auf mehreren/allen LCDs mit gleichem Namen anzeigen lassen auch wenn sie in anderen Strukturen/Playfields sind?
    So als News-Anzeige?
     
    #296
  17. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    1. Nein nur die Ausführung der C# Scripte kann eingeschränkt werden - die anderen sind für alle offen, nur die Funktionen sind natürlich aufgeteilt auf die welche die "Elevated" Scripte ausführen dürfen und die welche allen Spielern zur Verfügung stehen
    2. Das SaveGameScript "SendReceiveData.hbs" (wenn installiert) bietet die simple Möglichkeit den Inhalt eines LCDs auf das LCD in eine andere Struktur zu übertragen
    2.b "PlayfieldInfos.hbs" macht etwas ähnliches nur mit anderem Ziel
     
    #297
  18. Blackmadman

    Blackmadman Ensign

    Joined:
    Aug 5, 2019
    Messages:
    15
    Likes Received:
    4
    Danke für die Info.
    Das wirft 2 weitere Fragen auf:
    1.: Wie kann man die Ausführung von C# Scripten einschränken?
    und 2.: Wo kann man diese SaveGameScripte finden?
     
    #298
  19. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    1. in der "...[SaveGame]\Mods\EmpyrionScripting\Configuration.json" -> ist aber nicht angeraten da es Spieler gibt die eher in C# statt in Handlebars arbeiten
    2. in '...[SaveGame]\Mods\EmpyrionScripting\Scripts' eine Quelle für solche Scripts ist https://github.com/GitHub-TC/EmpyrionScripting-Collection
     
    #299
  20. Murdok

    Murdok Ensign

    Joined:
    Jul 12, 2021
    Messages:
    5
    Likes Received:
    0
    einen wunderschönen montag nachmittag. die sache mit dem script is einfach nur genial. ich habe dennoch ein problem und hoffe das mir jemand weiterhelfen kann. weiß zufällig jemand wo ich hier:

    {{#devicesoftype E.S 'Container'}}
    {{#each .}}
    Found: {{CustomName}}
    {{#if CustomName}}
    {{#items @root.E.S CustomName}}
    -{{format Count '{0,5}'}} {{i18n id 'Deutsch'}}
    {{/items}}
    {{#devices @root.E.S
    (concat CustomName 'LCD*')}}
    {{#each .}}
    {{#settextblock .}}
    {{../../../CustomName}}:
    {{~islocked @root.E.S ../../../.}}(locked){{/islocked}}
    {{#items @root.E.S ../../../CustomName}}
    -{{format Count '{0,5}'}} {{i18n id 'Deutsch'}}
    {{/items}}
    {{/settextblock}}
    {{/each}}
    {{/devices}}
    {{/if}}
    {{/each}}
    {{/devicesoftype}}

    den scroll befehl setzen muß damit das lcd durchscrollt?


    ich bekomme das seit 2 nächten nicht hin
     
    #300

Share This Page