[MOD EXT] Empyrion Scripting - Scripts

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

  1. |LG|Judge

    |LG|Judge Lieutenant

    Joined:
    Sep 9, 2015
    Messages:
    19
    Likes Received:
    1
    Super danke das wars =), versuche mich ein bisschen darin ein zu arbeiten =) aber als "script neuling" habe ich noch die eine oder andere schwierigkeit da durch zu blicken =)
     
    #201
  2. Slavens

    Slavens Lieutenant

    Joined:
    Jun 26, 2016
    Messages:
    10
    Likes Received:
    3
    Hey guys, I just found this whole LCD scripting thing and I'm fixing to jump in. I used to do a lot of C#, but I'm seriously rusty and I've never even heard of handlebars...

    I have a question for you on the SV HUD: Does the 'installer' script need to be in the same ship or can you have it in a CV and use it on the SV when the SV is docked?

    Because that would be some serious immersion.

    Anyway, I'm only on page 8 so I'm gonna keep reading and see if you found a fix.
     
    #202
  3. Slavens

    Slavens Lieutenant

    Joined:
    Jun 26, 2016
    Messages:
    10
    Likes Received:
    3
    Hey, what should I look at if I have a error CS0246 Newtonsoft not found?

    I have the example ship from the workshop and I'm running script ver 5.10.8. The error is on the Text LCD Access and Block Data screens.
    20201122184614_1.jpg

    thanks!
     
    #203
  4. Slavens

    Slavens Lieutenant

    Joined:
    Jun 26, 2016
    Messages:
    10
    Likes Received:
    3
    Hey bro, line 2 looks the same for both the BA and the SV. Did I miss something?

    I think it should be this for the CV, but I may have the ammo type for the Sentry Gun wrong
    Code:
    {{~set 'F' '769,2211;287,2104;290,2201;492,2205;557,2206;567,2102;646,2206;647,2205;702,2210;'}}
    but I can't get the script to re-run. I'm headed over to the other thread to see if I can figure out how to do that...

    [edit]
    I'm a dumbass. I was reading BA and thinking CV... Still, I'm trying to make it work on a CV.

    Thanks
     
    #204
    Last edited: Nov 23, 2020
  5. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    991
    Likes Received:
    707
    Sorry for the Newtonsoft i miss to add is as default in the config, but you can add it in your "customconfig"
    [EGS]\Saves\Games\[SavegameName]\Mods\EmpyrionScripting\CsCompilerConfiguration.json
    like the below
    Code:
    {
      "WithinLearnMode": true,
      "CustomAssemblies": [],
      "Usings": [
        "System.Globalization",
        "UnityEngine"
      ],
      "AssemblyReferences": [
        "Newtonsoft.Json"
      ],
      "SymbolPermissions": {
        "Player": [
          "EcfParser.*",
          "EgsEsExtension.*",
          "Eleon.Modding.IStructure.GetDevice",
          "EmpyrionScripting.Interface.IScriptModData.Ids",
          "System.Boolean",
          "System.Exception.*",
          "System.Globalization.*",
          "System.IFormatProvider",
          "System.object.GetType",
          "System.object.ToString",
          "System.StringSplitOptions.*",
          "System.Text.StringBuilder.*",
          "System.TimeSpan.*"
        ],
        "Admin": [],
        "SaveGame": [
          "Eleon.Modding.IModApi.Log",
          "Eleon.Modding.IModApi.SoundPlayer",
          "Eleon.Modding.ISoundPlayer.PlaySound",
          "Eleon.Modding.IStructure.Id",
          "Eleon.Modding.SoundPlayMode",
          "Eleon.Modding.SoundPlayMode.OneShot",
          "System.double.ToString"
        ]
      }
    }
    Another example you will find in my VeagAI https://steamcommunity.com/sharedfiles/filedetails/?id=2227639387
    Note: C# is good but LCD ar limited to 2000 chars so handlebars is mutch more compact syntax.
    C# is perfect for SaveGamescripts without any limitations and for ful access
     
    #205
  6. Slavens

    Slavens Lieutenant

    Joined:
    Jun 26, 2016
    Messages:
    10
    Likes Received:
    3
    Didn't work. Do I need to go out and get Newtonsoft? I don't see it anywhere in the
    [EGS]\Content\Mods\EmpyrionScripting folder

    Also, is the data structure visible or documented anywhere?

    Thanks for the assistance!

    Oh. I just ran the game and the config file you had me modify was changed back to default five-line file.
     
    #206
    Last edited: Nov 23, 2020
  7. Slavens

    Slavens Lieutenant

    Joined:
    Jun 26, 2016
    Messages:
    10
    Likes Received:
    3
    I ask about the data structure mainly because I'm curious if there's a parent object for Container, HarvestCntr, and AmmoCntr. I'm having trouble getting Shadowviper's scripts working. Specifically the scripts for universal Container Display and Ammo Counter.

    Universal Container Display only works for Container Controllers. It doesn't work for Harvest Controllers or Ammo Controllers unless you add the script two more times and change the line
    Code:
    {{~#devicesoftype @root.E.S 'Container'}}
    to
    Code:
    {{~#devicesoftype @root.E.S 'AmmoCntr'}}
    or
    Code:
    {{~#devicesoftype @root.E.S 'HarvestCntr'}}
    I'm hoping the script will work if I can change that line to the parent of those containers. I'm not familiar enough with Handlebars yet to figure out how to get one script to check all three container types.

    And Ammo Counter won't read from any containers at the moment, though I don't know if that's an issue with the script because of game updates or because I changed line 2 for use in CVs.
     
    #207
    Last edited: Nov 23, 2020
  8. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    991
    Likes Received:
    707
    #208
    jharyl and Homunk like this.
  9. |LG|Judge

    |LG|Judge Lieutenant

    Joined:
    Sep 9, 2015
    Messages:
    19
    Likes Received:
    1
    Hi, @ASTIC mit der neuen version stürtz bei mir aufm testserver die playfield immer ab, hast du na ne idee wieso ?
     
    #209
  10. STEEL

    STEEL Ensign

    Joined:
    Oct 22, 2016
    Messages:
    10
    Likes Received:
    3
    Hello Astic,

    I am trying to make the scripting work and I am having a difficult time.

    If possible, could you give me a simple explanation of the process.

    I downloaded the EmpyrionScripting.zip, extracted it into the /Mod .....I created 2 LCD screens and a storage container. I did everything you said but I am not getting anything to work in Creative for now.

    I would greatly appreciate just a simple Container/what is inside explanation so I can understand the process. Nothing complicated, just what is in one container and how to do that.

    Thank You so much!!!!
     
    #210
    pork likes this.
  11. me777

    me777 Commander

    Joined:
    Aug 18, 2020
    Messages:
    384
    Likes Received:
    131
    Maybe you have EAC on, then local mods are not loaded.
    a simple test if it works:
    make 2 lcd, one with Script:test and one with test as name; all you type in Script:test should appear in test. (normal text without the {{}})
     
    #211
    ASTIC likes this.
  12. pork

    pork Ensign

    Joined:
    Jan 21, 2021
    Messages:
    1
    Likes Received:
    0
    does the mod still work? ive used it befor and got it working but updated to the 16th december version and cannot get it to work ingame? i have EAC turned off and installed the files into
    F:\SteamLibrary\steamapps\common\Empyrion - Galactic Survival\Content\Mods\EmpyrionScripting
    iv even tried changing the .json file to the code ASTIC mentioned above and still nothing!
    what am i missing??

    i have also found an empyrion folder in C:\ so have also extracted the mod to the mod folder there! still nothing

    iv made it work now guys
     
    #212
    Last edited: Jan 21, 2021
  13. Ukemi

    Ukemi Ensign

    Joined:
    Feb 6, 2021
    Messages:
    3
    Likes Received:
    0
    Hi there,

    how can i make my fillup script work again in 1.4
    - all without ""

    {{#items E.S '"BOX-NAME"'}}
    {{#fill this @root.E.S 'Oxygen' 100}}
    Oxygen: {{SourceE.Name}}:{{Source}}->
    {{~DestinationE.Name}}:{{Destination}}
    {{format Count '{0,5}'}} : {{i18n Id 'Deutsch'}}
    {{/fill}}
     
    #213
  14. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    991
    Likes Received:
    707
    #214
  15. Ukemi

    Ukemi Ensign

    Joined:
    Feb 6, 2021
    Messages:
    3
    Likes Received:
    0
    dankeschön
     
    #215
  16. STEEL

    STEEL Ensign

    Joined:
    Oct 22, 2016
    Messages:
    10
    Likes Received:
    3
    Hello Astic, Just to be clear, this will not work on Official Servers? EAC running?
    I was trying to make it work in Creative Mode and it didn't work there either.
    Please confirm.
    Thank You so much!!!!
     
    #216
  17. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    991
    Likes Received:
    707
    EAC off for SP and creative and it works
     
    #217
  18. me777

    me777 Commander

    Joined:
    Aug 18, 2020
    Messages:
    384
    Likes Received:
    131
    If you want it on a server with EAC it must be installed on the server; client don't need it then; (and I don't think Official have mods installed)

    With EAC off and installed on the client it will run on the client. (even when it also is on the server, then it runs doubble resulting in problems)
     
    #218
  19. Khas

    Khas Ensign

    Joined:
    Oct 18, 2020
    Messages:
    7
    Likes Received:
    4
    Hi Astic, may i ask you something?
    In previous versions of your mod the "fill-tank" worked with every type of fuel/oxygen bottles.
    Now when the mod creates the configuration.json some itemsID are missing:
    Code:
      "StructureTank": {
        "Oxygen": [
          {
            "ItemId": 4186,
            "Amount": 35
          },
          {
            "ItemId": 4177,
            "Amount": 75
          },
          {
            "ItemId": 4176,
            "Amount": 250
          }
        ],
        "Fuel": [
          {
            "ItemId": 4159,
            "Amount": 10
          },
          {
            "ItemId": 4421,
            "Amount": 300
          },
          {
            "ItemId": 4335,
            "Amount": 150
          },
          {
            "ItemId": 4314,
            "Amount": 30
          }
        ],
        "Pentaxid": [
          {
            "ItemId": 4342,
            "Amount": 1
          }
        ]
      },
    Since i make use of this function in my scripts, my question is this:
    Is that an intended feature? or there's a chance that you may add them again?
    Sorry to bother you, it's just so i known if i need to adjust my blueprints or not.
    Thank you
     
    #219
  20. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    991
    Likes Received:
    707
    In the standard of the scripting mod it was always just that for oxygen
    Code:
    {
             "ItemId": 4176,
             "Amount": 250
    }
    registered. You can add the others yourself - just as you apparently did a long time ago.
     
    #220

Share This Page