[MOD EXT] Empyrion Scripting - Scripts

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

  1. rchamp26

    rchamp26 Ensign

    Joined:
    Jun 23, 2021
    Messages:
    4
    Likes Received:
    3
    I ported the scripts from the vega-ai to jrandalls mcrn 258. All worked well in creative. I spawned it into a new SP game to test and they all work well, but for only a short time. After a while I get what seems to be an fps drop/lag delay tick, though fps stays around 70fps. And when I go to look at the screens I see that the time onboard ticker stops updating. I stop seeing the seconds increment. I have to exit the game and reload.

    Same thing happens every game load, which is a shame because these scripts drastically help in a sp playthrough keeping sanity.

    I check the console logs from time to time and don't see any errors. I guess perhaps the game choking on all the scripts?
     
    #321
    Ephoie likes this.
  2. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    Unfortunately, the API of the game does not work well in SP - so it is better to set up a dedicated server locally or play on one that has the ScriptingMod active.
     
    #322
    Ephoie likes this.
  3. rchamp26

    rchamp26 Ensign

    Joined:
    Jun 23, 2021
    Messages:
    4
    Likes Received:
    3
    Bummer, ok. I'll look into setting up a dedicated server. Fantastic work Astic. I have so much fun with this mod
     
    #323
    Ephoie and Tyrion like this.
  4. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    #324
    Ephoie, Tyrion and me777 like this.
  5. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    @LowFly
    https://github.com/GitHub-TC/EmpyrionScripting#readme

    Lokale Variablen:
    • {{set key data}}
      • Die Daten (data) hinterlegen so dass sie per @root.Data.(key) jederzeit wieder abgerufen werden können


    Globale Variablen:
    1. {{setcache key data}}
    • Die Daten (data) hinterlegen so dass sie per @root.CacheData.(key) jederzeit wieder abgerufen werden können.
    • Diese werden für die Entität gespeichert und stehen beim nächsten Scriptaufruf wieder zur Verfügung können jedoch durch Playfieldwechel oder ähnliches verworfen werden.
     
    #325
    Ephoie likes this.
  6. Ephoie

    Ephoie Captain

    Joined:
    Jan 27, 2018
    Messages:
    331
    Likes Received:
    517
    So pleased to see how far this thread has come.

    Let's keep it up!
    Hopefully, the Devs are paying attention to this content!
     
    #326
    ASTIC likes this.
  7. Ephoie

    Ephoie Captain

    Joined:
    Jan 27, 2018
    Messages:
    331
    Likes Received:
    517
    @Hummel-o-War
    XOXO
     
    #327
    ASTIC likes this.
  8. kfurrow

    kfurrow Ensign

    Joined:
    Feb 3, 2022
    Messages:
    5
    Likes Received:
    0
    Fantastic Work, Astic! I've used the demo from the workshop to learn what is going on but it took a lot of testing and errors to get started. However, I have not seen any way to insert comments to the LCDs that contain the scripts. Is there a special character to denote the start of a comment? It would make it much easier to share scrips if there were comments.

    Also I've found that copy/paste (Ctrl-C/Ctrl-V) from one screen (or a web page) to another LCD does not work, the pasted scripts look fine but don't run unless I re-type everything using the keyboard. Is this expected or do I have something strange with my system? Using Windows 10 with US localization (region settings).
     
    #328
  9. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    You can add comments with
    Code:
    {{! This is a comment}}
    The editor of the LCDs is unfortunately - quite buggy - for more complex scripts I use VisualStudioCode as editor and copy scripts in and out from there via Ctrl-C/V.
    PS: VS Code has also an AddOn for Handlebars-Syntaxhighlighting
     
    #329
  10. kfurrow

    kfurrow Ensign

    Joined:
    Feb 3, 2022
    Messages:
    5
    Likes Received:
    0
    Thanks, Astic! Now I can add comments to help remember _why_ a line or loop exists. I also solved my copy/paste issue, it turned out Sophos AV has a keyboard logger protection that was interfering with Empyrion in general. Disabled that function and copy/paste works now. Sophos had also been affecting Alt-Tab switching, often the keyboard driver would output garbage after switching out, then back to Empyrion.
     
    #330
  11. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    #331
  12. me777

    me777 Commander

    Joined:
    Aug 18, 2020
    Messages:
    405
    Likes Received:
    138
    Thank you for trying, ASTIC.

    It's too bad, I really did like the extra I got from the C# Scripts (Your Cargo Teleport, my own Cargo Transfer and my newest in-progress harvest-script)
    Also I grown to like Space Engineer as I played it while I waited for results as what the update broke...
    I mights stay there until Scripting works again and the new Reforged Eden is out.

    Thanks again and have a nice day.
     
    #332
    ASTIC likes this.
  13. Thorgroem

    Thorgroem Ensign

    Joined:
    Feb 19, 2022
    Messages:
    7
    Likes Received:
    0
    Hi ASTIC,
    Thanks for your fantastic job.
    I try to understand this langage but it's really difficult for me.
    I'd try to follow your vids but the youtube translation is really really bad to translate german in english and most in french. As you can read my english is not good too.
    What language do you use ?
    Have you edit an index about this language ?

    Thanks
     
    #333
  14. Thorgroem

    Thorgroem Ensign

    Joined:
    Feb 19, 2022
    Messages:
    7
    Likes Received:
    0
    Hi ASTIC,
    Is it possible to write in 2 LCD by a script ?
    I use a script (Script:LCD_Test_A) and 2 LCD (LCD_Test_A & LCD_Test_B] but I don't want the same text on each.
    by ex : in first i want to see the action use and the second i want a resume.
     
    #334
  15. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    In this case you have to use settext or settextblock to write the text directly into the LCDs.
     
    #335
  16. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    #336
  17. Thorgroem

    Thorgroem Ensign

    Joined:
    Feb 19, 2022
    Messages:
    7
    Likes Received:
    0
    Hi & thanks for your answer.
    Another problem :)
    How to know the coordinate of a block to use the command {{Block <structure x y z}} ?
    The values of x y z are the number of block; meters or other ?
    I don't understand where is the coordinate 0 0 0 : the script ? the core ?

    Sorry for all this questions and thanls for patience ;)
     
    #337
  18. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    • x,y,z: Are the grid coordinates within the structure. You get them via 'di' when your character looks at a block/object.
    • 0,0,0: Has no special meaning, the structure goes from S.MinPos to S.MaxPos (where these are vectors x,y,z)
     
    #338
  19. Thorgroem

    Thorgroem Ensign

    Joined:
    Feb 19, 2022
    Messages:
    7
    Likes Received:
    0
    Hi,
    Thanks for your answer.
    One day one question ;)........... Sorry
    Is it possible to change by a script the container name ?
    I want to create an warehouse with many containers and when i put a ore in one, i want to change automaticaly the container name with the item's name.
    Sorry to keep your time.
     
    #339
  20. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,074
    Likes Received:
    729
    Is it possible to change by a script the container name ? --> No, there is no API available for this.
     
    #340
    Thorgroem likes this.

Share This Page