PS: With the "test" command you can filter the output {{#items E.S 'Hauptlager'}} {{#test id in '2290,2396')}} {{format Count '{0,5}'}} : {{i18n Id 'Deutsch'}} {{/test}} {{/items}}
Can someone post their configs here? Even some examples? It would help those who are not so fluent in German, or as tech-savvy as others
I am working on it in the next days i think there will be an A12 version with the possibility to wrote the scripts not only in handlebars syntax but as an alternative also in C#
Looks good ASTIC. I've had a skim through the change log while I'm at work so haven't downloaded the new demo yet - is there anything you can do in the C# version that wasn't possible through the handlebars interface, and is the C# version going to be the primary version going forward (is new functionality going to be added only via C# or will it be handlebars and C# where possible?) I do have possible suggestions for things you could add in future versions after you so kindly added the lookup functionality, although none of these are essential: Maths round ceiling floor range (each loop of numbers between min & max, with step) Variables Append to current variable instead of nesting concat Add/subtract from variable instead of nesting calc Logic not-in Items expose volume, mass, stacksize from config Devices devicesoftype for weapons/turrets allow comma separated types like when finding devices by name, for example 'Container,AmmoCntr,HarvestCntr' General Current shield level for #use (as opposed to the current amount of 'fuel' in the pentaxid tank) I did some rough pseudocode examples of how these could be used, but you of course probably have a much better idea of how you'd do them! Code: Maths //{{round data}} {{set 'start' '3.2'}} {{round @root.data.start}}{{.}}{{/round}} {{@root.data.start}} //3 //{{floor data}} {{set 'start' '3.2'}} {{floor @root.data.start}}{{.}}{{/floor}} {{@root.data.start}} //3 //{{ceil data}} {{set 'start' '3.2'}} {{ceil @root.data.start}}{{.}}{{/ceil}} {{@root.data.start}} //4 Variables //{{append key data [separator]}} {{set 'SomeNumbers' '4,8,15,16,23'}} {{append 'SomeNumbers' '42' ','}} {{@root.data.SomeNumers}} //4,8,15,16,23,42 //{{set+ key data}} {{set 'i' '5'}} {{set+ 'i' 3}} {{@root.Data.i}} //8 //{{set- key data}} {{set 'i' '5'}} {{set- 'i' 1}} {{@root.Data.i}} //4 LOGIC {{set 'Ids' '2295,2265'}} {{set 'ToCheck' '3000'}} {{#test @root.Data.ToCheck nin @root.Data.Ids}} //true {{/test}} ITEMS {{#items @root.E.S '2295'}} {{#each .}} Name: {{Name}} //Steel Plate Count: {{Count}} //999 Volume of 1 of this item: {{ItemVolume}} //0.2 Volume of all of this item: {{StackVolume}} //199.8 Allowed per stack: {{MaxStackSize}} //999 {{/each}} {{/items}} General {{#use E.S.HullShield}} {{Content}} //45 {{Capacity}} //100 {{/use}} I've generally found a way to work around most of these at least for what I needed, but thought i'd suggest them in case you are looking for ideas after your C# implementation of what I've been trying to achieve Thanks again for such a fun mod Edit: Haven't tried A12 yet, but thinking ahead another suggestion would be if we could get the values for current power output / consumption, so a script can show a warning when over 100% generator capacity and/or set non essential blocks to inactive
Question: Using a C# script, how can I pull a list of all entities (HV, SV, and CV, preferably not BA, though that would still be fine) within a certain distance or on the same playfield?
I have not tried it, but I do not suspect that it worked because the ModAPI.dll has changed with the A12 With CsRoot.EntitiesByName(string) you can get the Entities (that are active - no proxy -) within a MaxRange (in an admin structure all active on the playfield)
EmpyrionScripting stops working upon changing playfields. Is there a console command or any way to 'reboot' the script?
There is a 30s delay after a playfield change for the restart. Im working on multiple auto restart procedures if something goes wrong -> comming soon
No worries then, just wondered if you were aware of the problem. It doesn't restart even after spending hours in the same playfield with Alpha 12 experimental. Thanks for looking into it.
On the latest Alpha all the spaces on my script screens have started showing squares . As its happening on all 4 scripts I assume its the script mod itself . I have Ship Stats,Active Antenna, Active Radar and Ship Status . Script mod version 5.5.20 .
Also the console gets tons of red messages one after the other non stop. That is when loading a vessel with scripted LCD i.e. the LCD demo CV.
Version 5.5.3 https://github.com/GitHub-TC/EmpyrionScripting/releases/tag/5.5.3 - UnicodeChar via config (Unicode spaces are not longer supported by Empyrion and display them as squares) => default is the normal space :-(( http://jkorpela.fi/chars/spaces.html - Fix player access -> Empyrion throws exceptions :-( Demo CV updated
Awesome stuff @ASTIC works great . I fear it has also done in your ActiveAntenna script . I had started a new game for the latest Alpha andforgot to load the script so didnt notice it sorry .
stupid question but in co-op will this work? if so how? Does the pc running the server have to install this only or does everyone playing have to have it installed?
Great work ASTIC I have a question: I want to read in the text of a lcd device in C# mode like it's possible in handlebar. Do I miss something or does the "Text" interface in the C# device class not exist up to now? I could not find any hint on GitHub and I tried different spellings with no success.
Code: var b = CsRoot.GetDevices<ILcd>( CsRoot.Devices(E.S, "Dummy")) .FirstOrDefault(); if(b.GetText().StartsWith("W")) Console.WriteLine( $"<b>Wohoooo {b.GetText()}</b>"); else Console.Write(b.GetText()); But you need to allow: [EGS]\Saves\Games\[SaveGame]\Mods\EmpyrionScripting\CsCompilerConfiguration.json Code: "SymbolPermissions": { "Player": [ "Eleon.Modding.ILcd.*", ], i will add this in the next version to the default.