Welcome to a new programming series on Space Engineers! In these videos I hope to explain & learn how to create some cool scripts using the programmable block in Space Engineers, I hope you all enjoy it! 🙂
Steam Script Download Links:
Power Display Script: http://steamcommunity.com/sharedfiles/filedetails/?id=404212865
You can get the game on from its website below or from Steam
Space Engineers Website: http://www.spaceengineersgame.com/
Sleepless Knights Studios group on Steam: http://steamcommunity.com/groups/SKStudios
What’s your favorite series Google Form: http://goo.gl/forms/hwDmrkn3od
Disclaimer:
Space Engineers is property of Keen Software House
"for(int i = 0; i > 0; )" will never execute what's in it because i > 0 is always false. You wanted "for(int i = 0; i < 1; )" but then you'd get the "script to complicated" error you had with the while loop. If you want to wait you'll need to set up a simple state machine.
A couple of rules of thumb on errors: If you get an error about parentheses in an off place you've missed one out 'somewhere' in your program. Errors saying you provided a method instead of something else mean you missed a () from the end of a function.
Consider using visual studio for editing your code (https://www.reddit.com/r/spaceengineers/comments/2r1j1q/scripting_in_visual_studio/) it's so much nicer and you can paste your code in game. Not sure how it'd interact with your recording software though.
You are the cleanest coder i have seen so far in SE.
You probably fixed it by now but maybe sensors could work instead of buttons making it a more seamless experience
As far as I know programmable blocks can only run for a specific time (not sure if it was one tick or one second), so you wont get arround using timers. But actually its not that hard, I got a working airlock with just a few lines of script and two timer blocks, it even locks one of the doors, so it cannot be opened by accident, and some indicator lights. Let me know if you would like to See my solution ;)
Hey, found this you might be interested in, might even want to incorporate part of it into this airlock system!? someone has coded a system that senses where and what room is pressurised or depressurised
On a ship I built that uses my solution to the full tank problem I counted the depressurization time for the hanger bay and came out with. 9-10 seconds to depressurize completely.
I found the same issue when I started piddling with the oxygen blocks. The only solution I found was to have a tank seperated from the generator.
You can add delays to coding. I had a quick look on google and there are a few forums and vids. Its all stuff I don't understand but it get the fact it can be done across. Its all this DateTime, QueuedAction, null, Increase Delay, AddSeconds, Random rng, public Func<int>Action, void Main and other coding terms that mean jack to me as of yet lol
Machinery like refineries, cargo containers and the vents are not airtight (from what I read).
Awesome code work by the way dude. I know way too little about code. ;-)