Stormworks: Build and Rescue

Stormworks: Build and Rescue

a guide for the new radars?
im pretty new and im trying to learn the radars and the only tutorials i can find are about the old ones...
< >
Showing 1-12 of 12 comments
Shillelagh Oct 27, 2021 @ 7:51am 
It seems they change them every update and tell no one.
Sonny Pruitt Oct 30, 2021 @ 2:49pm 
Ya Im looking too. Maybe the radars are busted cause they only have one input for data where before they had target and distance.
The Crab Oct 30, 2021 @ 3:42pm 
Originally posted by Ebojager:
Ya Im looking too. Maybe the radars are busted cause they only have one input for data where before they had target and distance.
You need to understand how to read composite signals with LUA to use the new radars. I don't, but that is how they are meant to be used.
RiftHunter4 Oct 30, 2021 @ 4:56pm 
Originally posted by The Crab:
Originally posted by Ebojager:
Ya Im looking too. Maybe the radars are busted cause they only have one input for data where before they had target and distance.
You need to understand how to read composite signals with LUA to use the new radars. I don't, but that is how they are meant to be used.

You don't need to read it with LUA. You just need to read the composite data. There's logic blocks for that in the microcontroller editor.

A brief tutorial
Composite data has 2 simultaneous sides: on/off data and number data. You can send and receive both on the same composite data line.

The radar works by sending you an on/off for if a target has been found. It can detect up to 8 targets. The channel number on the composite data is which target it is. The first target detected is channel 1. The 2nd is channel 2 and so on.

Radar uses the number side of the comp data to give you I for on the target. It does this in chunks of 4. So the first target takes channels 1,2,3, and 4. The 2nd takes 5-8, and so on. The data is formated like this (if I remember right. The comp output on Radar explains it):
1. Distance between radar and target
2. Azimuth
3. Elevation
4. Time since detection

So to make a simple turret, you just need to use a composite read to check channel 1 on the on/off data. If it's on, then read channel 2 and channel 3 from the numeric data. Channel 2 (the Azimuth) tells your turret where to turn to. Channel (the elevation) tells your turret how to pitch itself (aim vertically). You then send those channels out of the MC to the horizontal and vertical pivots of your turret. You might need to multiply or invert the values depending on how you design your turret, but you don't need to use any LUA for a basic turret.
Sonny Pruitt Oct 31, 2021 @ 12:14am 
Originally posted by RiftHunter4:
Originally posted by The Crab:
You need to understand how to read composite signals with LUA to use the new radars. I don't, but that is how they are meant to be used.

You don't need to read it with LUA. You just need to read the composite data. There's logic blocks for that in the microcontroller editor.

A brief tutorial
Composite data has 2 simultaneous sides: on/off data and number data. You can send and receive both on the same composite data line.

The radar works by sending you an on/off for if a target has been found. It can detect up to 8 targets. The channel number on the composite data is which target it is. The first target detected is channel 1. The 2nd is channel 2 and so on.

Radar uses the number side of the comp data to give you I for on the target. It does this in chunks of 4. So the first target takes channels 1,2,3, and 4. The 2nd takes 5-8, and so on. The data is formated like this (if I remember right. The comp output on Radar explains it):
1. Distance between radar and target
2. Azimuth
3. Elevation
4. Time since detection

So to make a simple turret, you just need to use a composite read to check channel 1 on the on/off data. If it's on, then read channel 2 and channel 3 from the numeric data. Channel 2 (the Azimuth) tells your turret where to turn to. Channel (the elevation) tells your turret how to pitch itself (aim vertically). You then send those channels out of the MC to the horizontal and vertical pivots of your turret. You might need to multiply or invert the values depending on how you design your turret, but you don't need to use any LUA for a basic turret.

I'll take a look at what I have so far from the other tutorial and see if I can understand some of it. Thank you. Ive just been following the tutorials without really understanding what its doing.
benzin.a95 Nov 5, 2021 @ 1:08am 
Thank you, I just tried to read chanels 1, 9, 17 and 25 for target 1. Your explanation is great, at least it shows some values!
By the way, am I the last one who plays stormwors for saving people, not killing them?
OMNI Nov 5, 2021 @ 4:57am 
They are pretty broken still...
Crixtl Feb 3, 2023 @ 11:51am 
Originally posted by RiftHunter4:
Originally posted by The Crab:
You need to understand how to read composite signals with LUA to use the new radars. I don't, but that is how they are meant to be used.

You don't need to read it with LUA. You just need to read the composite data. There's logic blocks for that in the microcontroller editor.

A brief tutorial
Composite data has 2 simultaneous sides: on/off data and number data. You can send and receive both on the same composite data line.

The radar works by sending you an on/off for if a target has been found. It can detect up to 8 targets. The channel number on the composite data is which target it is. The first target detected is channel 1. The 2nd is channel 2 and so on.

Radar uses the number side of the comp data to give you I for on the target. It does this in chunks of 4. So the first target takes channels 1,2,3, and 4. The 2nd takes 5-8, and so on. The data is formated like this (if I remember right. The comp output on Radar explains it):
1. Distance between radar and target
2. Azimuth
3. Elevation
4. Time since detection

So to make a simple turret, you just need to use a composite read to check channel 1 on the on/off data. If it's on, then read channel 2 and channel 3 from the numeric data. Channel 2 (the Azimuth) tells your turret where to turn to. Channel (the elevation) tells your turret how to pitch itself (aim vertically). You then send those channels out of the MC to the horizontal and vertical pivots of your turret. You might need to multiply or invert the values depending on how you design your turret, but you don't need to use any LUA for a basic turret.

and how to insert this info in LUA?, trying to make a radar display here, but man, this is hard for someone who only did a "hello world" in university.
TKTom Feb 3, 2023 @ 12:01pm 
Originally posted by Crixtl:
and how to insert this info in LUA?, trying to make a radar display here, but man, this is hard for someone who only did a "hello world" in university.

Here's an example, that takes in a composite radar info and output 8 (x,y) co-ordinates on composite channels 17-32 co-ordinates output are relative to the radar, so to convert to world co-ordinates you would need the position of the radar and its pitch and roll:




positions = {}
MapDist = 0
-- Tick function that will be executed every logic tick
function onTick()


for i = 0,7,1 do
if input.getBool(i + 1) then
MapDist = input.getNumber(4*i +1)*math.cos(input.getNumber(4*i +3)*2*math.pi)
positions[2*i+1] = MapDist*math.sin(input.getNumber(4*i +2)*2*math.pi)
positions[2*i+2] = MapDist*math.cos(input.getNumber(4*i +2)*2*math.pi)
else

positions[2*i+1] = 0
positions[2*i+2] = 0


end
end

for i=1,16,1 do
output.setNumber(16+i,positions[i])


end


end
Crixtl Feb 3, 2023 @ 1:10pm 
just to know the knowhow, why i = 0,7,1 ?
Crixtl Feb 3, 2023 @ 1:24pm 
btw im making a radar with a line, so is a relative to radar display, no need to map position. im using the MrNJersey scrip, and trying to modify for the new system. so far im trying to make to detect at least 1 target at a time, but no luck, it doest let me run the program if i try to store a nill value from a imput, and i dont know how to solve that specific problem.

But, i understand pretty well your code, (except the part where you asing the values to "i"), and help me to understand a bit more the code. Tnxs
TKTom Feb 3, 2023 @ 1:46pm 
Originally posted by Crixtl:
just to know the knowhow, why i = 0,7,1 ?

This is just the syntax that Lua takes on a for loop, so that means run an iteration over a variable i which goes from 0 to 7 and increments by 1 each time. So its i={first},{last},{increment}

https://www.lua.org/pil/4.3.4.html
< >
Showing 1-12 of 12 comments
Per page: 1530 50

Date Posted: Oct 27, 2021 @ 7:29am
Posts: 12