[MOD EXT] Empyrion Scripting - Scripts

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

  1. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,152
    Likes Received:
    751
    Which scenario are you using?
     
    #1061
  2. loupineto

    loupineto Ensign

    Joined:
    Dec 4, 2025
    Messages:
    7
    Likes Received:
    0
    I'm playing on an RE2 server. However, the `{{resourcesforid ...}}` function—which is aptly named—only returns raw resources (ores) and not components. Unfortunately, it doesn't return the quantity of resources required for the components or devices. It's possible the ECF files aren't up to date.
    In the following example, {{#resourcesforid '1639'}} is retrieved:

    Item : 1639 - Light Laser Turrets (CV)
    - 8456 : Titanium Ingot: 68
    - 8269 : Iron Ingot: 42,2
    - 8418 : Silicon Ingot: 156,1
    - 8420 : Copper Ingot: 245
    - 8427 : Carbon Substrate: 144
    - 8417 : Cobalt Ingot: 124,8
    - 8419 : Neodymium Ingot: 176
    - 8422 : Erestrum Ingot: 96
    - 8423 : Zascosium Ingot: 96
    - 8459 : Aluminium Powder: 48

    Can you tell me what the number after the decimal point "Cobalt Ingot: 124.8" corresponds to?
     
    #1062
  3. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,152
    Likes Received:
    751
    • These are all the resources required for the turret and its components.
    • For example, if the turret requires 8 parts of X, but 10 parts of X are produced per ingot, then the turret requires 0.8 ingots.
     
    #1063
  4. loupineto

    loupineto Ensign

    Joined:
    Dec 4, 2025
    Messages:
    7
    Likes Received:
    0
    (sorry trad google)
    However, without wanting to be a pain, I created a script that transfers resources for a CV laser turret, but when I want to build it, it lacks resources for 8 power coils and 12 advanced capacitors. It's the same script as before, with the added feature of the transfer working correctly.
    This works correctly for simpler devices like 'prometium hydro cell'.

    {{~set 'I' '1639'}}<size=50%>Item : {{@root.Data.I}} - {{i18n @root.Data.I}}
    {{#resourcesforid @root.Data.I}}
    {{#each .}}- {{@key}} : {{i18n @key}} : {{.}}{{~set 'Qte' (calc . '+' 1)}}
    {{#itemlist @root.E.S.Items @key}}{{#move . @root.E.S 'Prepa' (int @root.Data.Qte)}}{{/move}}{{/itemlist}}
    {{/each}}{{/resourcesforid}}</size>

    <size=50%>Item : 1639 - Light Laser Turrets (CV)
    - 8456 : Titanium Ingot: 68
    Transfert : 68 / 69 Transfert : 1 / 69
    - 8269 : Iron Ingot: 42,2
    Transfert : 43 / 43,2
    - 8418 : Silicon Ingot: 156,1
    Transfert : 156 / 157,1 Transfert : 1 / 157,1
    - 8420 : Copper Ingot: 245
    Transfert : 245 / 246 Transfert : 1 / 246
    - 8427 : Carbon Substrate: 144
    Transfert : 145 / 145
    - 8417 : Cobalt Ingot: 124,8
    Transfert : 124 / 125,8 Transfert : 1 / 125,8
    - 8419 : Neodymium Ingot: 176
    Transfert : 176 / 177 Transfert : 1 / 177
    - 8422 : Erestrum Ingot: 96
    Transfert : 96 / 97 Transfert : 1 / 97
    - 8423 : Zascosium Ingot: 96
    Transfert : 97 / 97
    - 8459 : Aluminium Powder: 48
    Transfert : 48 / 49 Transfert : 1 / 49
    </size>


    <size=50%>Item : 8517 - Promethium Hydrocell
    - 8398 : Promethium Ore: 2,5
    Transfert : 3 / 3,5
    - 8540 : Water Container: 5
    Transfert : 6 / 6
    - 8269 : Iron Ingot: 1
    Transfert : 2 / 2
    </size>
     
    #1064
    Last edited: Jun 30, 2026
  5. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,152
    Likes Received:
    751
    Presumably, the other effect comes into play here—for example, 2 ingots of X produce 6 items of Y, but the turret only needs 3 of type Y, so just 1 ingot. However, if you build Y, you need 2 units of X, and if X is already being used for other things, that won't be enough anymore.
     
    #1065
  6. loupineto

    loupineto Ensign

    Joined:
    Dec 4, 2025
    Messages:
    7
    Likes Received:
    0
    - Is it possible to recover the signal from a radar? (without C# routine) In idea, I would like to save energy on my ship and therefore deactivate the weapons and activate them automatically when the radar detects an enemy.
    - Is it possible to change the state of a Control Panel/Signals?
     
    #1066
  7. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,152
    Likes Received:
    751
    It is possible, but the server operator would have to change it in the save game script themselves. Since this would generally be considered a cheat, I can't make that change in the script across the board.
     
    #1067
  8. loupineto

    loupineto Ensign

    Joined:
    Dec 4, 2025
    Messages:
    7
    Likes Received:
    0
    Thank you very much for your answers, have a nice Sunday.
     
    #1068

Share This Page