ASTIC, sorry aber ich habe eine Frgae Ich will einen Teleport auf ein anderes playfield machen. Der Teleport Befehl nimmt ja ein anderes playfield an, aber wenn das nicht geladen ist funktioniert es wohl nicht. Kann ich aus einem savegamescript ein playfield starten? Ich denke das braucht die legacy api, aber ich habe leider nicht rausgefunden wie ich auf die zugreife. Vielen Dank.
Is there a way of figuring out why scripts randomly stop working after a while ? (a relog fixes this often)
Looking ahead at the Keybinds for SIGNALS and the CUSTOM Switches (p menu), is there a way to display the state of the "GENERAL" and "CUSTOM" switches ? I found {{~signals @root.E.S '*'}} and {{~getswitches @root.E.S '*'}} but no "General" or "Custom" Block in P Menu
Das geht (leider) nicht so einfach denn die legacy API steht nur im DedicatedServer zur Verfügung und nicht im Playfieldserver - somit braucht man eine Kommunikation zwischen den beiden. So was habe ich schon rudimentär eingebaut, aber es führt natürlich dazu das diese Teile NUR ein einem Serversetting laufen :-( Ich schaue mal ob ich den Teleporter dahingehend erweitern kann da hier schon der (rudimentäre) Einbau gemacht ist
Hi Astic, i found interesting movement methods in the eleon Api IEntity interface: Is it correct that your mod wrap this interface into the IEntityData interface? And therefore I have no direct access to the IEntity interface, correct? So can you explain why the IEntityData interface does not provide the movement methods? Is it a authorization problem to prevent exploits? Or is the Api Wiki incredibly outdated? And another Question: I found the property "ShieldLevel" in the IStructureData interface. But unfortunately this is not the shield level. It is the actual shield value. Is there a property somewhere else with the shield max value to calculate the real shield level? And another Question: I noticed the IEntityData property "Faction" now delivers a combined id tag like "player.1234". I would assume I need a database query method to fetch the attached name tag from somewhere. Has any of your interface a method for this?
Finally I found at least a vague rule to this problem. It seems that if I change one name to a custom one "something" needs at least several seconds to update. If I change directly another device name, its not saved. If I wait more then 30 seconds with closed control panel before changing another device, the first change attempt is succesful in 100% of the cases. It looks like that changing one name fires some "data base update event" which takes several seconds to complete and blocks any other change while updating the first change. I don't know if it is something that has its root cause in the api or the underlying game internal data base management.
I tracked down a strange behaviour on big structures: Here the cycleCounter stays 0: Code: //CsRoot.Items(E.S, "*"); // <- commented out int cycleCounter = 0; CsRoot.Items(E.S, "*").ForEach(item => { cycleCounter++; if (iFuelLimit != null) { CsRoot.Fill(item, E.S, StructureTankType.Fuel, iFuelLimit); } if (iOxygenLimit != null) { CsRoot.Fill(item, E.S, StructureTankType.Oxygen, iOxygenLimit); } if (iPentaxidLimit != null) { CsRoot.Fill(item, E.S, StructureTankType.Pentaxid, iPentaxidLimit); } }); Here the cycleCounter counts up: Code: CsRoot.Items(E.S, "*"); // <- not commented out int cycleCounter = 0; CsRoot.Items(E.S, "*").ForEach(item => { cycleCounter++; if (iFuelLimit != null) { CsRoot.Fill(item, E.S, StructureTankType.Fuel, iFuelLimit); } if (iOxygenLimit != null) { CsRoot.Fill(item, E.S, StructureTankType.Oxygen, iOxygenLimit); } if (iPentaxidLimit != null) { CsRoot.Fill(item, E.S, StructureTankType.Pentaxid, iPentaxidLimit); } }); I seems that "CsRoot.Items" return nothing at the first call, if the structure is "too big". But at the second call the method returns the items even on big structures. Does this work as intended? On small structures the counter counts up in both cases.
I have not yet "passed through" these functions as I do not (yet) see any effective use for them because, on the one hand, the scripts may not run fast enough and, on the other hand, you cannot find out anything about your surroundings, e.g. terrain height, etc. But if you have a concrete idea, let me know and I will implement the functions in the scripting. I only pass the ShieldLevel through 1:1 from the API, so if this doesn't work we need to write a bugticket for Eleon This ist native in the ModAPI from Eleon Faction: ToString() => $"{Group}.{Id}"
I have included code like this 'if (root.TimeLimitReached) return ...' in many places in the functions so that the scripts do not consume too much computing time at once, since in many cases they are (have to be) executed synchronously in 'Game_Update()'. But I will investigate this further, and thanks for the analysis :-D
I already asked myself how much "load" I can produce by growing structures until such thing happens. If the result would be relient, it would be ok. I hope you will find the reason for this not predictable behaviour. The second call seems to work relient. So something seems to change between the first and the second call. And the structure was it not.
Can you put the "large" structure in the workshop or send me the ebp file so that I can test it directly?
1. I planned to use the position information of the Entity in the hope in combination with security distances and explicitly defined coordinates (i.e. for auto miners) it would be good enough for a transportation drone vessel. But of course its still a early idea. I am at least not even sure if this would work to gather something in another playfield if the playfield is in standby. If the implementation needs two much work i'm fine to wait. 2. Yes, the value is passed through. But I was wondering about the inconsistence compared to the power properties. For power there is a "actual value" and a "max value". So i have all options to use the values or to calculate a "level". For Shield there is a property named "level", containing the actual value but the max value is missing. I just asked myself if this property is just misslabeled and the "max shield value" can be found somewhere else. 3. Maybe I don't get the point but how do I get the faction long or short name? Or has the Api still no acces to query the game data base where the faction data is stored?
Ok, I will add the functions so that you can "play around" with them. Unfortunately, this is all that the API "provides" here: Code: Assembly ModApi, Version=0.0.0.0, Culture=neutral, namespace Eleon.Modding { public interface IStructure { ... int PowerOutCapacity { get; } int PowerConsumption { get; } ... bool IsShieldActive { get; } int ShieldLevel { get; } ... } Unfortunately, the faction information can ONLY be obtained via the (old) API via the "dedicatedServer" and not from the database or the new API. And I have so far shied away from the effort of getting this from the "dedicated" via inter-process communication, especially as this would only work in MP server mode :-(
Thanks for implementing the movement methods. Ok, then "shield plan B". I hope determining the shield max value by examining the shield device id will not be too awkward. Ok, then we hope eleon will deliver the faction data in the next 20 years.
@Preston RegEx, PlayfieldDetails, GameoptionsYaml and flying https://github.com/GitHub-TC/EmpyrionScripting/releases/tag/11.4.1 11.4.1: Exec move ship with a timecritical set so it executes very often
I had just a thought to the timeout mechanic. Would it be much work to throw an exception if a method call takes too much time? Instead of returning nothing the cause would be visible then.