Space Engineers

Space Engineers

36 ratings
Self-Destruct Script
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
2.503 KB
28 Jun, 2015 @ 3:42am
1 Change Note ( view )

Subscribe to download
Self-Destruct Script

Description
Watch the video on youtube: https://youtu.be/u0B1h4eXSos
My youtube channel: www.youtube.com/MegaDerf110

Introduction
This is a self-destruct script.
Its scope it's to damage your ship and make it really hard to recover.
When the script is run, the ship will most likely never be usable again, so run it only when you are sure your ship is about to be taken by your enemies. Or when you are so bored that you really want to destroy something.
This script can also be used in traps, watch the video to learn more about it.
To make sure it's not run by accident, this script needs a secret password to be run, read below to learn how it works.

The code itself looks pretty bad. That's because it's the first script I've ever written, and since I wanted to understand the single mechanisms I made several different scripts and then I merged them together in this final one. It's not that bad, and it works exactly as I wanted it to, but if you don't like how it's made, this is why.

What it does
If the password given is correct, this script will perform these actions:
  • Changes the color (red), the range and the intensity of all the lights (both interior and spotlights)
  • Makes all the sound blocks play their sound
  • Opens both normal and hangar door (to cause a sudden depressurization)
  • Sets the air vents to depressurize
  • Locks the landing gears and sets them to the maximum break force
  • Overrides the controls of both thrusters and gyroscopes to make the ship move and extremely unstable
  • Changes the settings of both rotors and pistons to create a lot of damage and instability
  • Sets the gravity generators to -1G and increases their area of influence to the maximum (spherical generators are not modified)
  • Sets the connectors to throw out all the items that they can access to
  • Sets the warheads to explode after 10 seconds
  • Turns off these blocks:
    1. Medical rooms
    2. Beacons
    3. Laser and radio antennas
    4. Merge blocks
  • Turns on these blocks:
    1. Mass blocks
    2. Grinders
    3. Welders
    4. Drills
    5. All the kinds of turrets
    6. All the previous blocks that this script access to to perform an action different than turning it off.

The password system
This script uses a password system to avoid accidental runs and other people running the program without your consent. The password is hidden in the private text of a text panel (not LCD panel!). You can name the text panel however you want and then tell the script to use that particular panel.
To do so, you need to open the script and modify the third line of code.
const string TextPanel="Input";//The name of the textpanel that contains the password
Now, instead of Input you need to write the name of the text panel you want to hide your password in. Don't forget to put it inside quotation marks, like it is in the standard code. As you have probably seen, the standard name of the text panel is Input, so you could just name a text panel like that without having to modify the code.
Now you just need to write the password in the private text section of your text panel. Remember: don't add unwanted spaces and don't start new lines.
When you want to run the program, you'll need to write the password in the argument box of the programmable block and run it.
If the password is wrong or if the script can't find the text panel, nothing will happen.
Important: set both the text panel and the programmable block as yours, that way you can choose who can see and modify the password and the script will be able to read from the text panel.
If you need further explanations, leave a comment.
If you place the text panel but don't write the password, the script will work when no password is given in the argument box.

Disclaimer
I am not responsible of the damage that this script may cause to your ships, world saves, computers or servers. You are responsible of the proper or wrong usage of this script.
You are not allowed to redistribute this script or modified versions of it, unless when told otherwise. A script that contains parts of this script is considered as a modified version of this script.
You are free to use this script in your world or on any server as long as you don't pretend to be its maker.
If you want to use this script in a ship/world that you want to share publicly you need to give the proper credit. To know how to do it, ask it to me in the comments below or in another way.
If you want to modify this script or use parts of it in a bigger script, you need to ask for permission and I'll decide based on your specific situation.


If you find grammar errors inside the script or in this text, please let me know.
23 Comments
jackik 7 Aug, 2017 @ 5:47am 
you could have all and any LCD on the ship show a countdown. but the script would need to be constantly updated via timer.
jackik 7 Aug, 2017 @ 5:46am 
the password system isn't safe at all. I'd recommend some sort of encryption. also if anything i'd use the Custom Data to save the password. if you do that you can also easily safe the password in the PB itself. that would be a lot safer!
marty44 18 Jun, 2017 @ 2:27am 
Script does not work properly anymore unless you replace GetPrivateText with GetPublicText. Just an FYI.
WarMage 13 Nov, 2016 @ 9:50am 
I can imagine trolling people on live servers with this script. Like he enters and the he is like: "WTF??!!!!"
commie._.tears 8 Aug, 2016 @ 2:59pm 
It sounds more like an incapacitation script. It'll more likley rip your ship in half and make it spin a lot.
MegaDerf  [author] 1 Jul, 2016 @ 3:39pm 
CLANG! CLANG! CLANG!
FPC 1 Jul, 2016 @ 8:48am 
This script will crash any DS its run on. Relies on magic of Clang. :/
Rathlon Tobias Riverwind 20 Sep, 2015 @ 10:15pm 
Now what would be cool about this is having an audio countdown and once it reaches 0 boom goes the ship.
Much like in Star Trek movie Wrath of Khan.
MegaDerf  [author] 1 Sep, 2015 @ 8:48am 
Thanks. The script right now doesn't have a countdown, but it could be done.
zachiyo123 31 Aug, 2015 @ 8:10pm 
Would be cool if it showed how long the countdown had as a threat to enemies on board and for alies to escape