[MOD EXT] Empyrion Scripting - Scripts

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

  1. The Pfaffinator

    The Pfaffinator Ensign

    Joined:
    Oct 18, 2024
    Messages:
    3
    Likes Received:
    0
    Thank you so much!
    Yeah, I get it makes things more troublesome by making the game available on different platforms, but the benefit I guess is that now more people have an opportunity to enjoy such an amazing game.
     
    #941
  2. Pantera

    Pantera Administrator Staff Member

    • Developer
    • Moderator
    Joined:
    Aug 15, 2016
    Messages:
    3,249
    Likes Received:
    5,708
    #942
  3. BloodAngel099

    BloodAngel099 Lieutenant

    Joined:
    Jan 24, 2023
    Messages:
    34
    Likes Received:
    2
    @ASTIC, I am trying to incorporate orderbylist into the following script. Would I be able to use orderbylist somehow after the itemlist section of code, but before the split @root.Data.D at the end? If I am understanding the code correctly this would be the best place to handle reorganizing the data.

    The goal is the have this script show a static list of ingots and how many exist aboard the ship. If none exist instead of removing the line it would show 0.

    Code:
    {{~set 'T' '8000'}}
    {{~#split '#15FC05,#8FF904,#F4DC04,#F99C04,#FC6305,#CE1818' ','}}{{set 'C' .}}{{/split}}
    {{~set 'IDs' '4329,4173,4319,4321-4327,4331,4333,4339,4346,4360,4363,4366,4376,4444,7301,7343,'}}
    {{~#split @root.ScriptId ':'}}
    {{~#devices @root.E.S .1}}
    {{~#split (substring (i18n .0/Id 'English') 4) ' '}}{{/split}}
    {{~/devices}}
    {{~/split}}
    <color=#FFF><align=center><size=200%>Ingots</size></align>
    <align=center>{{bar 1 0 1 45 '═'}}</align>
    
    {{#sortedeach @root.E.S.Items 'Count' false}}{{~#test Id in @root.Data.IDs}}{{set 'X' (concat @root.Data.X Id ',')}}{{setblock 'D' ~}}
    {{@root.Data.D}}{{i18n Id}}:{{format Count '{0,6:N0}'}}:
    {{~#test Count geq @root.Data.T}}{{@root.Data.C.0}}{{else}}
    {{~#test Count ge (calc @root.Data.T '*' '0.75')}}{{@root.Data.C.1}}{{else}}
    {{~#test Count ge (calc @root.Data.T '*' '0.50')}}{{@root.Data.C.2}}{{else}}
    {{~#test Count ge (calc @root.Data.T '*' '0.25')}}{{@root.Data.C.3}}{{else}}{{@root.Data.C.4}}{{/test}}{{/test}}{{/test}}{{/test}};{{~/setblock}}{{~/test}}{{~/sortedeach}}
    
    {{~#itemlist @root.E.S.Items @root.Data.IDs}}{{#test Id in @root.Data.X}}{{else}}{{set 'D' (concat @root.Data.D (i18n Id) ':' (format 0 '{0,6:N0}') ':' @root.Data.C.5 ';')}}{{/test}}{{/itemlist}}
    
    {{~#split @root.Data.D ';' true}}
    {{#each .}}{{#split . ':'}}
    {{fontsize 3}}{{~concat '<color=' ./.2 '><indent=8%>◉ ' ./.0 '</indent> <indent=74%>' ./.1 '</indent></color>' ~}}{{/split}}{{~/each}}{{~/split}}
     
    #943
  4. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,094
    Likes Received:
    735
    'itemlist' already returns the items in the order of the IDs and possibly with 0. or do you want to achieve something else?
     
    #944
  5. BloodAngel099

    BloodAngel099 Lieutenant

    Joined:
    Jan 24, 2023
    Messages:
    34
    Likes Received:
    2
    I want to achieve something else, but similar.

    From what I can tell the "sortedeach" section of the code puts together an array of the items I am looking for in IDs that have a quantity above 0. Itemlist then is used to add the items from the IDs list that have a value of 0 to the end of the array. Because of this items that have a value are always listed 1st, then items that have no value are listed at the end.

    I was hoping to use orderbylist to take the entire array after its been built and rearrange it based on the order given in IDs, then print to LCD. This way for example Stone Dust (ID:4329) would always be at the top of my list regardless of what its value is.
     
    #945
    Last edited: Nov 22, 2024
  6. senopspicy

    senopspicy Ensign

    Joined:
    Dec 1, 2024
    Messages:
    2
    Likes Received:
    0
    I love this mod and script for activeradar, but when I try to play with it on coop it seems to freeze when my friend loads onto my server?
    No idea why, quitting and reloading in seems to kick it back over, but otherwise it just sits there after every jump well beyond the 30seconds wait time and doesn't update?
     
    #946
  7. senopspicy

    senopspicy Ensign

    Joined:
    Dec 1, 2024
    Messages:
    2
    Likes Received:
    0
    I believe this is a coop server API issue and if anyone could please tell me how to run an elevated script with selectType from an LCD I would really appreciate it!
     
    #947
  8. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,094
    Likes Received:
    735
    @senopspicy Coop and SinglePlayer are unfortunately riddled with API limits/errors - it's better to set up a dedicated server and run it in parallel on your computer
     
    #948
  9. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,094
    Likes Received:
    735
    Savegame scripts that come from files are automatically elevated. You can also enter your faction number in the configuration file in “ElevatedGroups”, then all your in-game scripts are also elevated
     
    #949
  10. johnny1972

    johnny1972 Ensign

    Joined:
    Jul 11, 2019
    Messages:
    9
    Likes Received:
    0
    I need some help. I just updated to 13.4.0 and the scripts are not working and trying figure out why and thank you.
     
    #950
  11. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,094
    Likes Received:
    735
    #951
  12. johnny1972

    johnny1972 Ensign

    Joined:
    Jul 11, 2019
    Messages:
    9
    Likes Received:
    0
    Hi Astic that last download work. Now the game wants money to destruct poi's and I went into the only folder to change the price like you told others and I did. I'm using notepad++ and I don't know the program well. I use it because its easy for me to see because I need eye surgey. So any other help would be great plos is there any way to increse the teleporters range to go alot farer in SP. Thank You and a great mod.
     
    #952
  13. johnny1972

    johnny1972 Ensign

    Joined:
    Jul 11, 2019
    Messages:
    9
    Likes Received:
    0
    Is there a way where I can remove the cost of the destruct of everything is free again. I play SP and I don't want to go into every game save just not have to
    pay for it. I play RE2 and have to do that with every update changes things.
     
    #953
  14. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,094
    Likes Received:
    735
    Unfortunately, I do not currently have a way to store a configuration template. Therefore you have to do this for each new savegame in the respective folder.
    In the sections DeconstructSalary and RecycleSalary
    you can set the amount to 0, then it won't cost anything anymore
     
    #954
  15. johnny1972

    johnny1972 Ensign

    Joined:
    Jul 11, 2019
    Messages:
    9
    Likes Received:
    0
    How was the destruct always been free. Then after update 11.0.0 it started beening charge for the destruct.
     
    #955
  16. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,094
    Likes Received:
    735
    It offers the opportunity to “spend” money in the game
     
    #956

Share This Page