Space Engineers

Space Engineers

评价数不足
Red Alert! Script [FIXED]
   
奖励
收藏
已收藏
取消收藏
标签: other_script
文件大小
发表于
378.284 KB
2024 年 8 月 19 日 上午 8:42
1 项改动说明 ( 查看 )

订阅以下载
Red Alert! Script [FIXED]

描述
Fixed version of:
https://psteamcommunity.yuanyoumao.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 条留言
Jayfeather  [作者] 7 月 12 日 上午 3:09 
@LillyAvali

I'll try to fix it, but I don't promise. Since I'm not a programmer at all
LillyAvali 6 月 3 日 下午 6:44 
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 1 月 12 日 上午 9:56 
@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 2024 年 11 月 2 日 上午 3:09 
im getting an error from defense shields instance or something
Sirky 2024 年 10 月 10 日 上午 10:40 
hey, this fix works with energy shields too?
thx for update
Sethmanca 2024 年 10 月 5 日 下午 4:50 
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 2024 年 8 月 27 日 上午 3:44 
Thanks for the fix :D
Jayfeather  [作者] 2024 年 8 月 27 日 上午 2:35 
Maybe in the future this feature will be add
Kinoe 2024 年 8 月 26 日 上午 2:30 
Any chance to use in mods LCD?