Some improvement for the coding API ingame

Mathieu Metge shared this bug 4 years ago
Outdated

Hello,

I've been using the API for programmable block and while it is very useful to do automated tasks in the game, I wanted to point out some ugly tricks that I used and I wonder if that could be improved on your side or if what I done is not done the right way.

I wanted to do a simple hangar presurized open and close script (attached file).

I noticed three things that where odd:

- The IMyButtonPanel cannot implement for its buttons an event, so we cant define a callback. There's this weird way to communicates between scripts using lcd panels. I have a first script that's updating a lcd panel text so we setup button to call it and automatically update the lcd. On the other hand, we have the hangar script to check the value of the lcd panel, if there's a change, we can assume that's the button has been clicked.

- The IMyGasTank interface do not permit to simply ask if the selected tank is an oxygen tank (IMyOxygenTank is obsolete unfortunately). I managed to find oxygen tanks with the help of an sub-sub-property "BlockDefinition.SubtypeId", if this contains "Hydrogen" string, then it's not an oxygen tank (quite an ugly condition). Moreover, this property is empty for all oxygen tanks (I would have to test if an "Oxygen" string was present in the property otherwise).

- I Struggle with some properties with the IMyAirVent interface. The state property is working when we want to know of the room is Pressurized, but when I test if the room is Depressurized the conditions is always false (I checked and the percentage of oxygen is equal to zero but the state is still at Depressurizing). Not a problem because I could use the method GetOxygenLevel() and test it. But there's a bug here.


Best regards,

Mathieu Metge.

Replies (1)

photo
1

Hello, Engineer!


Thank you for your feedback! Your topic has been added between considered issues.

Please keep voting for the issue as it will help us to identify the most serious bugs.


We really appreciate your patience.


Kind Regards

Keen Software House: QA Department

Leave a Comment
 
Attach a file