[MOD EXT] Empyrion Scripting - Scripts

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

  1. SonGoku10c

    SonGoku10c Ensign

    Joined:
    Aug 6, 2026
    Messages:
    3
    Likes Received:
    0
    No error message on the LCD, but still nothing moves. Script Tracking shows this:

    Code:
    HandlebarsDotNet.HandlebarsCompilerException: Expected HelperExpression, got HandlebarsDotNet.Compiler.Lexer.WordExpressionToken
      at HandlebarsDotNet.Compiler.RawHelperAccumulator+<ConvertTokens>d__2.MoveNext () [0x000da] in <2c7ef029d5b14b6f8ae0e7f0e1ec3326>:0
      at System.Collections.Generic.List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable) [0x00059] in <1071a2cb0cb3433aae80a793c277a048>:0
      at System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x00062] in <1071a2cb0cb3433aae80a793c277a048>:0
      at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00018] in <ea489521390f48908a7ce45cb17a6848>:0
      at HandlebarsDotNet.Compiler.RawHelperAccumulator.Accumulate (System.Collections.Generic.IEnumerable`1[T] sequence) [0x0000b] in <2c7ef029d5b14b6f8ae0e7f0e1ec3326>:0
      at HandlebarsDotNet.Compiler.ExpressionBuilder.ConvertTokensToExpressions (System.Collections.Generic.IEnumerable`1[T] tokens) [0x0000e] in <2c7ef029d5b14b6f8ae0e7f0e1ec3326>:0
      at HandlebarsDotNet.Compiler.HandlebarsCompiler.Compile (System.IO.TextReader source) [0x00012] in <2c7ef029d5b14b6f8ae0e7f0e1ec3326>:0
      at HandlebarsDotNet.Handlebars+HandlebarsEnvironment.Compile (System.IO.TextReader template) [0x00000] in <2c7ef029d5b14b6f8ae0e7f0e1ec3326>:0
      at HandlebarsDotNet.Handlebars+HandlebarsEnvironment.Compile (System.String template) [0x0000c] in <2c7ef029d5b14b6f8ae0e7f0e1ec3326>:0
      at HandlebarsDotNet.Handlebars.Compile (System.String template) [0x00005] in <2c7ef029d5b14b6f8ae0e7f0e1ec3326>:0
      at EmpyrionScripting.EmpyrionScripting.ExecuteHandlebarScript[T] (EmpyrionScripting.PlayfieldScriptData playfieldData, T data, System.String script) [0x00017] in Z:\Projekte\C#\Empyrion\EmpyrionScripting\EmpyrionScripting\EmpyrionScripting.cs:1021
      at EmpyrionScripting.EmpyrionScripting.ProcessScript[T] (EmpyrionScripting.PlayfieldScriptData playfieldData, T data) [0x0005e] in Z:\Projekte\C#\Empyrion\EmpyrionScripting\EmpyrionScripting\EmpyrionScripting.cs:893 
     
    #1081
  2. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,159
    Likes Received:
    753
    it have to be @root.E.S becaus at this scope "this" or "." is the item not the root datastructure
    Code:
    {{#items E.S 'Sammelcontainer'}}
    {{#test Id in @root.Ids.Ore}}
    {{#move this @root.E.S 'Erzlager'}}{{/move}}
    {{/test}}
    {{/items}}
    
    Noch unsortiert im Sammelcontainer:
    {{#items E.S 'Sammelcontainer'}}
    {{Count}}x {{i18n Key}}
    {{/items}}
     
    #1082
  3. SonGoku10c

    SonGoku10c Ensign

    Joined:
    Aug 6, 2026
    Messages:
    3
    Likes Received:
    0
    That works. thx.
    What I found now. Some items don't get sorted, because they are not in the IDs section of the Configuration.json (like PlatinOre, Graphite, Bone,...). Is there a way, that the Configuration.json will catch the IDs from the ItemConfig.ecf? But you can turn it off in the Configuration.json, if you want to change something.
    Something like:
    Update IDs from ItemConfig.ecf: true

    Edit: OK. Will not work 100%, because some items in there don't have a "Ref: OreTemplate" , "Ref: ComponentsTemplate", ...
     
    #1083
    Last edited: Aug 7, 2026
  4. SCP-953

    SCP-953 Ensign

    Joined:
    Apr 7, 2023
    Messages:
    3
    Likes Received:
    0
    [​IMG]
    so ive been screwing around trying to make a script i got one semi-functional but ive hit a wall, i made a search engine for the registry to search for POI's you have discovered but i cant seem to get it to display distance of the system from where the ship with the script, sorry if its spaghetti code


    {{#devices E.S 'LookupName'}}

    {{#gettext .0}}

    {{#db 'DiscoveredPOIs' 500 'Entities.name asc' (concat "Entities.name LIKE '%" . "%'")}}

    {{#each .}}

    {{Entities.name}}
    System : {{SolarSystems.name}}
    Sector : {{Playfields.name}}

    --------------------

    {{/each}}

    {{/db}}

    {{/gettext}}

    {{/devices}}
     
    #1084
    Last edited: Aug 9, 2026

Share This Page