[MOD EXT] Empyrion Scripting - Scripts

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

  1. The Pfaffinator

    The Pfaffinator Ensign

    Joined:
    Oct 18, 2024
    Messages:
    4
    Likes Received:
    1
    I have been using the container contents/volume display scripts for some time (e.g. Script:BoxInfos from Vega AI), and I just discovered that most Reforged Eden 2 items don't contribute to the used volume on the display, even though the names and quantities still show up on the screen.
    The items in question do have Volume set in BlocksConfig.ecf and ItemsConfig.ecf.
     
    #981
    Last edited: Jan 30, 2025
    Palmeza likes this.
  2. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,115
    Likes Received:
    746
    I assume you are in single player - you have to enter the path to the scenario in the scripting configuration because the API only contains this information in multiplayer.
     
    #982
    The Pfaffinator likes this.
  3. [TOG] Xukisy

    [TOG] Xukisy Ensign

    Joined:
    Oct 15, 2020
    Messages:
    23
    Likes Received:
    7
    A little help please. I'm playing Reforged Eden 2 scenario on a MP server.

    I've set-up 2 identical farms CVs and ASTIC script set-up to harvest the hydroponic bays with 20000+ credits in the input containers. One farm has fiber hydroponics which is working perfectly and when I load in each day I see it's looted the fiber hydroponics multiple occasions since I've been on. The pentaxid farm is empty when I load in and I can see the pentaxid hydroponics are full and waiting to be harvested. I then wait a minute or so I see the script trigger and it loot the hydroponics in front of me and only for the quantity waiting to be harvested.

    I've tried with and without OverrideScenarioPath set but this doesn't appear to make a difference.

    Any idea why the fiber farm is working as expected but the pentax farm is only being triggered when someone loads into the playfield?
     
    #983
  4. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,115
    Likes Received:
    746
    The scripts are only executed when the playfield is loaded. There are probably other players on the playfield with the fibers besides you.
    PS: Additionally there is the DSL (Dynamic Structure Loading) which only loads objects when a player approaches and the scripts only work on loaded objects ;-)
     
    #984
  5. BloodAngel099

    BloodAngel099 Lieutenant

    Joined:
    Jan 24, 2023
    Messages:
    45
    Likes Received:
    2
    @ASTIC
    • {{#orderbylist list 'id1;id2;id3,...'}}
      • sort list of items based on the idlist. Items that are not in the list are sorted to the end
    Is there a way to have the "list" this is working with be something that itemlist produced.

    Code:
    {{~set 'IDs' '4329,4339,4331,4444,4173,4322,4324,4321,4319,4323,4360,4333,4326-4327,4363,4346,4366,'}}
    
    {{#itemlist @root.E.S.Items @root.Data.IDs}}
    {{#test Id in @root.Data.IDs}}
    
    {{#orderbylist . @root.Data.IDs}}
    {{i18n Id}} ({{Id}})<pos=75><color=yellow>{{Count}}</color>
    {{/each}}{{/orderbylist}}
    
    {{/test}}
    {{/itemlist}}
    I am trying to make a set ordered list that doesnt move item with 0 to the end.
     
    #985
  6. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,115
    Likes Received:
    746
    The new version 13.4.2 support a function "itemlistarray" witch returns an list instead of loop over the single items
    https://github.com/GitHub-TC/EmpyrionScripting/releases/tag/13.4.2
     
    #986
  7. BloodAngel099

    BloodAngel099 Lieutenant

    Joined:
    Jan 24, 2023
    Messages:
    45
    Likes Received:
    2
    Ill take a look, Thank you.
     
    #987
  8. Melaywen

    Melaywen Ensign

    Joined:
    Feb 18, 2021
    Messages:
    10
    Likes Received:
    2
    Hi,

    I've a proble again. i like to change a switchstate, but it won't work:
    Its on a SV, i have 2 switch, "Senden" and "Empfangen"


    Code:
    {{set 'umstellen' false}}
    
    --- Abfragen Senden & festlegen Cache---
    
    {{#getswitch E.S 'Senden'}}
    {{customname}} -> {{switchstate}}
    {{set 'umstellen' switchstate}}
    {{/getswitch}}
    
    --- Prüfen von cache ---
    
    {{Data.umstellen}}
    
    --- Umstellen vom Empfangen: ---
    
    {{#getswitch E.S 'Empfangen'}}
    {{setswitch @root.E.S 'Empfangen' Data.umstellen}}
    {{customname}} -> {{switchstate}}
    {{/getswitch}}
    

    any ideas, where i get a mistake? :D
    -> the "Umstellen vom Empfangen" part don't work... chache is fine
     
    #988
  9. me777

    me777 Commander

    Joined:
    Aug 18, 2020
    Messages:
    408
    Likes Received:
    140
    maybe data is not defined inside the second getswitch block?
    try @root.Data to test if this is the problem.
     
    #989
  10. Melaywen

    Melaywen Ensign

    Joined:
    Feb 18, 2021
    Messages:
    10
    Likes Received:
    2
    :( not solve the problem.
    Just test on the Emyprion Scripting-Demo Blueprint, from astic, there also no longer work...
     
    #990
  11. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,115
    Likes Received:
    746
    The demo CV works perfectly for me. @root.data is one thing and maybe you haven't renamed the “Receive” switch or there are two objects named like this
     
    #991
  12. Melaywen

    Melaywen Ensign

    Joined:
    Feb 18, 2021
    Messages:
    10
    Likes Received:
    2
    So, i rewrite, i've test something.

    1. Reinstall Empyrion
    2. Redownload the Empyrion Scripting
    3. Check Windefender, Empyrion / Steam are excepion
    4. Check Steam / Empyrion start with admin right
    5. Update .net

    so, if i switch, the lcd show immediately the change

    but, switch change won't work, not on the Vega AI (if i sit on pilot set for example) and not on the Empyrion Scripting- Demo

    There some other ideas to fix it? if i'll realy the only one who not can switch switch :)

    And sorry for bad English.
     
    #992
    Last edited: Mar 8, 2025
  13. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,115
    Likes Received:
    746
    Bist du im SinglePlaer unterweg oder MultiPlayer - denn meine Test im Multiplayer haben alle funktioniert und auch die Vega AI schaltet die Triebwerke an/aus je nachdem ob man auf dem Pilotensitz ist oder nicht
     
    #993
  14. Melaywen

    Melaywen Ensign

    Joined:
    Feb 18, 2021
    Messages:
    10
    Likes Received:
    2
    Bisher nur SP (Ohne EAC) aber gute Idee, ich versuche es mal auf einem Server. Ich editiere den Post hier wenn es geklappt hat.

    Danke vielmals für die Unterstützung! :D
     
    #994
  15. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,115
    Likes Received:
    746
    Denk daran die Mod lokal bei dir zu deinstallieren/löschen denn sonst "prügelt" die sich mit der auf dem MP Server - leider hat Eleon hier den Automatismus entfernt/kaputtgemacht welcher lokale Mods deaktiviert wenn ein Server mit EAC angesteuert wird
     
    #995
  16. Palmeza

    Palmeza Ensign

    Joined:
    Aug 27, 2023
    Messages:
    1
    Likes Received:
    0
    Hello I try to concate
    Code:
    {{#items E.S '*Combustible*'}}
    {{~set 'Carburant' ''}}
    {{~set 'Qte' ''}}
    {{#test Id in '4314,4335,4421'}}
    {{~set 'Carburant' 'Fuel'}}
    {{~set 'Qte' 100}}
    {{/test}}
    {{#ok @root.Data.Carburant}}
    {{~fill this @root.E.S @root.Data.Carburant @root.Data.Qte}}
    {{datetime}}
    {{Source}} -> {{Destination}}
    {{format Count '{0,5}'}}:
    {{/fill}}
    {{/ok}}
    {{/items}}
    
    {{#items E.S '*Oxygene*'}}
    {{~set 'Carburant' ''}}
    {{~set 'Qte' ''}}
    {{#test Id in '4176'}}
    {{~set 'Carburant' 'Oxygen'}}
    {{~set 'Qte' 100}}
    {{/test}}
    {{#ok @root.Data.Carburant}}
    {{~fill this @root.E.S @root.Data.Carburant @root.Data.Qte}}
    {{datetime}}
    {{Source}} -> {{Destination}}
    {{format Count '{0,5}'}}:
    {{/fill}}
    {{/ok}}
    {{/items}}
    
    {{#items E.S '*Pentaxid*'}}
    {{~set 'Carburant' ''}}
    {{~set 'Qte' ''}}
    {{#test Id in '4342'}}
    {{~set 'Carburant' 'Pentaxid'}}
    {{~set 'Qte' 100}}
    {{/test}}
    {{#ok @root.Data.Carburant}}
    {{~fill this @root.E.S @root.Data.Carburant @root.Data.Qte}}
    {{datetime}}
    {{Source}} -> {{Destination}}
    {{format Count '{0,5}'}}:
    {{/fill}}
    {{/ok}}
    {{/items}}
    on:

    Code:
    {{#items E.S '*Combustible*,*Oxygene*,*Pentaxid*'}}
    {{~set 'Carburant' ''}}
    {{~set 'Qte' ''}}
    
    {{#test Id in '4314,4335,4421'}}{{~set 'Carburant' 'Fuel'}}{{/test}}
    {{#test Id in '4176'}}{{~set 'Carburant' 'Oxygen'}}{{/test}}
    {{#test Id in '4342'}}{{~set 'Carburant' 'Pentaxid'}}{{/test}}
    
    {{#ok @root.Data.Carburant}}
    {{~fill this @root.E.S @root.Data.Carburant @root.Data.Qte}}
    {{datetime}}
    {{Source}} -> {{Destination}}
    {{format Count '{0,5}'}}:
    {{/fill}}
    {{/ok}}
    {{/items}}
    or
    Code:
    {{#items E.S '*Combustible*,*Oxygene*,*Pentaxid*'}}
    {{#each .}}
    {{~set 'Carburant' ''}}
    {{~set 'Qte' ''}}
    
    {{#test Id in '4314,4335,4421'}}{{~set 'Carburant' 'Fuel'}}{{/test}}
    {{#test Id in '4176'}}{{~set 'Carburant' 'Oxygen'}}{{/test}}
    {{#test Id in '4342'}}{{~set 'Carburant' 'Pentaxid'}}{{/test}}
    
    {{#ok @root.Data.Carburant}}
    {{~fill this @root.E.S @root.Data.Carburant @root.Data.Qte}}
    {{datetime}}
    {{Source}} -> {{Destination}}
    {{format Count '{0,5}'}}:
    {{/fill}}
    {{/ok}}
    {{/each}}
    {{/items}}
    but is'nt work ( I try with "," and ";" )
    THX for your help
     
    #996

Share This Page