[MOD EXT] Empyrion Scripting - Scripts

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

  1. Nathan Jurgens

    Nathan Jurgens Lieutenant

    Joined:
    May 18, 2016
    Messages:
    52
    Likes Received:
    5
    Nice. Perfect update. You did everything on my wish list.

    Thanks
     
    #381
  2. ...M-o-H...

    ...M-o-H... Lieutenant

    Joined:
    Feb 26, 2018
    Messages:
    64
    Likes Received:
    10
    #382
    Last edited: Apr 16, 2022
  3. me777

    me777 Commander

    Joined:
    Aug 18, 2020
    Messages:
    406
    Likes Received:
    138
    vom scripting demo Schiff:
    Code:
    {{#blocks E.S 5 129 40 7 129 41}}
    {{#each .}}
    {{Id}} {{i18n Id}} X:
    {{~Position.X}} Y:
    {{~Position.Y}} Z:
    {{~Position.Z}}
    {{/each}}
    {{#harvest @root.E.S .
     'MainFridge' 4 129 41 true}}
    Harvest: {{i18n Id}}➔
    {{~i18n ChildOnHarvestId}}
    get {{DropOnHarvestCount}}:
    {{~i18n DropOnHarvestId}}
    {{/harvest}}
    {{/blocks}}
     
    #383
    ...M-o-H... likes this.
  4. ...M-o-H...

    ...M-o-H... Lieutenant

    Joined:
    Feb 26, 2018
    Messages:
    64
    Likes Received:
    10


    ah super danke !
     
    #384
  5. me777

    me777 Commander

    Joined:
    Aug 18, 2020
    Messages:
    406
    Likes Received:
    138
    Is there a way to get the ingame time?
    All i've red seems to be real clock not ingame time.
    I would need a timer that can tell me when it is sunrise on another planet, or something like a clock display for various bases...
     
    #385
  6. me777

    me777 Commander

    Joined:
    Aug 18, 2020
    Messages:
    406
    Likes Received:
    138
    Is there a limit to {{#blocks}} ? or to the size of a list in general? somehow blocks refuses to do annything when I put my (big) garden coordinates in.
    {{#blocks E.S 6 124 -22 -24 124 0}}
    when I reduce the area of the blocks it starts to work.

    now i have this code in a lcd - it ran once and then output went black and stayed black, logout/reconnect did not help
    Code:
    {{#blocks E.S -14 124 -2 -16 124 0}}
    {{#each .}}
    {{Id}} {{i18n Id}} X:
    {{~Position.X}} Y:
    {{~Position.Y}} Z:
    {{~Position.Z}}
    {{/each}}
    {{/blocks}}
     
    #386
    Last edited: Apr 17, 2022
  7. Nathan Jurgens

    Nathan Jurgens Lieutenant

    Joined:
    May 18, 2016
    Messages:
    52
    Likes Received:
    5
    I keep the block area to around 20 blocks or it times out. Just split your areas in to 20 unit sizes and have multi scripts.
     
    #387
  8. me777

    me777 Commander

    Joined:
    Aug 18, 2020
    Messages:
    406
    Likes Received:
    138
    I thought I figured out how to make it work, but it stopped working again :(
    I changed the corners so all coordinates were ascending and only had a 3 by 3 area.
    It worked for a bit, then I tapped out to post it's working and it stopped again.

    ok, a few more observations: i got it on {{#blocks E.S -12 124 -2 -10 124 0}} all are plant blocks.
    i get one run with output and one run with the #blocks not being run.

    ok, if i dont change y at all and have x and z increasing it seems to work...
    Code:
    a
    {{#blocks E.S -24 124 -2 6 124 0}}
    b
    {{#harvest @root.E.S .
     'Harvest Fridge*' -10 126 -3 true}}
    Harvest: {{i18n Id}}➔
    {{~i18n ChildOnHarvestId}}
    get {{DropOnHarvestCount}}:
    {{~i18n DropOnHarvestId}}
    {{/harvest}}
    {{/blocks}}
    c
    
    still it breaks if i change y and if I swap the first and second x or z

    ps: I did all of this at night between 1:00 and 2:45, so i might have made some things wrong or missed clues. still it did strange things...
     
    #388
    Last edited: Apr 17, 2022
  9. Homunk

    Homunk Lieutenant

    Joined:
    Mar 22, 2020
    Messages:
    74
    Likes Received:
    26
    Hi Astic,
    after updating your mod to the latest version, I also setup the harvest script, which works as expected. But I have a problem with the displaying LCD. First, I am not sure, how it has to be named, second it shows the status only for a second, then it goes blank. This repeats every 10s. What am I doing wrong?

    The other thing is, that hydroponics from Reforged Eden are ignored. Would it be possible to have them harvested automatically as well?

    Thanks for your mod and have a nice day
     
    #389
  10. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,085
    Likes Received:
    731
    1. This happens when more than one Script uses the same output LCD
    2. Fix "harvest" to handle EdenHydroponicsBay correct
      https://github.com/GitHub-TC/EmpyrionScripting/releases/tag/9.0.2
     
    #390
    Last edited: Apr 17, 2022
    Homunk likes this.
  11. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,085
    Likes Received:
    731
    #391
  12. Homunk

    Homunk Lieutenant

    Joined:
    Mar 22, 2020
    Messages:
    74
    Likes Received:
    26
    Sorry, but still won't harvest the Reforged Eden hydroponics. Or do I need to modify the script? And if so, how?
     
    #392
  13. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,085
    Likes Received:
    731
    You don't need to modify the scripts for harvesting, the 9.0.2 can handle the normal plants and the RE hydroponic plants correct.
     
    #393
  14. ...M-o-H...

    ...M-o-H... Lieutenant

    Joined:
    Feb 26, 2018
    Messages:
    64
    Likes Received:
    10
    {{#blocks E.S 35 137 49 40 137 108 }}
    {{#each .}}
    {{Id}} {{i18n Id}} X:
    {{~Position.X}} Y:
    {{~Position.Y}} Z:
    {{~Position.Z}}
    {{/each}}
    {{#harvest @root.E.S .
    'MainFridge' 40 136 23 true}}
    Harvest: {{i18n Id}}➔
    {{~i18n ChildOnHarvestId}}
    get {{DropOnHarvestCount}}:
    {{~i18n DropOnHarvestId}}
    {{/harvest}}
    {{/blocks}}


    Hello, have the script now also running.
    it also works everything except for the fridge which is unfortunately not displayed to me on the lcd. can anyone tell me what I'm doing wrong?
     
    #394
  15. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,085
    Likes Received:
    731
    You have to use the custom name of the fridge, not the devicetype to access the fridge as a container
     
    #395
  16. ...M-o-H...

    ...M-o-H... Lieutenant

    Joined:
    Feb 26, 2018
    Messages:
    64
    Likes Received:
    10

    LCD is called -> MainFridgeLCD

    Refrigerator is called -> MainFridge
     
    #396
  17. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,085
    Likes Received:
    731
    On the demo ship, the contents of the refrigerator are determined separately by its name. On the Vaga AI, I have switched to addressing all containers only via a naming scheme. This works for boxes, containers, refrigerators, dressing stations and repair stations alike.
     
    #397
    ...M-o-H... likes this.
  18. ...M-o-H...

    ...M-o-H... Lieutenant

    Joined:
    Feb 26, 2018
    Messages:
    64
    Likes Received:
    10
    hmm okey from the Vega AI I have no plan how to find the right one. Thank you
     
    #398
  19. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,085
    Likes Received:
    731
    Naming "Box-*" for all normal displays an "IBox-*" for display with the item ID on the matching LCD display "Info-*"
    Code:
    {{set 'W' (bar 1 0 1 35 '═')}}
    {{#devices @root.E.S 'Box-*;IBox-*'}}
    {{#each .}}{{#use CustomName}}
    {{set 'WI' (startswith . 'I')}}
    {{set 'N' .}}
    {{split . '-'}}
    {{set 'BN' .1}}
    {{/split}}{{/use}}
    {{set 'VC' Device.VolumeCapacity}}
    {{devices @root.E.S
    (concat 'Info-' @root.Data.BN '*')}}
    {{#each .}}
    {{#split CustomName '-'}}{{#if .2}}{{set 'SL' .2}}{{else}}{{set 'SL' '25'}}{{/if}}{{/split}}
    {{settextblock .}}
    {{~#items @root.E.S @root.data.N}}
    {{~#math @root.Data.T '+' (calc (configattr Id 'Volume') '*' Count)}}{{~set 'T' .}}{{~/math}}
    {{~setblock 'D'}}{{@root.Data.D}}
    <pos=5em>◉ {{#ok @root.Data.WI}}{{format Id '({0,4}) '}}{{/ok}}
    {{~substring (i18n Id) 0 24}} {{format Count '<indent=70%>➢ {0,0:N0}</indent>'}}{{/setblock}}
    {{~/items}}
    {{~#math (calc @root.Data.T '/' @root.Data.VC) '*' 100}}{{~set 'P' .}}{{/math}}
    {{~#use @root.Data.P}}
    {{~#test . leq '50'}}{{set 'c1' '1D1'}}{{set 'c2' '030'}}{{/test}}
    {{~#test . in '50-75'}}{{set 'c1' 'DA1'}}{{set 'c2' '220'}}{{/test}}
    {{~#test . in '75-90'}}{{set 'c1' 'B40'}}{{set 'c2' '310'}}{{/test}}
    {{~#test . geq '90'}}{{set 'c1' 'D11'}}{{set 'c2' '300'}}{{/test}}
    {{/use}}
    <align=center><color=white><line-height=4px>
    <size=400%><sprite name="Storage">
    </size></line-height>
    {{test Id eq 1400}}<line-height=-2px>{{else}}<line-height=-2px>{{/test}}
    
    {{islocked @root.E.S ../../../}}<color=red>⛔⛔
    {{~#intervall 1}}
     Locked
    {{~else}} {{@root.data.BN}}
    {{~/intervall}} ⛔⛔</color>
    {{else}}
    {{@root.data.BN}}
    {{/islocked}}</line-height>
    <size=50%>
    Vol : {{concat '<color=#' @root.Data.c1 '>'}}
    {{~bar @root.Data.T 0 @root.Data.VC 10 '▒' (concat '<color=#' @root.Data.c2 '>░</color>')}} [
    {{~format @root.Data.T '{0,0:N0}'}} / {{format @root.Data.VC '{0,0:N0}'}}]</color></align>
    {{scroll @root.Data.SL 2 4}}{{@root.Data.D}}{{~/scroll}}
    {{~set 'T' 0}}{{set 'D' ''}}</size></color>
    {{~/settextblock}}{{/each}}{{/devices}}{{/each}}{{/devices}}
     
    #399
  20. Homunk

    Homunk Lieutenant

    Joined:
    Mar 22, 2020
    Messages:
    74
    Likes Received:
    26
    Hi Astic,
    still having problems with the ReforgedEdenHydroponicBays. Those where you harvest 9x what you get from a standard hydroponic block. They are never harvested. All the standard hydroponic blocks work well on my planetary base.

    And now I have another problem. In my space station some of the hydroponics have one or more negative coordinates, as well as the gardener. This seems to make the script not working at all, since nothing there is harvested, although it uses the same script.

    Empyrion scripting mod is version 9.0.2.

    Thanks for your help
     
    #400

Share This Page