Beginner Guide to Logic Components - Tutorial - Stormworks

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everyone and welcome to a full beginner's guide on logic component blocks here in stormworks in this video i'm going to be going through every single logic component block that we have here in stormwix as of version one now as you can see here in front of me we've got them all laid out each one of these have either got a number input represented by green or it's got a on off input represented by red they've also got outputs once again green represents a number output and red represents a on off output now we're going to go through every single one of them i'll tell you how they work how you can change them and i'm also going to show you an example of every single one of these so let's get straight into it and let's get started so the first logic compliant block that you'll find in your inventory is called an abs and abs will always output a positive number for example if we were to give the system a part number of 5 it output number 5 here if we were to go and change that to a negative 5 this will also go and output a 5 value it always outputs a positive number the next thing we have is something called an ad block this takes two number inputs and output one you can take let's for example say two add it to two and we will get four okay so simple equation here of adding the next one we have is something called an n block this takes two on and off inputs and outputs one on off this will only output if both of the inputs are true for example if we only have a it will not output anything if we only have b it won't output anything as soon as we have both of those true it will then only send true on on signal heart of it the next thing we have is something called a blinker the blinker will go and take an on off signal and will then go and send it out but it will go in turn it on and turn it off turn it on turn it off in a blinking fashion you can actually click on the blinker and change the settings for this see i've gone and set it to 0.5 seconds on and 0.5 seconds off so we're going to turn it on it goes and blinks on and off very good for creating sirens or any type of light system here in stomachs the next thing we have is something called a capacitor capacitor has two sliders one for charge time and one for discharge chime so for example i've gone and set this to 0.5 seconds to charge and one second to discharge meaning that i have to give it at least a 0.5 on in order for it to get something and then it will discharge that for at least 1 second once again you can click on it change it i'm going to hold this down for 0.5 seconds you'll now notice it outputs it for one second there the next thing we have is something called a clamp this allows you to go and set a range of a number for example i've gone and set this to 1 to 10 so if i was to give it a 5 number it would output 5 however if i gave this 55 it would only output 10 because that's the maximum number i told that it can go out because i clamped it between 1 and 10. the next thing we have is a constant number click on it change the value and then ask for that number this is very good for maybe controlling pivots or any type of creation where you're doing some decoration very useful you have a constant on signal this will constantly always send an on signal out once again very useful if you want all your lights to always be on or you always want your engines to always be on etc that's very useful the next thing we have is something called a counter this will literally go and count all the way up to an unlimited number now how fast it counts is what you can control using the input of the number so for example if i go and say count at every second it will literally go and count one second at a time okay as you can see here going up and up and up and up it'll continue going unless you give it zero okay so if you were to go and change that to zero it stops counting if you wanted to count quicker go and increase it now you can see how quickly it's counting okay so you can change that to whatever you needed to the next thing we have is something called counter ping pong works exactly the same as before the only difference is the maximum we can go is one and then the minimum it can go is negative one and a ping pongs or jumps back and forth between one and negative one at the speed you choose so if we were going to tell it to jump that speed at 0.01 you'll notice it goes up to 1 goes back down to negative 1 goes back to 1 and then goes back to negative 1. if you want to change the speed and how quickly it does that once again increase the speed and you'll see how quickly now it's going back and forth the next thing we have is something called the delay this will take an on off signal wait for a certain period of time i think it's maximum 10 seconds and then it will go out and send an on signal so for example i've set this to one second so once i click this button it's going to wait one second then it's going to send it out and there you go i let go and it's still holding it for a second and then it's not sending it out anymore so just a simple delay the next thing we have is divide so first off a divide block you can take any number and divide by another number so for example we wanted to divide ten by two okay it's going dividing it and it's giving us five however it also goes and outputs an error so for example if i was to try and divide zero by zero it would give us nothing and would give us an error message here okay so that is quite useful you don't have to use the art for the error but it's up to you along with that we have a function function blocks both of these here which we'll talk about in a few seconds are very very useful components this can take one number then do something to it and output a new number so for example i've got this function block to go and times it by two so whatever number i give it five it's going to go and times by 2. you can do anything so you could do this for your speed for example you want to take meters per second and calculate it to knots etc you can use that maybe you want to take a altitude which is in meters you want to convert it to feet you can do that too very useful along with that we then have a function three inputs this allows you to take three numbers and then send out one number so for example instead of using that clamp there i could actually use this function block and say take one number and clamp it between a and b and then output a number at the moment i've got it to add all three of these together so for example two plus five plus 3 should give us 10 and there you go it's all working in that nice little function block the next thing we have is something called greater than this will output an on signal if one number is greater than another number so for example if 5 is greater than 2 it outputs an on signal if 5 is greater than 10 which it's not it will not output a on signal the next thing we have is something called a jk flip-flop this will always output an on signal but it depends on which channel it outputs that on at the moment it's outputting it on the off if we were to go and set it it up puts it on the on okay so it's got two different channels on here both on offs and you can keep on setting it we'll stay to the left if you reset it stays to the right the next thing we have something called a less than very similar to the greater than the only difference is now it's measuring if number a is less than number b yes it is what happens if it's not it doesn't output anything okay so two number inputs one logical one off out the next thing is we have a memory register memory register is something to go and store a number so for example let's say 125 we can tell it to set that number it now outputs 125 and we can change that number to anything we want it to and it will still output 125 because that's what we set it to remember you can of course go and clear that number and it goes back down to zero you can reset it again and it goes to whatever number you have for example my keypad okay so you have options there just remember that when you are doing this that you can clear it and you can set it as many times as you want to okay so and you can also click on this and you can change it to what you want it to reset to the next component we have is something called a modulo modular will go and take two numbers and divide them by each other okay so for example we'll take a and divide it by b and then it will give you the remainder out into a number okay once again up to you if you want to use this one the next one we have is something called multiply this one you can go and take let's say 5 multiplied by 2 and you will get 10 as your number output okay once again you could do the same thing using a function block but you can also have using the multiply blocking game along with that is we have a knot block this will go and take a logical on off and it will give you the opposite of what you want so for example this is not on but the light is on if i turn this button on the light is not on so it gives you the opposite okay not the next one we have is a numerical inverter numerical inverter will take any number you want and invert it so for example if we were to give this 5 it would give us negative 5. if we were to give this negative 5 it would give us five okay so always give you the opposite in the value the next component we have is something called the numerical junction what this does is it takes one number input and then either sends an out on a or sends it out on b depending on what you have for the switch okay so for example if we were to give it five it would currently send it out on the off channel if we turned it on it would send it out on the on channel and it switches them back and forth a very good use case for this is maybe if you wanted to try and in your plane you wanted your a and d to control let's say your role but when you click a button you wanted your a and d to control let's say your tail at the end your rudder that you have at the back your plane you could simply switch this and say okay well now we want our amd to go to the back or unturn it off and now it's going to go and control the roll okay so this is very useful to use a junction the next thing we have is something called the numerical switch box this is very similar to the before however it takes two number inputs and then we'll only send out one of them depending if the system is on and off so for example we can give it a on value of five an off value of two currently this is off which means it's outputting two if we turn it on it outputs five okay because that's the number we gave us on once again very common to use that and see that the next component we have is an all block and all block will take two on and offs and output one on and off it doesn't matter which one of these are on it will always output something for example if i turn this one on it goes on if i can turn the other one on it goes on if i turn both of them on they're on because i'd always send something through if any of those inputs are positive the next thing we have is something called a pid controller or a pid controller now these are usually quite complicated to use i've got a very simple example just here in front of me i've got a simple little pivot and the pivot can tell me what angle it's facing so at the moment it's facing angle a pid controller is an easy way to go and read a variable and tell it to go to a set point so for example this is at zero i want it to be at 0.3 so i'm going to go and tell it i want you to be at 0.3 it's now going to see what the difference is between those two and it's going to go and tell it to go to 0.3 and once it gets to 0.3 it's going to stop okay we can of course go and hover over it by pressing page up and you can see the current rotation two point nine nine nine nine nine nine etc so now if we wanted to come back to zero we can simply go back to the set point with this on zero and you'll notice it's now going and turning until it reads then it gets back to zero okay so pid is a very very very strong component logic block that you can use as it takes a little bit of tweaking to get it to work but once you get the hang of them they are very useful here in game along with that we have something called a push to toggle if you push a button it toggles something on and will stay on until you push it again okay so this is very useful now we do have toggle buttons and game plus push buttons but there are some use cases where you might want to push something and leave it on always and then push it again and then turn it off the next thing is we have something called the sr latch very similar to a jk flip-flop however this one you can actually go and set and then you can reset it so for example i want to say turn on it will now go and send constant on signal there and i just pushed it it's going and sending a constant on signal and then i can reset it again then it's not sending anything out set it again send something out and so on so these are very useful once again the next thing we have something called subtract takes one number and subtracts it by another number it gives you an output okay very simple just equation there the next thing we have something called a threshold gate this is another very very common thing to use here in game threshold gate will take a number input let's say 100 okay and it will then go and read that to see if it is within a certain range if it is within that range it will go and turn the light on at the moment i've clicked on this and set it to five to ten so if i give it a hundred it doesn't output anything but let's say i give it seven or six it goes in half percent on value as soon as i bring that back out of the threshold it doesn't output anything anymore it's very useful uh trig you can click on this change whatever your cost tan syn etc inputs a number and then it will go and do the equation and give you the balance out okay along with that we also have an up down counter up down counter is once again very useful here in game you can click on it change what the maximum minimum is okay and you can also go and change the sensitivity you'll notice it's currently at zero and i can use the on offs or the ups and downs to increase that there we go increasing it decrease it please and now it's bringing it down it's kind of like using a seat but instead you've got buttons that can go and do up and down or forwards and backwards and going on to the last one which is the zor okay or xor depending on how you want to pronounce this now this will go and output a value as long as the other one isn't on if both of them are on it will not send anything out if both of them are off it will not send anything out it's only allowed to have one of them on to actually send something through okay once again quite useful so ladies and gentlemen that is all of the logic components here in game that you can find in your inventory we will be doing a follow-up video to this where i'll be going into the microcontroller editor or the microprocessor editor and i'll show you how to build one of those and go through all the different components inside there hopefully this video has been somewhat entertaining and informative as always if it has don't forget that like button and maybe hit that subscribe button if you want to follow any of my future content so until the next one we will see you [Music] then you
Info
Channel: MrNJersey
Views: 25,358
Rating: undefined out of 5
Keywords: Stormworks, update, news, major, next, island, map, area, snow, mountain, land, friday, improvements, thumbnail, screens, monitors, radio, camera, lua, code, script, laser, distance, shark, megalodon, attack, bug, electric, battery, winch, cable, fuel, space, space engineers, seats, car, racing, pipes, rails, sonar, radar, new, audio, link, BASE, spawn, new game, game, wedges, slope, winches, connector, rope, logic, node, modular, engines, guide
Id: KIsqyB_waOE
Channel Id: undefined
Length: 16min 40sec (1000 seconds)
Published: Wed Mar 17 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.