[MOD EXT] Empyrion Scripting - Scripts

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

  1. Shadowpheonix

    Shadowpheonix Lieutenant

    Joined:
    May 19, 2022
    Messages:
    46
    Likes Received:
    12
    I was aware that {{split ... }} would convert it to an array - but did not think it necessary to include in the example since it would do so without creating any sort of key:value pairing (as far as I know anyway). Is their a way to get {{split ..}} to define a key, or a way to manually create an array using {{set ... }}? (Being able to do this would be useful for things besides sorting.)

    And just because I am sure you do not hear it often enough, thank you very much for your amazing work on Empyrion Scripting (and all of your other mods as well)!
     
    #641
  2. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,094
    Likes Received:
    735
    First for sorting an array...
    https://github.com/GitHub-TC/EmpyrionScripting/releases/tag/11.2.2

    [​IMG]

    and i'll have to think about creating dictionaries....
     
    #642
    Sephrajin and Shadowpheonix like this.
  3. Shadowpheonix

    Shadowpheonix Lieutenant

    Joined:
    May 19, 2022
    Messages:
    46
    Likes Received:
    12
    Thank you for adding that so quickly.

    While I was looking for a workaround (meaning a way to convert a list to an array), I noticed the {{fromjson ... }} command in the documentation. I looked, but could not find an example of it in your demo CV. I tried it out, and as far as I can tell all it does is make the JSON pretty (IE: it adds line breaks and spacing). Is that correct, or does it have some other functionality?

    Here's the code I used to test it (I was expecting a result of "EmpyrionScripting.DataWrapper.StructureData" or something similar)...
    Code:
    {{#fromjson '{"MainKey":[{"Subkey1":[],"SubKey2":["Value1","Value2"]}]}'}}
    {{set 't' .}}
    {{/fromjson}}
    {{@root.Data.t}}
    
     
    #643
  4. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,094
    Likes Received:
    735
    The creation of dictionaries is unfortunately not easily possible via JSON, but I'm working on it ;-)
    PS: Thank you for your donation :-D
     
    #644
  5. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,094
    Likes Received:
    735
    EmpyrionScripting 11.2.3 : add 'jsontodictonary' for easy create those objects
    https://github.com/GitHub-TC/EmpyrionScripting/releases/tag/11.2.3

    [​IMG]
     
    #645
    Shadowpheonix likes this.
  6. Shadowpheonix

    Shadowpheonix Lieutenant

    Joined:
    May 19, 2022
    Messages:
    46
    Likes Received:
    12
    Thank you very much for the sort changes and the new 'jsontodictionary' command. They will be very useful for my save game script AutoSorter (which is basically a complete rewrite of the Dynamic AutoSort script posted earlier in this thread).

    It appears that the 'jsontodictionary' does not support nested objects (IE: '{"Stuff":{"Fruits":["Apple","Orange"],"Animals":["Dog","Cat"]}}'). Any chance of getting that added? (Or if you know a way to reliably use 'split' or something else to break it down and obtain each child object to process them individually, that would work too.)

    And on a potentially related note, would it be reasonably possible to modify 'set' to support creation of arrays/objects (including child/nested)? IE: {{set 'MyArray.MyData' 'This is test data'}} and {{set 'MyArray.MyArray2.MyData' 'This is more test data'}}
     
    #646
  7. Sephrajin

    Sephrajin Rear Admiral

    Joined:
    Dec 22, 2017
    Messages:
    916
    Likes Received:
    2,918
    Das gilt für jeweils für das aktuelle Objekt.

    Hab sein Script grad nicht auswendig im Kopf, aber ich sehe folgendes dilemma, nur weil CultureInfo drauf ist, heisst das nicht das alle "hardcoded" Sprach-definitonen in scripten verschwinden (welche, natürlich, CultureInfo "überschreiben").
     
    #647
  8. Sephrajin

    Sephrajin Rear Admiral

    Joined:
    Dec 22, 2017
    Messages:
    916
    Likes Received:
    2,918
    That is part of it, see:
    https://github.com/sri-arjuna/Empyr...raetorium/2. Sorting/StageSort3_FoodMedic.lua
     
    #648
  9. BugiTree

    BugiTree Ensign

    Joined:
    Oct 3, 2022
    Messages:
    24
    Likes Received:
    0
    Danke für die schnelle Info :)
     
    #649
  10. Shadowpheonix

    Shadowpheonix Lieutenant

    Joined:
    May 19, 2022
    Messages:
    46
    Likes Received:
    12
    I finally got my Automatic/Dynamic Sorter script working in a manner that suits my needs (special thanks to Sephrajin for assistance getting the Move activity to remain in the output log long enough to actually read it).

    It sorts items individually (if you want sorting by item type/category, check out the Tidy mod) with precise control over quantity per container.

    I am sure it is very poorly optimized & inefficient, so suggestions on how to improve that would definitely be welcome. :D


    NOTE: This is a Save Game Script. It will not work by copying & pasting into an LCD. Basic (and possibly incomplete) usage instructions are in the comments at the top of the HBS file, and also in the spoiler below (I hid it to avoid cluttering the forum for those who are not interested in it).

    Script: LCD Based Automated Inventory Movement System (LBAIMS)
    Author: Shadowpheonix
    Version: 202304280817
    File Name: LBAIMS.HBS
    Description:
    - This script is heavily inspired by (and I could not have made it without) Luke Benko's update to Shadowviper's Dynamic Transfer/Sorting System (https://empyriononline.com/threads/mod-ext-empyrion-scripting-scripts.92458/page-24#post-451253).
    - It takes items from an 'AIMS_Deposit' container and moves them to the correct location on the current ship or base. It will not move things to other ships or bases.
    - The script respects Volume/Mass limitations if they are enabled - if all designated containers for a specific item are full, any excess of that item will be retained in 'AIMS_Unsorted' (if it exists and is not full) or in 'AIMS_Deposit'.

    Configuration/Setup:
    Required:
    - This script in your '<gamename>\Mods\EmpyrionScripting\Scripts' folder where '<gamename>' is the name of your saved game.
    - An LCD for EACH container you want to manage, with the LCD name set to the name of the container prefixed with either 'AIH_', 'AIL_', or 'AIN_'.
    IE: If your container is named 'MainStorage', then your LCD would be either 'AIH_MainStorage', 'AIL_MainStorage', or 'AIN_MainStorage'.
    'AIH_' is for high-priority, 'AIL_' is for low-priority, and 'AIN_' is for normal-priority.
    The prefixes can be changed using the optional LBAIM_Config mentioned below.
    - A switch named 'AIMS_Cataloging'.
    Unfortunately, Control Panel switches will not work - it must be a physical switch.
    The name can be changed using the optional LBAIM_Config mentioned below.
    - A switch named 'AIMS_Sorting'.
    Unfortunately, Control Panel switches will not work - it must be a physical switch.
    The name can be changed using the optional LBAIM_Config mentioned below.

    Optional:
    - An LCD named LBAIMS to display the activity log.
    - An LCD named LBAIM_Config to allow customizing the script configuration.
    On that configuration, most entries should be self explanatory - however...
    ~ LBAIMInterval is used as a multiplier to the 'SaveGameScriptsIntervallMS' setting in Empyrion Scripting's Configuration.json to control how often this script runs.
    For example, if 'SaveGameScriptsIntervallMS' is at the default 10000 and 'LBAIMInterval' is set to 3 (the default), this script will wind up running every 30000 milliseconds (IE: twice per minute).
    ~ AutoStop must be either 'true' or 'false' (without the quotes), and is case sensitive.
    If you set this to false, then it is STRONGLY recommended that you also increase 'LBAIMInterval' in order to minimize this script's performance impact.
    - A container with a name starting with 'AIMS_Deposit' (this is recommended, but not mandatory).
    You can have multiple if desired (IE: 'AIMS_Deposit 0', 'AIMS_Deposit 1', 'AIMS_Deposit 2' and so on).
    Do NOT assign an LCD to these.
    The name can be changed using the optional LBAIM_Config mentioned above.
    - A container with a name starting with 'AIMS_Unsorted' for storing items that could not be placed into an assigned container (this is highly recommended, but not mandatory).
    You can have multiple if desired (IE: 'AIMS_Unsorted 0', 'AIMS_Unsorted 1', 'AIMS_Unsorted 2' and so on).
    Do NOT assign an LCD to these.
    The name can be changed using the optional LBAIM_Config mentioned above.
    - LCDs named 'AIT_Fuel', 'AIT_Oxygen', and/or 'AIT_Pentaxid' for automatically keeping your tanks topped up.
    Only one LCD is needed for each type - you do not need separate ones for each individual tank.
    These LCDs will NOT be automatically updated during cataloging - you will need to manually update them (I recommend copying & pasting any relevant item entries from a managed storage container's LCD, then changing the Quantity value to the percentage fill you want).
    These fall between 'AIP_' and 'AIN_' as far as priority - meaing 'AIP_' designated containers will be stocked first, then the tanks will be filled, then 'AIH_' and lower priority containers will be stocked.
    The names can be changed using the optional LBAIM_Config mentioned above.
    - A container named 'AIMS_Trash' and an LCD with an IDENTICAL name.
    The LCD for this one is formatted differently from the other catalog LCDs, and is not automatically updated during cataloging.
    The LCD needs to be manually updated, and should contain ONLY a list of item names & IDs (IE: 'Iron Ingot;4320'), with one entry per line - do NOT include quantities.
    Items will be moved into this container ONLY from the 'AIMS_Unsorted' containers, making at least one of them mandatory of you want to use this feature.
    The contents of this container will be ***PERMANENTLY DELETED**** after the sort process completes.
    This is intended for situations where you are getting far too much of an item (such as Crushed Stone) and want to automatically discard the excess.
    The name can be changed using the optional LBAIM_Config mentioned above.

    First Time Usage:
    1. Set everything up, per the instructions above.
    2. Ensure that both the 'AIMS_Cataloging' and 'AIMS_Sorting' switches are OFF.
    3. Place at least one of each item you want a managed container to store into that container.
    4. Turn on the 'AIMS_Cataloging' switch.
    - The script will then go through and create entries for each item on each container's matching LCD, formatted as 'Item Name;Item ID#Quantity' - IE: 'Iron ingot;4320#1'.
    Note: The 'Item Name' used is what the Empyrion API returns as the language localized item name and may be different than what you see in game, especially if you are playing a custom scenario - for example, I get '12.7mmBullet' instead of '12.7mm Sniper Round' when playing Space Cowboy's variant of Reforged Eden (https://steamcommunity.com/sharedfiles/filedetails/?id=2583255414).
    5. Wait about 2 minutes or so for the cataloging to be completed.
    - If you placed the LBAIMS LCD, it will display a message stating 'cataloging complete'.
    - If you are playing single-player, it is recommended to turn the switch off at this point to minimize the script's impact on game performance.
    If 'AutoStop' is set to 'true' then the switch will turn off automatically in multiplayer, but due to a bug in the Empyrion API this is not currently possible in single-player.
    6. Edit any 'AIH_', 'AIN_', or 'AIL_' LCDs that you placed and specify the actual quantities you want for each item.
    - IE: Change 'Iron ingot;4320#1' to 'Iron ingot;4320#16000' to have that container hold up to 16000 Iron Ingots.
    7. Place items to be sorted into any 'AIP_', 'AIN_', 'AIL_', 'AIMS_Deposit', or 'AIMS_Unsorted' container ('AIMS_Deposit' is optimal for this), then turn on the 'AIMS_Sorting' switch.
    - The script will then go through and check all the 'AIH_', 'AIN_', and 'AIL_' LCDs to see where the new items should be moved to.
    - Any 'AIH_' designated storage will have priority over (and will also pull from) 'AIN_' and 'AIL_' containers, ensuring the 'AIH_' containers reach their quantity settings first.
    This is very handy for constructor input and ammunition containers.
    - Any 'AIN_' designated storage will be sorted next, and will have priority over (and also pull from) 'AIL_' containers.
    This should be used for your general storage needs.
    - Any 'AIL_' containers will be filled last.
    I recommend using this for things like Deconstructor and Furnace input containers.
    - If all the assigned containers have reached their specified quantity settings (or are full), or there are no assigned containers for an item, the items will be moved to the 'AIMS_Unsorted' container.
    If there are no 'AIMS_Unsorted' containers (or they are full), the items will not be moved.
    - Finally, if 'AIMS_Trash' has been setup, items whose IDs are listed on the 'AIMS_Trash' LCD will be moved into the 'AIMS_Trash' container from any 'AIMS_Unsorted' containers.
    Once the sort process has been fully completed, the contents of the 'AIMS_Trash' container will be ***PERMANENTLY DELETED****.
    8. Wait about 2 minutes or so for the sorting to be completed.
    - If you placed the LBAIMS LCD, it will display a message stating 'sorting complete'.
    - If you are playing single-player, it is recommended to turn the switch off at this point to minimize the script's impact on game performance.
    If 'AutoStop' is set to 'true' then the switch will turn off automatically in multiplayer, but due to a bug in the Empyrion API this is not currently possible in single-player.

    Ongoing Usage:
    - Repeat steps 2 through 6 above whenever you want to add completely new items into a container.
    - Repeat step 6 whenever you want to change the quantity limit of an item in a container.
    Remove the item's entry entirely if you no longer want that item in that container.
    - Repeat steps 7 and 8 whenever you aquire more items you want to store.
    - Be sure to check any 'AIMS_Unsorted' containers after every sort for leftover items.

    Notes for server administrators:
    - Set the 'LBAIMIntervalMinimum' value to the minimum value you want users to be able to set LBAIMInterval to.
    - If desired, you can edit the 'UserVariableList' entry and the 'Default ConfigLCDName contents' section to remove any settings that you do not want your users to customize.
    Script: LCD Based Automated Inventory Movement System (LBAIMS)
    Author: Shadowpheonix
    Version: 202304280817
    File Name: LBAIMS.HBS
    Description:
    - This script is heavily inspired by (and I could not have made it without) Luke Benko's update to Shadowviper's Dynamic Transfer/Sorting System (https://empyriononline.com/threads/mod-ext-empyrion-scripting-scripts.92458/page-24#post-451253).
    - It takes items from an 'AIMS_Deposit' container and moves them to the correct location on the current ship or base. It will not move things to other ships or bases.
    - The script respects Volume/Mass limitations if they are enabled - if all designated containers for a specific item are full, any excess of that item will be retained in 'AIMS_Unsorted' (if it exists and is not full) or in 'AIMS_Deposit'.

    Configuration/Setup:
    Required:
    - This script in your '<gamename>\Mods\EmpyrionScripting\Scripts' folder where '<gamename>' is the name of your saved game.
    - An LCD for EACH container you want to manage, with the LCD name set to the name of the container prefixed with either 'AIH_', 'AIL_', or 'AIN_'.
    IE: If your container is named 'MainStorage', then your LCD would be either 'AIH_MainStorage', 'AIL_MainStorage', or 'AIN_MainStorage'.
    'AIH_' is for high-priority, 'AIL_' is for low-priority, and 'AIN_' is for normal-priority.
    The prefixes can be changed using the optional LBAIM_Config mentioned below.
    - A switch named 'AIMS_Cataloging'.
    Unfortunately, Control Panel switches will not work - it must be a physical switch.
    The name can be changed using the optional LBAIM_Config mentioned below.
    - A switch named 'AIMS_Sorting'.
    Unfortunately, Control Panel switches will not work - it must be a physical switch.
    The name can be changed using the optional LBAIM_Config mentioned below.

    Optional:
    - An LCD named LBAIMS to display the activity log.
    - An LCD named LBAIM_Config to allow customizing the script configuration.
    On that configuration, most entries should be self explanatory - however...
    ~ LBAIMInterval is used as a multiplier to the 'SaveGameScriptsIntervallMS' setting in Empyrion Scripting's Configuration.json to control how often this script runs.
    For example, if 'SaveGameScriptsIntervallMS' is at the default 10000 and 'LBAIMInterval' is set to 3 (the default), this script will wind up running every 30000 milliseconds (IE: twice per minute).
    ~ AutoStop must be either 'true' or 'false' (without the quotes), and is case sensitive.
    If you set this to false, then it is STRONGLY recommended that you also increase 'LBAIMInterval' in order to minimize this script's performance impact.
    - A container with a name starting with 'AIMS_Deposit' (this is recommended, but not mandatory).
    You can have multiple if desired (IE: 'AIMS_Deposit 0', 'AIMS_Deposit 1', 'AIMS_Deposit 2' and so on).
    Do NOT assign an LCD to these.
    The name can be changed using the optional LBAIM_Config mentioned above.
    - A container with a name starting with 'AIMS_Unsorted' for storing items that could not be placed into an assigned container (this is highly recommended, but not mandatory).
    You can have multiple if desired (IE: 'AIMS_Unsorted 0', 'AIMS_Unsorted 1', 'AIMS_Unsorted 2' and so on).
    Do NOT assign an LCD to these.
    The name can be changed using the optional LBAIM_Config mentioned above.
    - LCDs named 'AIT_Fuel', 'AIT_Oxygen', and/or 'AIT_Pentaxid' for automatically keeping your tanks topped up.
    Only one LCD is needed for each type - you do not need separate ones for each individual tank.
    These LCDs will NOT be automatically updated during cataloging - you will need to manually update them (I recommend copying & pasting any relevant item entries from a managed storage container's LCD, then changing the Quantity value to the percentage fill you want).
    These fall between 'AIP_' and 'AIN_' as far as priority - meaing 'AIP_' designated containers will be stocked first, then the tanks will be filled, then 'AIH_' and lower priority containers will be stocked.
    The names can be changed using the optional LBAIM_Config mentioned above.
    - A container named 'AIMS_Trash' and an LCD with an IDENTICAL name.
    The LCD for this one is formatted differently from the other catalog LCDs, and is not automatically updated during cataloging.
    The LCD needs to be manually updated, and should contain ONLY a list of item names & IDs (IE: 'Iron Ingot;4320'), with one entry per line - do NOT include quantities.
    Items will be moved into this container ONLY from the 'AIMS_Unsorted' containers, making at least one of them mandatory of you want to use this feature.
    The contents of this container will be ***PERMANENTLY DELETED**** after the sort process completes.
    This is intended for situations where you are getting far too much of an item (such as Crushed Stone) and want to automatically discard the excess.
    The name can be changed using the optional LBAIM_Config mentioned above.

    First Time Usage:
    1. Set everything up, per the instructions above.
    2. Ensure that both the 'AIMS_Cataloging' and 'AIMS_Sorting' switches are OFF.
    3. Place at least one of each item you want a managed container to store into that container.
    4. Turn on the 'AIMS_Cataloging' switch.
    - The script will then go through and create entries for each item on each container's matching LCD, formatted as 'Item Name;Item ID#Quantity' - IE: 'Iron ingot;4320#1'.
    Note: The 'Item Name' used is what the Empyrion API returns as the language localized item name and may be different than what you see in game, especially if you are playing a custom scenario - for example, I get '12.7mmBullet' instead of '12.7mm Sniper Round' when playing Space Cowboy's variant of Reforged Eden (https://steamcommunity.com/sharedfiles/filedetails/?id=2583255414).
    5. Wait about 2 minutes or so for the cataloging to be completed.
    - If you placed the LBAIMS LCD, it will display a message stating 'cataloging complete'.
    - If you are playing single-player, it is recommended to turn the switch off at this point to minimize the script's impact on game performance.
    If 'AutoStop' is set to 'true' then the switch will turn off automatically in multiplayer, but due to a bug in the Empyrion API this is not currently possible in single-player.
    6. Edit any 'AIH_', 'AIN_', or 'AIL_' LCDs that you placed and specify the actual quantities you want for each item.
    - IE: Change 'Iron ingot;4320#1' to 'Iron ingot;4320#16000' to have that container hold up to 16000 Iron Ingots.
    7. Place items to be sorted into any 'AIP_', 'AIN_', 'AIL_', 'AIMS_Deposit', or 'AIMS_Unsorted' container ('AIMS_Deposit' is optimal for this), then turn on the 'AIMS_Sorting' switch.
    - The script will then go through and check all the 'AIH_', 'AIN_', and 'AIL_' LCDs to see where the new items should be moved to.
    - Any 'AIH_' designated storage will have priority over (and will also pull from) 'AIN_' and 'AIL_' containers, ensuring the 'AIH_' containers reach their quantity settings first.
    This is very handy for constructor input and ammunition containers.
    - Any 'AIN_' designated storage will be sorted next, and will have priority over (and also pull from) 'AIL_' containers.
    This should be used for your general storage needs.
    - Any 'AIL_' containers will be filled last.
    I recommend using this for things like Deconstructor and Furnace input containers.
    - If all the assigned containers have reached their specified quantity settings (or are full), or there are no assigned containers for an item, the items will be moved to the 'AIMS_Unsorted' container.
    If there are no 'AIMS_Unsorted' containers (or they are full), the items will not be moved.
    - Finally, if 'AIMS_Trash' has been setup, items whose IDs are listed on the 'AIMS_Trash' LCD will be moved into the 'AIMS_Trash' container from any 'AIMS_Unsorted' containers.
    Once the sort process has been fully completed, the contents of the 'AIMS_Trash' container will be ***PERMANENTLY DELETED****.
    8. Wait about 2 minutes or so for the sorting to be completed.
    - If you placed the LBAIMS LCD, it will display a message stating 'sorting complete'.
    - If you are playing single-player, it is recommended to turn the switch off at this point to minimize the script's impact on game performance.
    If 'AutoStop' is set to 'true' then the switch will turn off automatically in multiplayer, but due to a bug in the Empyrion API this is not currently possible in single-player.

    Ongoing Usage:
    - Repeat steps 2 through 6 above whenever you want to add completely new items into a container.
    - Repeat step 6 whenever you want to change the quantity limit of an item in a container.
    Remove the item's entry entirely if you no longer want that item in that container.
    - Repeat steps 7 and 8 whenever you aquire more items you want to store.
    - Be sure to check any 'AIMS_Unsorted' containers after every sort for leftover items.

    Notes for server administrators:
    - Set the 'LBAIMIntervalMinimum' value to the minimum value you want users to be able to set LBAIMInterval to.
    - If desired, you can edit the 'UserVariableList' entry and the 'Default ConfigLCDName contents' section to remove any settings that you do not want your users to customize.

    Note: This script can still run into the 2000 character limit on LCDs if you are not careful (thus far I have been able to deal with it by manually abbreviating some item names when I get near the limit).
     

    Attached Files:

    #650
    Last edited: May 18, 2023
    FelixRuss likes this.
  11. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,094
    Likes Received:
    735
    The output LCD shows alsway the current outputs. If you wat to see the "hisrory" you have to add a [+NN] to your script LCD name like
    Code:
    Script:[+40]Scriptoutputname
    
    Scriptoutputname = your scriptname
     
    #651
  12. Sephrajin

    Sephrajin Rear Admiral

    Joined:
    Dec 22, 2017
    Messages:
    916
    Likes Received:
    2,918
    #652
    Mycroft_Groks and ASTIC like this.
  13. Shadowpheonix

    Shadowpheonix Lieutenant

    Joined:
    May 19, 2022
    Messages:
    46
    Likes Received:
    12
    How do I add the "[+40]" for Save Game Scripts? As far as I know, it is not used for things like your ActiveRadar.hbs which leaves text on the screen without issue for me. My script uses the "{{settextblock}}" and "{{scroll}}" tags with the same (I think) format as your ActiveRadar.hbs).
     
    #653
    Last edited: Mar 9, 2023
  14. Sephrajin

    Sephrajin Rear Admiral

    Joined:
    Dec 22, 2017
    Messages:
    916
    Likes Received:
    2,918
    The [+40] has nothing to do with "savegame scripts", its part of the LCD script name (CustomName - once sorted).

    Like:
    Code:
    Script:[+40]NAME
    EDIT:
    On a second note, the 40 defines how many lines the script should "append" (on top) of the output LCD.
    So if 40 is too much for you, just change it to something smaller, like 12.
     
    #654
  15. Shadowpheonix

    Shadowpheonix Lieutenant

    Joined:
    May 19, 2022
    Messages:
    46
    Likes Received:
    12
    That's why I am asking - the script that I am having issues with is a save game script that does not have a "script LCD" so there is nowhere for me to add the "[+40]". It has an output LCD that I specify using the "{{#settextblock}}" tag within the script itself, and is using the "{{#scroll}}" tag to (supposedly) control the number of lines displayed & scroll speed. Here are the specific, relevant sections of code from the script.
    Code:
    {{~set 'LogLCDName' 'AutoSortLog'}}     {{!-- The LCD name for log display --}}
    {{~set 'LogScrollLines' '25'}}    {{!-- The lines to show before scrolling --}}
    {{~set 'LogScrollSpeed' '5'}}   {{!-- The line scrolling speed, in seconds --}}
    ...
    {{~#devices @root.E.S @root.Data.LogLCDName}}
    {{~#each .}}
    {{~#settextblock .}}
    {{~#scroll @root.Data.LogScrollLines @root.Data.LogScrollSpeed}}
    ...
    {{~/scroll}}
    {{~/settextblock}}
    {{~/each}}
    {{~/devices}}
     
    #655
  16. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,094
    Likes Received:
    735
    @Shadowpheonix Even in Savegamescripts you have the option for an direct output target.

    [​IMG]

    [​IMG]

    or with the first line "Targets:" setting

    [​IMG]

    [​IMG]
     
    #656
  17. Shadowpheonix

    Shadowpheonix Lieutenant

    Joined:
    May 19, 2022
    Messages:
    46
    Likes Received:
    12
    This is definitely good information and will provide me with a workaround for now (hopefully - I will test later today). However, I would prefer to use an indirect output (meaning an output LCD specified via variable and targeted through "{{#settextblock}}"? Isn't that what the "{{#scroll}}" tag is for? (In other words, how do I make it work like it does in ActiveRadar.hbs?)
     
    #657
  18. Sephrajin

    Sephrajin Rear Admiral

    Joined:
    Dec 22, 2017
    Messages:
    916
    Likes Received:
    2,918
    Those are 2 different things.
    The scroll command shows/limits that many lines from the "existing" output.
    The [+NUM] preserves/appends output, aka, move,fill, etc only show output while active, but "clear" the output after (= temporary).

    So you do need [+NUM] and scroll to keep the temporary output, and then scroll through all the lines.

    EDIT:
    You still can write output that will be preserved on top or below the temporary recieved output.
     
    #658
  19. Shadowpheonix

    Shadowpheonix Lieutenant

    Joined:
    May 19, 2022
    Messages:
    46
    Likes Received:
    12
    Thank you very much for that information. I was not aware of the Move output being temporary like that (and would explain why my testing with the "[+40]" just now was having no effect). Assigning the output to a variable, then displaying that variable outside of the move fixed the issue for me. :NewThumbsUp:


    I have updated the post with my script in it with the new and now fully functional version.
     
    #659
    Last edited: Mar 9, 2023
  20. Sephrajin

    Sephrajin Rear Admiral

    Joined:
    Dec 22, 2017
    Messages:
    916
    Likes Received:
    2,918
    #660

Share This Page