Great timing to teach us intimidating tech that we'll need in the future! Looking forward to Part 2! May I add two notes for your next video? 1) Nil'ing your index at full rotation has the major downside that targets close to rotation end will be visible very briefly. I would suggest to bind the index to the rotation. This allowes you to clear the index at access first, then write any accuired target. (downside may be, as you saw in this video, that there might me a de-sync in the rotation number when the if >= 0.5 sets a new default after first pass - that needs to be addressed) 2) Add Alpha Values to the dots, that decay by tick. Looks super cool! You can set the start value to a twin-array (same index x2) and reduce it every tick by 1.
please make an updated version of this tutorial, it was heartbreaking to get halfway through this and then realise that the radar part is different to mine.
Hey, just want to let you know, the starter boat (can be found in presets) still had the old radar, so just take it off of it (control+left click) I dont know if the tutorial still works for it or anything because I havent tried it
yea. i saw that too. they changed the radar basic to have a radar number out, input in and composite out. i have no idea how its going to read from the composite out since im so new to this game. though, did notice it has 8 channels on it i think.
@@darkangelgaming7787 you can read from the composite out using a 'composite read (number/on&off)' in your microcontroller, then you can select which channel you want to read from. the channels range from 1-32, and are basically 32 number, and on/off inputs squeezed into one. you can tell what channels mean what by hovering over the composite logic node on the radar. Hope this helps...
@@VtolVRClips forgot to mention The radars can now detect upto 8 targets within its field of view. So the first detected target will have its distance value in channel 1 You can read that channel to find the distance
Great tutorial and thanks for explaining everything on the way however is it possible you can made an updated one for the new radar systems as that would be very helpful?
not bad, i use a similar system, however, each table value stores a distance, rotation and tick counter. every tick, the counter for all points is increased, when that tick count is as long as one rotation, it gets deleted. I also prefer to draw rectangles with a width and height of 1 because it's less laggy than circles, and it looks basically the same.
I watched this video 3 times and made sure everything was copied down besides a few number changes because I built it on a 3x3 monitor but the sonar still doesn't pick anything up, i aslo made a 2x2 monitor like the one in the video but it still didn't pick anything up, please help
hey so im about 2 years too late and the radars have changed to where its only a composite output im still trying to figure it out but could you by chance make a video on an up to date version of this?
Good tutorial but i am stuck with the problem. I have no such thing called "radar yaw" or any of that i only have "radar rotation" number as output and "radar data" as composite as input
I followed this almost to the letter (adjusted numbers to fit the screen) and now I'm stuck halfway through. My Lua says "10: syntax error near '+'" and I have no idea what's going on. Up until this point it was going to plan. It started right as we were programming it to have the line spin Edit: I found my problem. Had an extra + instead of =
I'm really curious how to make LUA works for property selection of microcontroller because they are not even attached to anything. Therefore, it used LUA to make it works. For example, adjust the AFR modular engines without connection to any logic. But it used LUA.
The new radar has only 2 funtions, radar on/off and rotations! This is where i can't go futher. rotations, on the radar, is a output. In the microcontroller we need to make a output Radar Yaw but i can not connect it on de radar. And now comes a strange thing: the radar is rotating on screen, but is not conected with the output Radar Yaw. Please can you help me and explain why and how i can go futher?
For anyone confused with the code which does the rotation of the line I found a way basically x1 = w/2+h/2* math.cos(((rotation*1.57)*4)-1.57) y1 = h/2+h/2* math.sin(((rotation*1.57)*4)-1.57) where rotation is the value of the radar's rotation node and w and h are the screen's width and height respectively explanation : [multiplying rotation with 1.57 turns the rotation to radians] [multiplying it by 4 makes sure that it turns 6.28 radians] [subtracting 1.57 makes sure that the line starts from the top of the screen] In my opinion, I think this is the easier way
Here's my full code :- w1=0 h1=0 -- Tick function that will be executed every logic tick function onTick() rotation = input.getNumber(30) -- I wrote the rotation value into channel 30 because 1-28 channels are being used for radar and then 31,32 are the inputX and inputY for touchscreen x1 = w1/2+h1/2* math.cos(((rotation*1.57)*4)-1.57) y1 = h1/2+h1/2* math.sin(((rotation*1.57)*4)-1.57) end -- Draw function that will be executed when this script renders to a screen function onDraw() w = screen.getWidth() -- Get the screen's width and height h = screen.getHeight() w1=w h1=h --Makes width and height accessible by the onTick function screen.setColor(0,255,0) screen.drawCircle(w/2,h/2,h/2) screen.setColor(0,200,0,125) screen.drawLine(w/2,h/2,x1,y1) end
@@dcvendex4166 usually when I go to the announcements on the stromworks discord, it seems like Majority of the updates are on Friday but I could be wrong.
I have no idea why, but my Stormworks must be messed up. I followed the tutorial precisely, and my radar is pointed in a really weird direction, only detects one thing, and it's not lined up at all. It also doesn't show the distance properly, so not a clue why it's gone wrong.
They change the radar, now, the radar does not recive imput, it only output angle of the dome, and the target data is given via composite, up to 8 targets, im not a programer, but so far manage to change the display so the line move with the radar angle (just ignoring the speed and angle part, and change the "a" for put an imput line in the "radarA" line.
the new update causes a tick error Edit: Nvm i put con instead of cos edit: when i tried to put y2 and x2 in table it gave me a syntax error for the equals sign if that is what is i can't tell my quality isn't super good
After an year of doing nothing, I've detected that Jersey don't know lua as much as we all here. He don't know about local variables and it is used to get rid of x1, x2, x3, x4, ..., xn in code. For example, x3 can be local x to get rid of 3.
For anyone wondering how to fix this Just make a composite input connect the composite info from your radar to your micro controller and then inside the micro controller just connect the Composite node with the lua script node
@@Dragon5432Hey no worries! Turns out this video is outdated as of maybe a year ago? I'm still learning how it all works too, and haven't found an up to date video yet. There is a Steam guide named 'Creating a Simple Marine Radar" which looks promising, but I'll reply back here if I find a tutorial/guide that works for the current stuff
Loved this game up till this point. Taking calculators out to play a game is where I draw the line. If the combat was great it would be worth the hours these creations take, but the combat is horrendous at best. Love the idea, but they should of stuck with Search and Rescue and made a new game for fighting in my opinion! I think Radar should be a standard item, not something we have to literally create with code. Imagine having to code the defibrillator? I think this game would achieve a lot more success by making items like Radar automatically function by just hooking it to a screen. I cant tell you how bad I want to make military equipment to fight the AI, but realizing how poor the combat is, I can not dedicate the time to learn all this. If radar is this hard, how hard is targeting? Also the creations I have used with Radar and such, seem very touch and go. More do not work than do. I'm not trying to just be a downer here, It is just that all the weapons DLC are useless to me without radar and targeting systems, and I can not be the only one lacking the patience to learn that much for the sloppy combat as the reward. I learned to make a nuclear reactor function in this game, but the deeper logic stuff I am absolutely lost, and math is my best subject! It does not help that there is like no tutorial for the logic in the game. Thank gosh for you and your channel, you have taught me far more than the game is capable. Now to watch this video for the 5th time to see what I am just not understanding here!
For many of these more complex components, people create them and upload them to the workshop, you can just grab them from there and then plug and play them into your creations
You could make a simple radar which will still ping locations and distances without using lua. My weaponry is auto loading but I like aiming manually and having the radar as a guide.
Jeez slow down for some of us non rocket scientists. I have to pause and replay this a bunch. And then try to save to find it didn't save my Lua script. Neato.
@@OutletVibes yeah, the second i noticed the radar couldnt receive an angle i remembered. In the radar update video he said it was easy to turn composite into that screen but i hope he makes another video on it
@@MrNJersey Its all deprecated radars on the workshop, I'm horrible at math and your radar doesn't work on the workshop side by side with others. I'm gonna need that new radar tutorial asap. thank you.
@@nonnodacciaio704 pretty sure that saying first originated in 2020-2021, so yea??? Besides, if you think something is cringe, you dont need to tell someone it is, then you just look like someone who needs attention desperately
at 24:38 can YOU PLEASE stop that? "guys, justaquirquona" You have a horrible habit of trying to rush sentences especially your outro luckily you didnt do the outro like that this time. But its horribly cringey... "ok guys... if you like the ida m'sure you mash that like butondont orget tinkatha litil bell icon annnnd I'll see you in the next video"
Great timing to teach us intimidating tech that we'll need in the future! Looking forward to Part 2!
May I add two notes for your next video?
1) Nil'ing your index at full rotation has the major downside that targets close to rotation end will be visible very briefly. I would suggest to bind the index to the rotation. This allowes you to clear the index at access first, then write any accuired target. (downside may be, as you saw in this video, that there might me a de-sync in the rotation number when the if >= 0.5 sets a new default after first pass - that needs to be addressed)
2) Add Alpha Values to the dots, that decay by tick. Looks super cool! You can set the start value to a twin-array (same index x2) and reduce it every tick by 1.
Yay a tutorial on stuff I don’t understand
Do you have stormworks on steam?
please make an updated version of this tutorial, it was heartbreaking to get halfway through this and then realise that the radar part is different to mine.
Hey, just want to let you know, the starter boat (can be found in presets) still had the old radar, so just take it off of it (control+left click) I dont know if the tutorial still works for it or anything because I havent tried it
yea. i saw that too. they changed the radar basic to have a radar number out, input in and composite out. i have no idea how its going to read from the composite out since im so new to this game. though, did notice it has 8 channels on it i think.
@@darkangelgaming7787 you can read from the composite out using a 'composite read (number/on&off)' in your microcontroller, then you can select which channel you want to read from. the channels range from 1-32, and are basically 32 number, and on/off inputs squeezed into one. you can tell what channels mean what by hovering over the composite logic node on the radar.
Hope this helps...
i have sad news if you dont now this but mrnjersey stopped
can we get an updated tutorial for the new radars?
would love that, i cant get this to work anymore :(
@@fourwindbadger8066 same
@@VtolVRClips yeah i added a comment here few mins ago. You can try it if you still have issues
@@VtolVRClips forgot to mention
The radars can now detect upto 8 targets within its field of view.
So the first detected target will have its distance value in channel 1
You can read that channel to find the distance
@@luckyizzac quite interesting izzac :D
This really helps as I was building a plane for the weapons dlc
Great video, I would really appreciate more Lua tutorials. Keep up the good work
I had to take a coding class beforehand to understand. WORTH IT
Would you be able to make a tutorial on composite radars? I believe I have an issue though I do understand Lua and composite data
How come my radar doesnt have the same connections as yours? Mine only has Active and Rotation
there are new radars
Great tutorial and thanks for explaining everything on the way however is it possible you can made an updated one for the new radar systems as that would be very helpful?
not bad, i use a similar system, however, each table value stores a distance, rotation and tick counter.
every tick, the counter for all points is increased, when that tick count is as long as one rotation, it gets deleted.
I also prefer to draw rectangles with a width and height of 1 because it's less laggy than circles, and it looks basically the same.
Sir i tried it.. and my target didnt pop up on the screen. I follow the code of your lua. Still no red dot
I watched this video 3 times and made sure everything was copied down besides a few number changes because I built it on a 3x3 monitor but the sonar still doesn't pick anything up, i aslo made a 2x2 monitor like the one in the video but it still didn't pick anything up, please help
Outdated sadly😭
awesome tutorial as always. this came in handy for my submersible's sonar!
can anyone help me it says that there is a tick failure and the index table is NaN this only happens when the sonar is turned on
hey so im about 2 years too late and the radars have changed to where its only a composite output im still trying to figure it out but could you by chance make a video on an up to date version of this?
im screwed when the Weapons come out because i cant work any kind of guided missiles
I don't have any experience with LUA. Can you have one of the values in the table count down every second and when it hits 0 the line is deleted?
has something changes since 2 months because nothing like this shows on the radar now, with the yaw component connect etc.
Good tutorial but i am stuck with the problem. I have no such thing called "radar yaw" or any of that i only have "radar rotation" number as output and "radar data" as composite as input
They updated the radars so this tutorial is now slightly outdated. I'd suggest a new tutorial but I haven't found one yet.
9:00 couldnt u just switch cos with sin?
I followed this almost to the letter (adjusted numbers to fit the screen) and now I'm stuck halfway through. My Lua says "10: syntax error near '+'" and I have no idea what's going on. Up until this point it was going to plan. It started right as we were programming it to have the line spin
Edit: I found my problem. Had an extra + instead of =
The tutorial that went missing
or just deleted
it got privated fore some reason
because it was outdated
I'm really curious how to make LUA works for property selection of microcontroller because they are not even attached to anything. Therefore, it used LUA to make it works. For example, adjust the AFR modular engines without connection to any logic. But it used LUA.
you use property.getNumber("name") or property.getText("name") in the lua script, just as you would use input.getNumber(channel)
The new radar has only 2 funtions, radar on/off and rotations!
This is where i can't go futher.
rotations, on the radar, is a output.
In the microcontroller we need to make a output Radar Yaw but i can not connect it on de radar.
And now comes a strange thing: the radar is rotating on screen, but is not conected with the output Radar Yaw.
Please can you help me and explain why and how i can go futher?
I think all the other stuff is composite now?
I know i thank'd you on the first up-load but thanks again
My radar does not seem to have so many „connection points“. Why is that? Am I in a newer Version?
Same, trying to figure that out
Its outdated for the new radar, id advise trying to find a different tutorial
Nice vid!
How did you watch a 31 minute video in 5 minutes lol
@@dnt_alert5806 magic.....
When i do it it ses that its expected to end at the line that its ment to
For anyone confused with the code which does the rotation of the line
I found a way
basically
x1 = w/2+h/2* math.cos(((rotation*1.57)*4)-1.57)
y1 = h/2+h/2* math.sin(((rotation*1.57)*4)-1.57)
where rotation is the value of the radar's rotation node and w and h are the screen's width and height respectively
explanation :
[multiplying rotation with 1.57 turns the rotation to radians]
[multiplying it by 4 makes sure that it turns 6.28 radians]
[subtracting 1.57 makes sure that the line starts from the top of the screen]
In my opinion, I think this is the easier way
Here's my full code :-
w1=0
h1=0
-- Tick function that will be executed every logic tick
function onTick()
rotation = input.getNumber(30) -- I wrote the rotation value into channel 30 because 1-28 channels are being used for radar and then 31,32 are the inputX and inputY for touchscreen
x1 = w1/2+h1/2* math.cos(((rotation*1.57)*4)-1.57)
y1 = h1/2+h1/2* math.sin(((rotation*1.57)*4)-1.57)
end
-- Draw function that will be executed when this script renders to a screen
function onDraw()
w = screen.getWidth() -- Get the screen's width and height
h = screen.getHeight()
w1=w
h1=h --Makes width and height accessible by the onTick function
screen.setColor(0,255,0)
screen.drawCircle(w/2,h/2,h/2)
screen.setColor(0,200,0,125)
screen.drawLine(w/2,h/2,x1,y1)
end
Thank you.
on the drawline part how did he like link those words on the you know the script
You could just add the table reset code to the angle reset if.
the three pays- apple pay, google pay and 2:45
Take my like
What do I do now that the radar you use is now a sonar?
I keep getting the error:
Tick_Failure
33: Table index is NaN
Stop 0x00000000
25:14 i am stuck here... radar did not showing any targets
The title is out dated😢 spent an hour his inputs and outputs where different than mine😭
@@Jackthewack7same here, I guess I’ll have to find another tutorial
Finally he made another one. His older video does not work
There an updated tutorial?
Hopefully the weapons dlc will come out on maybe Friday, Also keep up the good work MrNJersey.
Devs always announce the major updates weeks in advance so doubt it would be this week Friday
I hope it is going to be announced this Friday.
That would be awesome. How did you figure out it might be this Friday?
@@dcvendex4166 usually when I go to the announcements on the stromworks discord, it seems like Majority of the updates are on Friday but I could be wrong.
@@dnastudios9836 same
There do not a cure a dot on my screen why?
my dots wont stay.. my table is the same but they just dont stick..
Does this work with new radar?
can someone pls tell me why my line has an error?i do everything correct,i double checked everything,it just doesnt work
Upload it to workshop and let me know what it's called
make sure that you writed cos and sin right
can you make a tutorial about switching Lua? it would be good. plspls.
in the tables how is x2 a index? y2 is a value yeah but isnt x2 also a value? and why "for x2, y2 in pairs" what does that even mean?!
im not sure if its because this video is 5 months old or if i did something wrong but i cant connect radar yaw to the radar
is it an input???
So fancy
I have no idea why, but my Stormworks must be messed up. I followed the tutorial precisely, and my radar is pointed in a really weird direction, only detects one thing, and it's not lined up at all. It also doesn't show the distance properly, so not a clue why it's gone wrong.
This is Part 1. There should be more stuff to do.
You probably have your radar placed facing improperly.
You need to add the initial phase difference to the facing value passed into the script.
They change the radar, now, the radar does not recive imput, it only output angle of the dome, and the target data is given via composite, up to 8 targets, im not a programer, but so far manage to change the display so the line move with the radar angle (just ignoring the speed and angle part, and change the "a" for put an imput line in the "radarA" line.
We need an updated version 😞
the new update causes a tick error
Edit: Nvm i put con instead of cos
edit: when i tried to put y2 and x2 in table it gave me a syntax error for the equals sign if that is what is i can't tell my quality isn't super good
Can the radar be inside of the vehicle?
Yes
After an year of doing nothing, I've detected that Jersey don't know lua as much as we all here. He don't know about local variables and it is used to get rid of x1, x2, x3, x4, ..., xn in code. For example, x3 can be local x to get rid of 3.
what is math cos & haths sin?
Trigonometry to get the position and angle of the line.
For anyone wondering how to fix this Just make a composite input connect the composite info from your radar to your micro controller and then inside the micro controller just connect the Composite node with the lua script node
Will try just that. Have several workshop vehicles with that radar and they no longer work due to the update. This sounds like an easy fix.
@@LordKosmos did it work?
@@new_risk8341 ah, did not test it, I was able to just fix the old radar by changing the search radius (the angles) and it worked again.
this is great as ngl i have lost faith in radars recently as they seem odd
whyyyy do indexes ever start at 1
I can’t get it to pick up a target and I’ve been working on it for five hours😢😢😢 also this is my second video
It’s marking me hate my life
@@Dragon5432Hey no worries! Turns out this video is outdated as of maybe a year ago? I'm still learning how it all works too, and haven't found an up to date video yet. There is a Steam guide named 'Creating a Simple Marine Radar" which looks promising, but I'll reply back here if I find a tutorial/guide that works for the current stuff
My monitor is not turning on
Cool fireo ) (video)
looks like this needs an update again. now that the new dlc has arrived
I want that staff on russian; its too informal, to be without normal English subtitles at least
Alright, I’m done. It’s obvious this game is not for me 😂
i need help
Workshop >>
i still cant do it.. like how to find a target.. i copy all your codes in the lua.. awts the basic items needed? huuhuhuh
This tutorial is outdated
at least with the radars you can place
not working!!
Nice tutorial! Your code *communism music starts playing* I mean our code is looking good.
Loved this game up till this point. Taking calculators out to play a game is where I draw the line. If the combat was great it would be worth the hours these creations take, but the combat is horrendous at best. Love the idea, but they should of stuck with Search and Rescue and made a new game for fighting in my opinion! I think Radar should be a standard item, not something we have to literally create with code. Imagine having to code the defibrillator? I think this game would achieve a lot more success by making items like Radar automatically function by just hooking it to a screen. I cant tell you how bad I want to make military equipment to fight the AI, but realizing how poor the combat is, I can not dedicate the time to learn all this. If radar is this hard, how hard is targeting? Also the creations I have used with Radar and such, seem very touch and go. More do not work than do. I'm not trying to just be a downer here, It is just that all the weapons DLC are useless to me without radar and targeting systems, and I can not be the only one lacking the patience to learn that much for the sloppy combat as the reward. I learned to make a nuclear reactor function in this game, but the deeper logic stuff I am absolutely lost, and math is my best subject! It does not help that there is like no tutorial for the logic in the game. Thank gosh for you and your channel, you have taught me far more than the game is capable. Now to watch this video for the 5th time to see what I am just not understanding here!
For many of these more complex components, people create them and upload them to the workshop, you can just grab them from there and then plug and play them into your creations
You could make a simple radar which will still ping locations and distances without using lua. My weaponry is auto loading but I like aiming manually and having the radar as a guide.
New radars dont work it doesnt have radar yaw it has current rotation and it is output number
Annnnnd it looks like they got rid of the yaw position..
28:42
eh why not dowload a lua scirpt form the workshop easy as that :D
I have a map with radar.
i saw now
Jeez slow down for some of us non rocket scientists. I have to pause and replay this a bunch. And then try to save to find it didn't save my Lua script. Neato.
Alert Mr!!!!! this vid is outdated!! New radars and new updates already X_x
& maths sin?
Does not work
You'll have gone wrong somewhere. Easily done.
already outdated because of how the weapons dlc changed radars
Was wondering what I was fucking up here. I thought for sure I missed something and went back to rewatch it for a 3rd time
@@OutletVibes yeah, the second i noticed the radar couldnt receive an angle i remembered. In the radar update video he said it was easy to turn composite into that screen but i hope he makes another video on it
you can still do it with the new radars
@@freddo5677 How, mine doesn't work
@@freddo5677 how
Consider removing or renaming these outdated videos so people don't waste their time.
They work fine, nothing different
@@MrNJersey Its all deprecated radars on the workshop, I'm horrible at math and your radar doesn't work on the workshop side by side with others. I'm gonna need that new radar tutorial asap. thank you.
First
Shut up
@@nonnodacciaio704 lmao okay, someone's mad
@@prestonkeightley4700 nah it's just kinda cringe that people still write first on TH-cam in 2021
@@nonnodacciaio704 pretty sure that saying first originated in 2020-2021, so yea??? Besides, if you think something is cringe, you dont need to tell someone it is, then you just look like someone who needs attention desperately
@@prestonkeightley4700 lmao dude how old are you? "First" comments are as old as TH-cam
at 24:38 can YOU PLEASE stop that? "guys, justaquirquona" You have a horrible habit of trying to rush sentences especially your outro luckily you didnt do the outro like that this time. But its horribly cringey... "ok guys... if you like the ida m'sure you mash that like butondont orget tinkatha litil bell icon annnnd I'll see you in the next video"
Then don't watch his videos... The entire world isn't going to just stop for you.
doesnt work :(