[mod] Empyrion Scripting Mod

Discussion in 'Empyrion API' started by ASTIC, May 25, 2019.

Tags:
  1. awgsknite

    awgsknite Ensign

    Joined:
    Oct 11, 2024
    Messages:
    3
    Likes Received:
    0
    I play on a modded server and would present the script to the admin there so how would I go about writing this savegamescript ? since you say it is forbidden or cheating to do such a thing could you send me a PM on how to make the script then ?
     
    #441
  2. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,146
    Likes Received:
    750
    In principle, it is a “normal” script in Handlebars (HBS) or C# which is stored as a file in the Savegame Scripts folder. As an example, you can take a look at Floorplan here https://github.com/GitHub-TC/EmpyrionScripting-Collection/tree/master/Scripts
     
    #442
  3. GlesCraft

    GlesCraft Ensign

    Joined:
    Sep 8, 2022
    Messages:
    1
    Likes Received:
    0
    Подскажите есть скрип на автодобычу руды чтобы не нажимать каждый раз клавишу вперёд или назад чтобы корабль парировал и автоматически добывал на маленькой скорости? У нас на Серваке скрипты работают сервер модовый
     
    #443
  4. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,146
    Likes Received:
    750
    Unfortunately no, the API for controlling the ships is too imprecise and cannot be controlled well
     
    #444
  5. Clanfear

    Clanfear Ensign

    Joined:
    Jul 6, 2018
    Messages:
    3
    Likes Received:
    0
    is there a place where i can read about using "format" in simple words and with examples, you know - all those {{~format . '{0,8:p2}'}} and {{~format Content '{0,7:0.0}'}} thingy
     
    #445
  6. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,146
    Likes Received:
    750
    #446
    Clanfear likes this.
  7. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,146
    Likes Received:
    750
    This block is (now) part of a "multiblock" and theres is no single "EMP Cruise Missile Launcher" block in the current RE2-24 maybe you have here an old block

    [​IMG]
     
    #447
  8. Franky 2

    Franky 2 Ensign

    Joined:
    Jan 29, 2025
    Messages:
    1
    Likes Received:
    0
    Anyone has done a Shop script with containers to Sell items from palyer to player?
     
    #448
  9. gregoryross85

    gregoryross85 Ensign

    Joined:
    Aug 2, 2017
    Messages:
    2
    Likes Received:
    0
    @ASTIC can you explain how we change salaries for deconstruct and Recycle. The config only seems to include salaries for Garden we have tried adding to the config.json and cannot get it to take. Any help would be appreciated thank you
     
    #449
  10. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,146
    Likes Received:
    750
    [​IMG]
     
    #450
    Monroe likes this.
  11. kkin形影

    kkin形影 Ensign

    Joined:
    Oct 17, 2022
    Messages:
    25
    Likes Received:
    0
    Hello, can it be set up so that when a building is dismantled, only the player who created the building has the authority to demolish it?
     
    #451
  12. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,146
    Likes Received:
    750
    Unfortunately, such an option is not built in
     
    #452
  13. kkin形影

    kkin形影 Ensign

    Joined:
    Oct 17, 2022
    Messages:
    25
    Likes Received:
    0
    Is there any way to achieve this?
     
    #453
  14. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,146
    Likes Received:
    750
    Unfortunately not at the moment
     
    #454
  15. Toberus

    Toberus Ensign

    Joined:
    Oct 14, 2025
    Messages:
    4
    Likes Received:
    0
    Hello,
    I am new to scripting and tried reaching out for help on the server that I am playing on and not getting an help at all. I would greatly appreciate the help. I have a script I will post below that i am using. I am currently using the script to buy items from players so they have place to sell their items for credits. I would like to add to the script to also show the available amount. I would also like to add the ability for example a player insert 50,000 iron ore they will get 100,000 galactic credits in return. But would like to set it up if they put in 100,000 ore in though i set it up the sell for 50,000 ore they would be able to sell the 100,000 ore and get 200,000 credits. To be able to allow them to put in as much as the box can hold and the transtation to go through if that make sense. I aplogize not sure how to word it correctly in script terms. I got the script off steam workshop of a ship I really would like it to be simple names but i can deal with what is their. Thank you for the help and your time.

    {{set 'cost' 50}}
    {{set 'volume' 50000}}
    <align=center><i>Put in 50 Gold Ingots For 50000 Galactic Credits</I>
    {{items E.S 'RF-04-BuyBox-2'}}
    {{set 'itemID' 4346}}
    {{/items}}
    {{#items E.S 'RF-05-BuyStuff-2'}}
    <smallcaps>{{format Count '{0,5}'}} {{Name}}</smallcaps>
    {{#test Id 'eq' @root.Data.itemID}}
    {{#test Count 'eq' @root.Data.cost}}
    {{set 'Payed' true}}
    <color=green>GOODS VERIFIED</color>
    {{/test}}
    {{/test}}
    {{/items}}
    {{#items E.S 'RF-04-BuyBox-2'}}
    {{#test Id 'eq' 4344}}
    {{#test Count 'le' @root.Data.volume}}
    <color=red>FUNDS INSUFFICIENT
    {{set 'emptybox' true}}
    {{/test}}
    {{/test}}
    {{else}}
    {{set 'emptybox' true}}
    <color=white><size=3>FUNDS OUT
    PLEASE TRY AGAIN LATER.</color></size>
    {{/items}}
    {{#items E.S 'RF-05-BuyStuff-2'}}
    {{#test Id 'eq' 4344}}

    <color=green><i>PLEASE REMOVE YOUR CREDITS</i>
    {{set 'emptybox' true}}
    {{/test}}
    {{/items}}
    {{#if @root.Data.emptybox}}<color=red><size=15>
    ⚠</size>
    {{else}}
    {{#if @root.Data.Payed}}
    {{#items E.S 'RF-04-BuyBox-2,RF-05-BuyStuff-2'}}
    {{~set 'RFBY1' ''}}
    {{~set 'Amount' ''}}
    <color=red><size=8>⚙ </size><size=2>TRANSFER IN PROGRESS</size><size=8> ⚙</size></color>
    {{#test Id in @root.Data.itemID}}
    {{~set 'RFBY1' 'CargoIn'}}
    {{/test}}
    {{#test Id in 4344}}
    {{~set 'RFBY1' 'RF-05-BuyStuff-2'}}
    {{~set 'Amount' @root.Data.volume}}
    {{/test}}
    {{#ok @root.Data.RFBY1}}
    {{#move ../. @root.E.S @root.Data.RFBY1 @root.Data.Amount}}
    {{Source}} -> {{Destination}}
    {{/move}}
    {{/ok}}
    {{/items}}
    {{else}}
    {{#items E.S 'RF-04-BuyBox-2'}}
    <color=white><align=center><color=#00CEEB><size=3>CURRENLY PAYING</size>

    <smallcaps><i>{{@root.Data.volume}} CREDITS</i>

    <size=3>COST - {{@root.Data.cost}} ITEMS


    Deposit exactly {{@root.Data.cost}} ITEMS
    Exit container and wait for transfer.
    Do not open until transfer complete

    <color=red>No refunds
    Item ID {{Id}}</size></color>
    {{/items}}
    {{/if}}
    {{/if}}
     
    #455
  16. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,146
    Likes Received:
    750
    #456
    Tyrion likes this.
  17. Don2k7

    Don2k7 Captain

    Joined:
    Apr 27, 2021
    Messages:
    469
    Likes Received:
    760
    with the 1.17 update some of the scripts appear to have stopped working, im guessing due to the id thing in the patch notes. does that mean the scripting mod needs an update for 1.17 or is it just changing the ids in the json files?
     
    #457
  18. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,146
    Likes Received:
    750
    The lists in the current version use names, so they have no problem with the changed IDs.

    However, some scripts are hardcoded with specific numbers that may need to be adjusted.

    https://github.com/GitHub-TC/EmpyrionScripting/releases/tag/13.4.2
     
    #458
    Don2k7 likes this.
  19. Don2k7

    Don2k7 Captain

    Joined:
    Apr 27, 2021
    Messages:
    469
    Likes Received:
    760
    so the new linked version should cure the issue fingers crossed?
    its mainly the refuel docked sv/hv that has stopped working from what i can that most the players use on the server i run
    the reload docked sv/hv we could never get to work even before the update
    its a custom RE1 server fyi and not vanilla
    and thank you for the fast response
     
    #459
  20. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,146
    Likes Received:
    750
    First, the configuration file in the savegame should contain a section for scripting (if not, simply delete the file; it will then be recreated).

    Code:
      "StructureTank": {
        "Oxygen": [
          {
            "ItemName": "OxygenBottleLarge",
            "Amount": 250,
            "EcfAmountTag": "O2Value"
          }
        ],
        "Fuel": [
          {
            "ItemName": "FusionCell",
            "Amount": 300,
            "EcfAmountTag": "FuelValue"
          },
          {
            "ItemName": "EnergyCellLarge",
            "Amount": 150,
            "EcfAmountTag": "FuelValue"
          },
          {
            "ItemName": "EnergyCell",
            "Amount": 30,
            "EcfAmountTag": "FuelValue"
          }
        ],
        "Pentaxid": [
          {
            "ItemName": "PentaxidCrystal",
            "Amount": 1
          }
        ]
    
    Second, many scripts contain hard-coded item numbers that change from savegame to savegame and therefore need to be adjusted repeatedly. So let’s take a closer look at the refuel scripts here.
     
    #460

Share This Page