[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,020
    Likes Received:
    715
    Found another divide by Amount :-(
    https://github.com/GitHub-TC/EmpyrionScripting/releases/tag/13.0.6
    should work now.
    Sorry for the inconvenience
     
    #841
  2. ctthespian

    ctthespian Ensign

    Joined:
    Jul 13, 2022
    Messages:
    7
    Likes Received:
    0
    Any answer to why the configuration.json is being created in the save folders with the default amounts instead of the values set in the config file in the mods\empyrionscripting folder? Should the value be "ItemId": 4344 or "ItemName": "MoneyCard" for the salary lines in the \Mod\EmpyrionScripting\configuration.json? Seems regardless there is a configuration.json that is created with the Salary lines with the default cost values in the saves folder ie Empyrion - Galactic Survival\Saves\Games\NewGame_4\Mod
     
    #842
  3. Mycroft_Groks

    Mycroft_Groks Lieutenant

    Joined:
    Aug 17, 2018
    Messages:
    47
    Likes Received:
    7
    Astic,
    Is there anything in the API to allow scripts to post messages in the ingame chat? Maybe elevated so it has to be from an admin core structure?
     
    #843
  4. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,020
    Likes Received:
    715
    The configuration.json in the content/mod directory is overwritten with every mod update and is also not in the (normal) backup of many servers.
    Hence the mod configuration in the savegame. This does not usually change that often on a server.
    But I'll see if I can find a directory for "templates"
     
    #844
  5. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,020
    Likes Received:
    715
    You can currently open dialogs, but I'll see if I can also include a chat/info output.
    In any case, this would be limited to the global (admin) channels and only the faction channel would be accessible for players
     
    #845
  6. Mycroft_Groks

    Mycroft_Groks Lieutenant

    Joined:
    Aug 17, 2018
    Messages:
    47
    Likes Received:
    7
    Ok. that's what I'm looking for. Admin posting in global is exactly what I'm looking to do
     
    #846
  7. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,020
    Likes Received:
    715
    First steps...

    [​IMG]

    [​IMG]
    [​IMG]
     
    #847
  8. Mycroft_Groks

    Mycroft_Groks Lieutenant

    Joined:
    Aug 17, 2018
    Messages:
    47
    Likes Received:
    7
    Very appreciative!! This is great!
     
    #848
  9. m1ckeyten

    m1ckeyten Ensign

    Joined:
    Jul 9, 2019
    Messages:
    19
    Likes Received:
    5
    Hey, any way to disable the mod while the server is on
     
    #849
  10. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,020
    Likes Received:
    715
    No
    What is the "use case" for this? Why would you want to deactivate the mod, the DLL is loaded into the process and blocked by it.
    Replacing the mod via ModLoader, as with my other mods, is unfortunately not possible with the new ModAPI
     
    #850
  11. m1ckeyten

    m1ckeyten Ensign

    Joined:
    Jul 9, 2019
    Messages:
    19
    Likes Received:
    5
    I just wanted the idname and iconid json files created by the mod for the EWA, but i dont want the mod to be active

    edit :
    NameIdMapping.json
    IdIconMapping.json
     
    #851
  12. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,020
    Likes Received:
    715
    Switching off the mod while the server is running is not implemented or planned
     
    #852
    m1ckeyten likes this.
  13. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,020
    Likes Received:
    715
    Hint: ...\Saves\Games\[Savegamename]\Mods\EmpyrionScripting\Configuration.json
    Code:
    "SaveGameScriptsIntervallMS": 10000,
    "ScriptsSyncExecution": 2,
    "ScriptsParallelExecution": 4,
    ...
    "ProcessMaxBlocksPerCycle": 200,
    
    Are set VERY conservatively by default so as not to put the server (and the game) under load.
    Double the values (SaveGameScriptsIntervallMS must lower) and the scripts will run more "smoothly", but there may be micro-jerks in the game.
     
    #853
  14. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,020
    Likes Received:
    715
    EmyprionScripting 13.1.0: https://github.com/GitHub-TC/EmpyrionScripting/releases/tag/13.1.0
    Add chat commands (EmpyrionScripting-Demo-CV is up to date and show the usage)

    Chat
    • {{chatbysignal SignalName sender}}message{{/chatbysignal}}
      • Sends the chat message to the player who triggers the signal. In the block, the player is available with Id and name
    • {{char sender text}}
      • Sends a chat message to the owner of the structure (faction or player) with the text 'text' and the sender 'sender'
    Chat (Admin only)
    • {{chatglobal sender text}}
      • Sends a global chat message with the text 'text' and the sender 'sender'
    • {{chatserver sender text}}
      • Sends a server chat message with the text 'text' and the sender 'sender'
    • {chatplayer playerId sender text}}
      • Sends a private chat message to the player 'playerId' with the text 'text' and the sender 'sender'
    • {{chatfaction factionId sender text}}
      • Sends a faction chat message to the faction 'facrionId' with the text 'text' and the sender 'sender'

     
    #854
    Last edited: Jun 30, 2024 at 1:25 PM
  15. ctthespian

    ctthespian Ensign

    Joined:
    Jul 13, 2022
    Messages:
    7
    Likes Received:
    0
    I'm not sure if I'm getting the problem across. I'm assuming if you change the configuration.json in the games mod folder, when a savegame is created, and I've tested a brand new local game, the configuration.json file in the save game folder has the values for the cost of the salaries from the mod folder if edited. If it's not expected that you can change the costs in the content/mod folder and instead have to change it afterwards under the saves folder that's fine. Though I would think the logic would be the mod configuration.json sets what gets created in the savegame folder for a new game.

    Basically (Edit mod/configuration.json salary 0) > (Start new local game) > (Salaries are in place) > (configuration.json created in saves folder has default salaries) > (need to edit configuration.json under the saves folder to drop salaries to 0 or modify from default)
     
    #855
  16. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,020
    Likes Received:
    715
    The reason for not taking this from the content/mods directory is that many settings are scenario-specific.
    This does not change frequently on a server, but it does in the SP.
    One possibility would be to store the configuration.json in the scenario directory or with the name of the scenario directory in a completely different location, e.g. Save\Games
    I'll think about it. Unfortunately, the API in the SP doesn't work really well, so the MP with a dedicated server is preferable anyway,
     
    #856

Share This Page