Space Engineers

Space Engineers

Not enough ratings
Red Alert! Script [FIXED]
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
378.284 KB
19 Aug, 2024 @ 8:42am
1 Change Note ( view )

Subscribe to download
Red Alert! Script [FIXED]

Description
Fixed version of:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1110390521

Fixed:

Corner LCD's


Added support to new vanila LCD blocks


SETUP:
Does NOT need a timer block

Just simply put Alert in the name of the block you want to control. Block types that the script can control: lights, sound blocks, doors, LCDs, and any block that has a display like the Cockpits.

How to display the script in your Cockpit?

Add Alert to the cockpit's name, then hit refresh on the Programmable block running the script. After that, open the Cockpit's CustomData. Set the false value true at the display you want it to be shown.

USE:
To command the script you need to give it arguments
In a Cockpit or on a Button Panel add a new action for the Programmable block
Select RUN and type in one of the following arguments:
* normal --> clears the alert
* red --> sets alert mode to Red
* yellow --> sets alert mode to Yellow
* green --> sets alert mode to Green
* blue --> sets alert mode to Blue
* black --> sets alert mode to Black
* grey --> sets alert mode to Silent running (or Grey alert)
* intruder --> sets alert mode to Intruder
* engineering --> sets alert mode to Engineering

* toggle --> manually opens or closes the blast doors
* reset --> resets the script
You need to reset the script every time after you modify your ship!

CUSTOMISATION:
You add your own alert types like this:
AlertHandler.AddCustomAlert("myalert", "My own alert", new Color(255, 255, 255), Blink.AlwaysOn, false, Doors.NoInteract, "", Systems.AllOffline);

* the argument you type in the Programmable Block
* the title displayed on screens
* color of the light (r,g,b)
* blink mode (AlwaysOn / Slow / Fast)
* should the interior lights get dim (true / false)
* door toggler mode (NoInteract / Close / Open)
* name of the sound to play, leave empty if no sound should be played
* should the weapons/shields get enabled (AllOffline / ShieldsOffline / AllOnline)
9 Comments
Jayfeather  [author] 12 Jul @ 3:09am 
@LillyAvali

I'll try to fix it, but I don't promise. Since I'm not a programmer at all
LillyAvali 3 Jun @ 6:44pm 
The script is broken and doesn't interact correctly with the current version of Defense Shields.
It throws an exception and bricks the whole script, the mod ID and name for Defense Shields has changed and the script doesn't know how to handle this correctly.

Confusingly the script seems to contain a bunch of if statements telling it to ignore the shield mod and not bother with trying to handle it, but it still breaks and doesn't engage red / yellow alert.

Is there any chance you'd be willing to fix this?
pvC.Squish 12 Jan @ 9:56am 
@Jayfeather hi, I get some errors, if I put const bool autoToggle = true; to false. I get 5 x "Warning, unreachable code detected." For now I don't want the script to activate turrets or (not existing) shields. Could you please check? Maybe it's just something small ...
Citrus151 2 Nov, 2024 @ 3:09am 
im getting an error from defense shields instance or something
Sirky 10 Oct, 2024 @ 10:40am 
hey, this fix works with energy shields too?
thx for update
Sethmanca 5 Oct, 2024 @ 4:50pm 
Amazing work making this script work with the newer blocks. I love modifying the alert names to work better with my ship. (like changing the "normal" to the name of the ship.) Is there a way to make it work with the new console blocks, or have it centred properly on the angled LCD blocks when rotated?
Kinoe 27 Aug, 2024 @ 3:44am 
Thanks for the fix :D
Jayfeather  [author] 27 Aug, 2024 @ 2:35am 
Maybe in the future this feature will be add
Kinoe 26 Aug, 2024 @ 2:30am 
Any chance to use in mods LCD?