Space Engineers

Space Engineers

View Stats:
script for weather alert
I am looking for either a script or to create one to create a visual alert in the event of a storm or other anomaly or meteor shower etc.
< >
Showing 1-15 of 17 comments
ShadedMJ Jun 2, 2023 @ 5:57am 
There is no good way to detect weather. Scripts are made to reference blocks, not the environment. The closest I've ever seen is monitoring wind turbine power available. If power available >500kw or something then the weather is sandstorm.

Similar that scripts can't directly see game settings or directly affect an engineer.
Last edited by ShadedMJ; Jun 2, 2023 @ 6:11am
cyrusvonvirus Jun 2, 2023 @ 6:05am 
thank you for the answer
ShadedMJ Jun 2, 2023 @ 6:18am 
In a similar way, turning lights on when its dark is by either monitoring solar panel output or manually synchronizing a day long timer system to dawn/dusk. You can't easily get the effective hour of the game day.
ShadedMJ Jun 2, 2023 @ 6:41am 
Originally posted by skivel2:
there is a weather script built into your text panels if that helps (under content pick scripts and then weather)
If I remember correctly, that just displays the weather as a sprite image and cannot be pulled out. DIsplay only, not readable so not usable to script.
Mojo Jun 2, 2023 @ 6:49am 
Originally posted by ShadedMJ:
In a similar way, turning lights on when its dark is by either monitoring solar panel output or manually synchronizing a day long timer system to dawn/dusk. You can't easily get the effective hour of the game day.
The Hud Compass mod has built in time of day that works.
https://steamcommunity.com/sharedfiles/filedetails/?id=1469072169&searchtext=hud
Last edited by Mojo; Jun 2, 2023 @ 6:50am
ThePandaNetwork Jun 2, 2023 @ 7:06am 
This is not possible. only possible as a mod:selike:
MIQL Jun 2, 2023 @ 8:00am 
Originally posted by ShadedMJ:
There is no good way to detect weather. Scripts are made to reference blocks, not the environment. The closest I've ever seen is monitoring wind turbine power available. If power available >500kw or something then the weather is sandstorm.

Similar that scripts can't directly see game settings or directly affect an engineer.

What an idea dude. How did I never thought of that??? Does the wind turbine produce 500kw during thunder too? (I assume so)

How would you go about to set it up?
Event controller, timer and wind turbine?
ShadedMJ Jun 2, 2023 @ 1:44pm 
Originally posted by MIQL:
...How would you go about to set it up?
Event controller, timer and wind turbine?
I have not worked with the event controller, but I am a script writer and programmer.

That said and without using a script .... I'd have a LCD display with the word "Normal" in big letters. Another LCD with "Stormy" in big letters. Event controller with "Power output percentage" selected as a criteria at >100%, Action 1 (ON) to run "Timer Block 1" and Action 2 (OFF) to run "Timer Block 2". Timer Block 1 to set stormy LCD ON and normal LCD off. Timer block 2 to set normal LCD on and stormy LCD off. I don't know if the >100% is going to work but this is as close as I think can be done without a script.

With a script, I'd run the wind turbine a little and see how much power it can provide under normal conditions, multiply that by 1.5 and call it "windy", script to check the wind turbine and if its >windy run either timer block as stated above.
cyrusvonvirus Jun 2, 2023 @ 1:46pm 
I think so, I would like to make an alert on an lcd monitor both in the ships and the bases (like red light to say that the storm is coming and green when it's over
cyrusvonvirus Jun 2, 2023 @ 1:48pm 
je vais voir cela
ShadedMJ Jun 2, 2023 @ 4:23pm 
Originally posted by Mojo:
...The Hud Compass mod has built in time of day that works. ...
I haven't looked at it, but I consider that slightly off-topic for this discussion. That's a mod and not even a script. Mods can do many things scripts cannot.
Mojo Jun 2, 2023 @ 6:02pm 
Originally posted by ShadedMJ:
Originally posted by Mojo:
...The Hud Compass mod has built in time of day that works. ...
I haven't looked at it, but I consider that slightly off-topic for this discussion. That's a mod and not even a script. Mods can do many things scripts cannot.
I know was just letting you know if you ever wanted to look how they get the time from the mod, could may possibly be worked into a script. :)
MIQL Jun 3, 2023 @ 1:43am 
Originally posted by ShadedMJ:
Originally posted by MIQL:
...How would you go about to set it up?
Event controller, timer and wind turbine?
I have not worked with the event controller, but I am a script writer and programmer.

That said and without using a script .... I'd have a LCD display with the word "Normal" in big letters. Another LCD with "Stormy" in big letters. Event controller with "Power output percentage" selected as a criteria at >100%, Action 1 (ON) to run "Timer Block 1" and Action 2 (OFF) to run "Timer Block 2". Timer Block 1 to set stormy LCD ON and normal LCD off. Timer block 2 to set normal LCD on and stormy LCD off. I don't know if the >100% is going to work but this is as close as I think can be done without a script.

With a script, I'd run the wind turbine a little and see how much power it can provide under normal conditions, multiply that by 1.5 and call it "windy", script to check the wind turbine and if its >windy run either timer block as stated above.


Oh yah that makes sense...Thanks :))
And if I wanna be super annoying Im gonna add alarm blocks too xDD
ShadedMJ Jun 26, 2023 @ 8:20pm 
I just saw this mod that apparently adds weather to the event controller.
https://steamcommunity.com/sharedfiles/filedetails/?id=2935236892
Accessing the weather SHOULD (IMHO) be accessible via the Mod/Scripting API. It's a simple get and can be throttled with a simple cool-down period like ray-casting.
< >
Showing 1-15 of 17 comments
Per page: 1530 50

Date Posted: Jun 2, 2023 @ 5:27am
Posts: 17