Garry's Mod

Garry's Mod

52 ratings
[Wiremod] (Part 2) Intro to Wiremod : Extended Basics
By froggcore
Back with the second installment of my tutorial series! If you've already read or watched the first tutorial, I'm now going to show you how to advance with your basic knowledge and build upon it!
   
Award
Favorite
Favorited
Unfavorite
- PART 3 ARCHIVES RELEASED -
If you've wanted a more in-depth explanation of many of the different gates within Wiremod, I have released a nearly 8 year old write-up on just that! I currently do not plan on finishing Part 3, which ends with Vectors and beyond unfinished unless there is a heavy interest from all of you. Reach out to me if you have any questions. Please follow the link below to the final, Part 3, of the Intro to Wiremod guides:

https://steamproxy.net/sharedfiles/filedetails/?id=288806940

THE VIDEO (prob not gonna happen sorry lol)
Links
If you haven't seen my first tutorial yet and don't exactly know much about how Wiremod works, then I suggest you check it out.

If you need the mods I use as well, you should also check out my first video and get the links to them at the top of the page. I will always provide a link to every video before this one, and links to the next one at the end.

(Part 1) Intro to Wiremod : The Basics

(Part 3) Intro to Wiremod : The Basics

You will also need the Stacker tool for this video.

(Required) Stacker STool



Introduction : The Goal
If you've already read my first tutorial and have read in it's entirety to understand why Wiremod works, then I congratulate you. If you only read bits and pieces but already knew how Wiremod works, then I congratulate you as well. If you read bits and pieces just to learn how to make an elevator, or whatever you wanted to learn from it, then I suggest you go back and reread it. I'm not trying to be crass but if you don't understand Wiremod by this point in terms of how inputs and outputs work, then you will have a hard time learning anything beyond this point. It will only get harder, and the best thing you can do for yourself is have the patience to either watch and listen to me do it myself, or read through it and get the most meat out of what you are expected to be doing.

If you are at this point, have read or watched my video in it's entirety, and understand inputs/outputs, general mathematics and algebra and how 1 and 0 are the same as yes and no, and on or off, then you are where you need to be: here reading on about how to do more with Wiremod. Now time to get into this tutorial.

Oh, and don't expect a lengthy read either. I will only explain in detail what needs to be explained in detail, everything else will be short and sweet.
Tutorial 1 : Simple 2-Way Door
If you've been messing around with Wiremod at all, you might have tried making a door that uses a button and a hydraulic. When I showed you how to make an elevator with a button and a hydraulic, making a door work like that is not much different.

The only difference is that you probably want to access the door from both sides of your building you're putting a door on. If you just use regular buttons on both sides, if one is on, the other will not effect the hydraulic.

Think of it like this, two toggled buttons with On Values of 100. The Length input of a Hydraulic Controller is wired to the outputs of both buttons. If one is clicked, the hydraulic will receive 100. Since it's toggled, it will hold 100 until the button is clicked again. With this in mind, if we click on the second button on the other side of the wall, it will change nothing. Since the first button is already outputting 100, if the other button outputs 100 it will still stay open, and even if the second button is off it won't change.

As simple as this seems, it's a problem that needs more work than just using buttons: we need to improvise.

If you want a way into a base, you're going to want a way out also, most likely through the way you came in. There is a simple fix for this, and before we explain any thing we'll create a frame for our door.

The Frame

First, spawn a 2x2 metal PHX prop from the General tab. Now this is required and I put the link to it at the top if you haven't grabbed it already: we're doing to use the Stacker tool to quickly give us 3 straight and aligned props.



Get it out and look at your 2x2 plate. Hold Q and look at the options. You want to make sure that where it says "Relative to" we have World enabled. It will depend on where you're placing your door what direction it will recognize. We want 3 of these plates to be next to each other so that they form a "2x6" plate. Before you use the tool, make sure weld is unchecked, freeze is checked, and no collide is unchecked. (We will want to only make one of these props no collide later)



Now click on the 2x2 prop and it will duplicate it to the right of it, now look at the new prop you just made and click again. You now have 3 2x2 plates next to each other.



My original draft for this tutorial was to make a ball socketed upside down draw bridge type door, but I decided that it's a little finicky for this so we're going to make a basic sliding door design.

Center yourself so you are looking at the middle plate. This is the plate that will function as the door. Go grab the no collide tool, and no collide the door plate to the plate to your left of the door. Do not unfreeze anything. Now get your slider tool, and look at the top left of the door. (Still standing where you were before) This is best done with SmartSnap, since anything inaccurately placed will have, for a lack of better words, glitchy consequences. Click once on the very end of the top-left of the door, then left click again on the top-left of the plate you no collided the door to. Still, do not unfreeze anything.



Now we should have a working frame for a door. This version will be easy for you to save and use later. All we have to do now is attach the wire components.

What You Need:

  • 1 Add Gate
  • 1 Toggle (Edge Triggered) Gate
  • 2 Buttons (Non-Toggled)
  • 2 Hydraulics (Controllers Included)
  • 1 Constant Value (Two Values: Value 1 = (95) Value 2 = 5)

Add gate

The Add gate does exactly what it says, so this won't be a very long description. It has 8 inputs, meaning that it adds up to 8 things together and whatever the sum of those inputs is, is it's output. We will be using this for the two buttons, since if you add 1 to 0 it will output 1, and so forth.

Toggle (Edge Triggered) Gate

The Toggle (Edge Triggered) Gate is a type of gate that toggles between two values, similarly to how a button works. The advantage of these is that they cannot be interacted with by players, and can have other devices modify them.

With all of that in mind, it's time to put stuff down.

Wire Stuff

We're going to be putting all of these gates on the right plate, since nothing will be sliding inside of it and it's a bad habit to place wire components on moving parts because it causes lag and can sometimes glitch out of control.

First, go to the Wire - Control tab, go to Gates, and go to the Arithmetic folder. Select the Add gate and spawn it down. Next, go to the Memory folder and click on Toggle (Edge Triggered) and spawn that down next to the Add gate.

Now go to Wire - I/O and look for Constant Value. In here, we need two values, so on the slider, change that number to a 2. Change the first value to 5, and change the second value to 120. Now spawn the Constant Value somewhere near your gates.

Now we'll need two buttons so you can actually open this door. Near the Constant value, go to the Button tool. Make sure toggle is off, and that Value On is 1 and Value Off is 0. Spawn one button on the side with your gates, and another button on the opposite side of that plate. (think of a doorknob, one on one side, one on the other)

Go to your Wire Hydraulic and we're going to create it similarly to how we created the slider, except do this to the bottom. Make sure that fixed is unchecked, since the slider above already functions as the main sliding component in this device. Click once on the bottom-left of the door and on the bottom-left of the plate to it's left. Place the hydraulic controller somewhere near your gates for ease of access.



If you placed the hydraulic exactly how I did, it should be extended at 95 by default.

Time to Wire! (I will be doing the wiring in a list like this for now on)

Wire:

  • A of Add --> First Button (Out)
  • B of Add --> Second Button (Out)
  • Clk of Toggle (Edge Triggered) --> Add (Out)
  • OnValue of Toggle (Edge Triggered) --> Constant Value (95)
  • OffValue of Toggle (Edge Triggered) --> Constant Value (5)
  • Length of Hydraulic Controller --> Toggle (Edge Triggered) (Out)

Unfreeze your door and try out the buttons. If you press one, it should open, press it again, it should close. Now try opening it from one side, and closing it on the other. If you can, you're done!



If your door goes backwards through the plate you no collided with, place something behind that plate so the door doesn't have a chance to go backwards.
Tutorial 2 : Automatic Doors
Before we make this, use Advanced Duplicator (or regular Duplicator if you didn't download it) and save your two-way button door you made. If you didn't make that and are reading this without having made that door, then read above only to the point where I show how to make the frame and adding the hydraulic.

With your original saved, use your remover tool and carefully remove everything but your Constant Value and your Hydraulic Controller. We don't need any of those gates, or buttons. What we will need is something you have not used yet, but have probably heard about: it's called a Target Finder.



Target Finder

The Target Finder does exactly what it says it does, and this is how we'll be making an automatic door. Fortunately for us, target finders have the ability to output a value of 1 if it has a target. With an array of options to use, we will only need it to target players and we will have to set the max distance to only so far.

We are going to take advantage of this, and use it with a Multiply gate to tell the hydraulic when to extend or not. However, if you think about it, if a player walks within the range of a target finder and it outputs a 1 and multiplies by something, wouldn't it just close instead of open? Yes, it will do that, so now we need a way to invert the on signal. The easiest way to do this is to use a gate called a Not gate.

Not Gate

This is found in the Logic section of your Wire Gates, and there are some useful gates you can use in here. Gates such as OR and AND are my most used, as well as Not. For now we're just focusing on the Not gate. It outputs 1 if the input is 0, and outputs 0 if the input is 1. It can only take 1 and 0, so don't expect to throw a 2 in there and expect something else. It would not make any sense.

Construction

Make sure that your target finder settings match to mine. Your Maximum Range should be 400, Targets should be 1 and Bogeys should be 10. (Doesn't matter what amount but 10 is a fair amount to use for this) Also make sure that below the check boxes are nothing but Target Players. You can optionally make it color targets at the bottom, but it looks stupid with something like a door so you can leave that unchecked.



Spawn a Target Finder on the ground and position it as well as you can so that it's in the middle of the door, but not inside of it, just in front of it slightly. Weld it to the two side plates, NOT the door.



Next, go to the Hydraulic Controller on the right and spawn down a Multiply gate from the Arithmetic folder, and a Not gate from the Logic folder.



Wire:

  • A of Not Gate -> Target Finder "1" (Out)
  • A of Multiply Gate -> Not Gate (Out)
  • B of Multiply Gate -> Constant Value (95)
  • Length of Hydraulic Controller -> Multiply Gate (Out)

(Last bullet was added because somehow I forgot to, thanks for letting me know!)

It should now open if you walk within 100 units of the door and close when you're farther than 100 units of it. Just to make it look nicer, grab the color tool and slide the transparency (alpha) slider down to the lowest it can go and click with it on the target finder. It will be invisible, and it is almost as if it was never there. You're now finished and have successfully made an automatic sliding door.





In conclusion...
What you can take away from this is that you now know:

  • What a Not gate does
  • What a Target Finder does and can do
  • What an Add gate does
  • How to make a two-way button door
  • How to make an automatic door

This is a short tutorial that just gives more insight into ways to use simple parts of Wiremod. You can expect more things to come that use target finders, and these types of gates.

I have recently decided that I will continue making tutorials with the "Intro to Wiremod" for a while until I have decided that I have made enough guides that explain the fundamental parts and how to use them. Once I have finished, I will start making tutorials that show people how to make specific things. The things I make in THESE tutorials are examples, and are just to show how each part of Wiremod works the way it can, but not their only way.

Experiment! Experiment! Experiment!

The only way you will be able to develop a taste for Wiremod yourself is if you experiment by yourself with things and see what things do when you connect certain things together. Also don't forget to ask others for help.

If you felt something was confusing, or just want more help with this or anything Wiremod related, send me a friend request and let me know you're asking for help and I would be glad to help you out.
Next Time...
Next time I will be advancing with the idea of target finders, and it will be a quick tutorial going over how to make types of security systems with target finders, and a new piece of equipment not yet mentioned, the Ranger.

There will not be a video for this tutorial, or any tutorial after this until I have my new computer and the money saved up for it. Videos record terribly with this computer so I apologize for the inconvenience if any of you prefer visual or audible learning.
28 Comments
froggcore  [author] 18 Apr, 2020 @ 9:24pm 
No
(X_0) NAHJ G○D M0DuL3 1 Jun, 2019 @ 6:32am 
Next guide?
Shirosaki 14 Aug, 2017 @ 12:46pm 
Great guide, although I don't think there was any reason to use a NOT gate for the automatic door. The target finder will always output 0 as long as you're out of range, which translates to 0 units of hydraulic extension when you run it through the multiplication.
H I M 2 Aug, 2016 @ 10:08pm 
cant you just use xor gate
Fancehh 13 May, 2016 @ 2:27am 
How about lights?
Woa 2 Feb, 2016 @ 10:17pm 
Wait, hoverballs. They would work
Woa 2 Feb, 2016 @ 10:17pm 
Sorry, I don't know :/
phillyphresh215 2 Feb, 2016 @ 4:01pm 
This probally has nothing to do with this thread but I'm wondering if I could make props move back and fourth or up and down for printers. I know the user things and I just need help making props go back and foruth please help. Thanks in advance
Woa 23 Dec, 2015 @ 8:54pm 
ARRRGH
Woa 23 Dec, 2015 @ 8:54pm 
fix