[MOD EXT] Empyrion Scripting - Scripts

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

  1. Toberus

    Toberus Ensign

    Joined:
    Oct 14, 2025
    Messages:
    4
    Likes Received:
    0
    Hello,
    I am new to scripting and tried reaching out for help on the server that I am playing on and not getting an help at all. I would greatly appreciate the help. I have a script I will post below that i am using. I am currently using the script to buy items from players so they have place to sell their items for credits. I would like to add to the script to also show the available amount. I would also like to add the ability for example a player insert 50,000 iron ore they will get 100,000 galactic credits in return. But would like to set it up if they put in 100,000 ore in though i set it up the sell for 50,000 ore they would be able to sell the 100,000 ore and get 200,000 credits. To be able to allow them to put in as much as the box can hold and the transtation to go through if that make sense. I aplogize not sure how to word it correctly in script terms. I got the script off steam workshop of a ship I really would like it to be simple names but i can deal with what is their. Thank you for the help and your time.

    {{set 'cost' 50}}
    {{set 'volume' 50000}}
    <align=center><i>Put in 50 Gold Ingots For 50000 Galactic Credits</I>
    {{items E.S 'RF-04-BuyBox-2'}}
    {{set 'itemID' 4346}}
    {{/items}}
    {{#items E.S 'RF-05-BuyStuff-2'}}
    <smallcaps>{{format Count '{0,5}'}} {{Name}}</smallcaps>
    {{#test Id 'eq' @root.Data.itemID}}
    {{#test Count 'eq' @root.Data.cost}}
    {{set 'Payed' true}}
    <color=green>GOODS VERIFIED</color>
    {{/test}}
    {{/test}}
    {{/items}}
    {{#items E.S 'RF-04-BuyBox-2'}}
    {{#test Id 'eq' 4344}}
    {{#test Count 'le' @root.Data.volume}}
    <color=red>FUNDS INSUFFICIENT
    {{set 'emptybox' true}}
    {{/test}}
    {{/test}}
    {{else}}
    {{set 'emptybox' true}}
    <color=white><size=3>FUNDS OUT
    PLEASE TRY AGAIN LATER.</color></size>
    {{/items}}
    {{#items E.S 'RF-05-BuyStuff-2'}}
    {{#test Id 'eq' 4344}}

    <color=green><i>PLEASE REMOVE YOUR CREDITS</i>
    {{set 'emptybox' true}}
    {{/test}}
    {{/items}}
    {{#if @root.Data.emptybox}}<color=red><size=15>
    ⚠</size>
    {{else}}
    {{#if @root.Data.Payed}}
    {{#items E.S 'RF-04-BuyBox-2,RF-05-BuyStuff-2'}}
    {{~set 'RFBY1' ''}}
    {{~set 'Amount' ''}}
    <color=red><size=8>⚙ </size><size=2>TRANSFER IN PROGRESS</size><size=8> ⚙</size></color>
    {{#test Id in @root.Data.itemID}}
    {{~set 'RFBY1' 'CargoIn'}}
    {{/test}}
    {{#test Id in 4344}}
    {{~set 'RFBY1' 'RF-05-BuyStuff-2'}}
    {{~set 'Amount' @root.Data.volume}}
    {{/test}}
    {{#ok @root.Data.RFBY1}}
    {{#move ../. @root.E.S @root.Data.RFBY1 @root.Data.Amount}}
    {{Source}} -> {{Destination}}
    {{/move}}
    {{/ok}}
    {{/items}}
    {{else}}
    {{#items E.S 'RF-04-BuyBox-2'}}
    <color=white><align=center><color=#00CEEB><size=3>CURRENLY PAYING</size>

    <smallcaps><i>{{@root.Data.volume}} CREDITS</i>

    <size=3>COST - {{@root.Data.cost}} ITEMS


    Deposit exactly {{@root.Data.cost}} ITEMS
    Exit container and wait for transfer.
    Do not open until transfer complete

    <color=red>No refunds
    Item ID {{Id}}</size></color>
    {{/items}}
    {{/if}}
    {{/if}}
     
    #1021
  2. stif.87

    stif.87 Ensign

    Joined:
    Oct 20, 2025
    Messages:
    2
    Likes Received:
    0
    Hello, I've encountered a seemingly simple problem, but I couldn't find a ready-made solution either online or on the forum.
    How does {{setactive block|device active}} work? How do I specify the block|device correctly? There are no instructions or ready-made examples I could configure. I've tried using coordinates, a file name, and various options: "0123" / '0123' / (0123) / "-1 122 -1" / '-1 122 -1' / (-1 122 -1) / " '0123' " / ' "0123." Of the forum posts I found, these three, unfortunately, didn't help me.
     
    #1022
  3. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,131
    Likes Received:
    744
    You have to select a block via the "block" command or a defice ofer their commands
    Code:
    {{#block @root.E.S  x y z}}
    ...
    {{setactive . true}}
    ...
    {{/block}}
     
    #1023
  4. stif.87

    stif.87 Ensign

    Joined:
    Oct 20, 2025
    Messages:
    2
    Likes Received:
    0
    Thank you, there are plenty of instructions on GitHub, but sometimes they simply lack an example for each operand. For example, we searched for a description of the tilde using screenshots.
     
    #1024
  5. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,131
    Likes Received:
    744
    #1025
  6. DPMKIV

    DPMKIV Ensign

    Joined:
    Sep 19, 2025
    Messages:
    2
    Likes Received:
    1

    I figured this out.
    Have to use the full 3x3 area. DI and looking at the Hydroponics Bay will be off by 1 block. I have to look at the block below the corner then add 1 to the height to get it working correctly.
     
    #1026
    ASTIC likes this.
  7. Odin23x TTV

    Odin23x TTV Ensign

    Joined:
    Nov 16, 2025
    Messages:
    1
    Likes Received:
    0
    Hi hab da mal eine frage ich suche ein Laufendes Sorter und Produktions Script das auf der Aktuellen Version geht

    Sry bin neu in dem game und so ^^
     
    #1027
  8. dot_sent

    dot_sent Ensign

    Joined:
    Nov 19, 2025
    Messages:
    2
    Likes Received:
    0
    Hello everyone!

    I'm currently working on some extra HUD info scripts for my ship and I have a trouble with retrieving the planet temperature. Namely, the `P.Details.TemperatureMin` variable seems to be consistently off what is displayed on the map info screen. The variable contains the value of (+) 500, while the map shows -200 as the minimum. The `TemperatureMax` variable matches just fine (550). Is this fixable somehow?
     
    #1028
    Last edited: Nov 22, 2025
  9. loupineto

    loupineto Ensign

    Joined:
    Dec 4, 2025
    Messages:
    1
    Likes Received:
    0
    Hallo zusammen und ein großes Dankeschön an ASTIC! Dank eurer Arbeit konnte ich Skripte für praktisch alles erstellen.
    Vielen Dank auch an die GitHub-Seite und die Demo-CV, die hervorragend funktioniert.
    Frage an ASTIC: Kann man den Fehlercode der Funktion „move“ abrufen?
    Um die Munition angedockter Schiffe aufzufüllen, suche ich nach einer Möglichkeit, die montierten Waffen zu finden, habe aber noch keine Lösung gefunden. Gibt es eine Möglichkeit, dies durch Durchlaufen der Blöcke zu tun?
    (Entschuldigung, Google-Übersetzung)
     
    #1029
  10. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,131
    Likes Received:
    744
    Was meinst du mit Fehlercode? Die Exception "{{move}} error ..." kannst du (leider) nicht direkt abfragen

    Das würde nur über die Blöcke gehen. Ich habe das bei mir auf der Vega-AI so gelöst das ich die Item IDs, der benötigten Munition, in den Containernamen hinterlegt habe.
     
    #1030
  11. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,131
    Likes Received:
    744
    This information is read directly from playfield.yaml in the Savegame/.../Templates directory. Take a look at the file to see what is specified there.
    e.g.
    [EGS]\Saves\Games\....\Templates\Akua\playfield.yaml
    Code:
      [c][ffff00]WARNING: New decoration system in testing. You may encounter unexpected issues if you enter this playfield.[-][/c]
    
      Akua is a large size Earth-like temperate planet with vast forests, open plains, mountains, and plenty of water.[/sup]
    Seed: 991815
    TemperatureMinMax:
    - 0
    - 40
    HumidityMinMax:
    - 0.146336585
    - 0.761305213
    LandWaterRatio: 0.207819685
    TemperatureHeightRange:
     
    #1031
  12. Lt.Fenix

    Lt.Fenix Lieutenant

    Joined:
    Aug 28, 2025
    Messages:
    39
    Likes Received:
    13
    Hi, I'm new to the scripting mod.
    I've been trying to use the ActiveRadar and ActiveAntenna scripts, but I get the following error message on both a dedicated server and singleplayer:

    "{{scroll}} error 'selectedTypes' only allowed in elevated scripts"

    How do I fix this?

    Also, I can't seem to find the ActiveAntenna script on your Vega AI CV. It seems the script is working there.
     
    #1032
    Last edited: Feb 1, 2026
  13. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,131
    Likes Received:
    744
    You had to store the scripts in files in the savegame.

    For example, “[EGS]\Saves\Games\[SavegameName]\Mods\EmpyrionScripting\Scripts\CV\ActiveRadar.hbs”

    because the commands can be used for cheating on LCDs in the game.
     
    #1033
    Lt.Fenix likes this.
  14. Lt.Fenix

    Lt.Fenix Lieutenant

    Joined:
    Aug 28, 2025
    Messages:
    39
    Likes Received:
    13
    Ah, okay. Thanks.
     
    #1034
  15. Lt.Fenix

    Lt.Fenix Lieutenant

    Joined:
    Aug 28, 2025
    Messages:
    39
    Likes Received:
    13
    Does this method work for a dedicated server? It doesn't seem to be working for me. Do I have to do something else for a DS?
     
    #1035
  16. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,131
    Likes Received:
    744
    EmpyrionScripting also works on a dedicated server. The script only needs to be installed on the server so that all players can use it. Such “save game scripts” must then be stored in the save game directory on the dedicated server.
     
    #1036
  17. Lt.Fenix

    Lt.Fenix Lieutenant

    Joined:
    Aug 28, 2025
    Messages:
    39
    Likes Received:
    13
    Ah, I was being stupid. I was trying to use ActiveRadar instead of ActiveAntenna, the former isn't available for BA.
     
    #1037
    ASTIC likes this.
  18. Lt.Fenix

    Lt.Fenix Lieutenant

    Joined:
    Aug 28, 2025
    Messages:
    39
    Likes Received:
    13
    Now I'm having trouble with the storage contents script from this guide: https://steamcommunity.com/workshop/filedetails/discussion/1751409371/3191368095147121750/

    I placed the code for the storage contents display script on an LCD and named it "Script:Contents".
    Then I named a cargo container "supplies1", and then named a different LCD "supplies1", but nothing is being displayed.
    Did I do this wrong?

    I'm also having trouble getting the recycling script to work.
    I've followed the instructions, and the LCD shows what to rename the core of the ship to be recycled.
    When I rename the core, the LCD no longer displays what the core should be renamed, but nothing seems to happen. The ship doesn't get recycled, it just sits there.

    Sorry I seem to be having so many issues, I don't really know what I'm doing.
     
    #1038
    Last edited: Feb 8, 2026
  19. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,131
    Likes Received:
    744
    My tip is to approach scripting slowly. Start with simple things to understand the mechanics and the mistakes you can make before you take on complex scripts and try to get them working.

    There are some good beginner YouTube videos on this topic, because scripting has become so powerful that the sheer number of possibilities can be overwhelming.

    When I think about how “small” my first demo CV was and now, a monster crammed with possibilities over three floors,
     
    #1039
  20. Lt.Fenix

    Lt.Fenix Lieutenant

    Joined:
    Aug 28, 2025
    Messages:
    39
    Likes Received:
    13
    So it turns out, I was supposed to put money in the container. The problem for me, was that the LCD wasn't actually displaying an error message saying it required credits. I think one time when I accessed it, it *did* show it for a while, but the vast majority of the time it was displaying nothing.
     
    #1040

Share This Page