22
8/9/2019 Logic Tutorial 1 http://slidepdf.com/reader/full/logic-tutorial-1 1/22 Tutorial 1.1 - Your First Logic Network By rtm223  In the Beginner Pack, we demonstrated how including a few basic logic switches in your level can greatly improve its quality. This was especially true in the final room, where we showed how our logic switches could be combined in a "network" to create complex puzzles and contraptions. Often, single logic switches aren't enough to achieve a specific goal, and it becomes necessary to wire logic switches into other logic to achieve your goals. The goal of this tutorial is to create one of these basic logic "networks" in order to (hopefully) help you understand the principles of combining logic with other logic. First off, create a new level on your moon and pause the physics. Doing so is important to make sure nothing runs off on you or otherwise behaves in a way that we would want to avoid. You should only unpause your level when you need to observe something in action - otherwise, to be safe, keep it paused at all times.

Logic Tutorial 1

Embed Size (px)

Citation preview

Page 1: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 1/22

Tutorial 1.1 - Your FirstLogic NetworkBy rtm223 

In the Beginner Pack, we demonstrated howincluding a few basic logic switches in yourlevel can greatly improve its quality. Thiswas especially true in the final room, wherewe showed how our logic switches could becombined in a "network" to create complexpuzzles and contraptions. Often, single logicswitches aren't enough to achieve a specificgoal, and it becomes necessary to wire logicswitches into other logic to achieve yourgoals. The goal of this tutorial is to create

one of these basic logic "networks" in orderto (hopefully) help you understand theprinciples of combining logic with other logic.

First off, create a new level on your moonand pause the physics. Doing so is important

to make sure nothing runs off on you orotherwise behaves in a way that we wouldwant to avoid. You should only unpause yourlevel when you need to observe somethingin action - otherwise, to be safe, keep itpaused at all times.

Page 2: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 2/22

 

Build a base for your puzzle room aspictured above. Make the floor three layersthick and quite wide (you want to give yourplayer room to move around). Make the backwall 1 layer thick and glue it to the base.

Page 3: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 3/22

 

Next, plop down two sponge blocks, whichwill be used as the key elements of thepuzzle. Make them 4x4 small grid squares insize and place a magnetic key in the centre,as shown. Move these out of the way a littlebit and then create some platforms to play in.

Page 4: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 4/22

 

As you can see, the platforms have smallalcoves cut into them. This is where theaforementioned blocks will need to be placedto complete the puzzle. Be sure that thesealcoves are at least 4x4 small grid squares,in order to accommodate the blocks.

Page 5: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 5/22

 

Glue these platforms to the base and placethe cushions on the platforms, one on eachside. In each of the alcoves, place amagnetic switch near the centre. If you're aperfectionist, the grid tool is perfect forgetting these switches in the exact centre ofthe alcove, so be sure to use it.

Page 6: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 6/22

 

In the tweak menu, set the radius to be quitesmall (as indicated by the white circle in theimage) and set the magnetic switches todirectional. This is very important, as we willbe wiring these magnetic switches into somelogic in a minute.

Page 7: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 7/22

 

One thing that you can do here is to shrinkdown the size of the sponge blocks a tiny bit,so they can fit into the holes a little easier. Italso stops them getting stuck and breakingyour puzzle. As you can see from the imageabove, it's only a small change but it makesthe puzzle a lot less fiddly for the player. Youwill need to turn the grid off to complete thisbit, so be sure to turn it back on once you'redone.

Page 8: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 8/22

 

Now comes the fun part - we're going tofinally place some logic! We need a logicswitch that will activate when both of themagnetic switches are activated, whichmeans an AND switch. The AND switch fromthe Beginner Pack is pictured above. If youhaven't already picked up an AND switchfrom the Beginner Logic Vault, then you willneed to go grab it before you can completethis tutorial. While you are there, it's probablya good idea to capture all of the logic so youhave it available at all times while creating.

Page 9: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 9/22

 

Place the AND switch on the back wall so it'svisible, but don't glue it - the dark matter willkeep it up. Normally, creators place theirlogic out of view, but while you're testingyour creations it's very useful to see what thelogic is doing, both for visual confirmationand to help nail down bugs (if any exist).Connect wires from each of the magneticswitches to one of the pistons in the ANDswitch.

Page 10: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 10/22

 

At this point we can test that the logic iswired up correctly and behaves in the rightway. Change to play mode and drag thesponges into the holes. The magneticswitches in the holes should make thepistons extend and the AND switch shouldactivate its magnetic key when both pistonsextend, like the picture above.

Hopefully this test has been executedsuccessfully, but if not, try checking that:

•  The pistons in the AND switchare set to stiff and are notbackwards.

Page 11: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 11/22

•  The magnetic switches in theholes are set to directional and are not inverted.

•  The green magnetic keyswitches have large enoughradii to detect their matchingmagnetic key.

•  The AND switch is not glued tothe back wall.

Once it works as it's supposed to, you canmove on to the next portion of the tutorial.

Page 12: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 12/22

 

Now the basic puzzle is done, we need areward for solving the puzzle. In this case wewill keep things simple and simply have thepuzzle open a door. Create an upside downU-shape as shown above. To keep thingsneat and "machined", keep the small grid onwhile you design this bit. Glue this piece tothe back wall.

Page 13: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 13/22

 

Add the door, and connect it to the U-shapewith a piston. Make sure the piston is stiff and set so that the maximum length is longenough that it extends to the floor. Be carefulhere! If you make the maximum length toolong, you risk breaking pieces of your level,so only make it as long as absolutelynecessary!

Page 14: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 14/22

 

Now change the minimum length tosomething very small, so the door can beopened, and set the timing to around 1.5s.Now go back to the AND gate and set thatmagnetic key switch to directional. Connectthis magnetic key switch up to the pistoncontrolling the door. Finally, set the doorpiston to backwards, so the door staysclosed until the puzzle is solved.

Page 15: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 15/22

 

This should be a completed, working puzzlefor your level. Go into play mode and testthat it works. Again, if anything isn't workingproperly, check that the switches andconnectors are tweaked correctly, andnothing is glued where it shouldn't be.

Technically speaking, this isn't a logicnetwork yet, as we have only used a singlelogic switch. Rather than stopping here,we're going to incorporate a "give up" buttoninto the mix, which will allow the player toskip the puzzle if they desire. For thepurposes of this puzzle, the idea of a "giveup" button is rather silly, but it's a nice way toexplore how a logic network can be used .

Once you have a firmer grasp on logic

Page 16: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 16/22

networks, you could include some sort ofpayout for correctly solving the puzzle (scorebubbles, perhaps!?). Here, our "give up"

button will just serve as an alternative way ofopening the door. Anything beyond this is upto you.

Make a copy of the existing scene and placeit over to the right of the version that is

already there. Once you have done this,place a button on a wall, out of the mainpuzzle area (so your players can't trigger itby accident). Tweak the button todirectional.

Page 17: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 17/22

 

Now get an OR switch from the BeginnerPack and place it next to the AND switch youalready have on the wall. The picture aboveshows what the 2-input OR switch looks like,if you have any doubts.

Page 18: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 18/22

 We need to wire up the OR switch as shownabove. Disconnect the AND switch output

wire from the door and reconnect it to one ofthe pistons in the OR switch. Then wire thegive up button that you have just placed intothe other piston of the OR switch. Note thatthe wires connected to the AND switchpistons are not shown. This is just for clarity -

do not disconnect those wires in yourversion!

Now take the output of the OR switch andwire that up to the door. Remember to setthe output of the OR switch to directional.

Go into play mode and test the new give up

Page 19: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 19/22

button. It won’t actually work, but don’t worry,it’s all part of the lesson. What you shouldsee is that when you press the button, it

triggers the OR switch. This in turn will makethe door open. However, as soon as thebutton is released, the OR switchdeactivates and the door closes again.

What we need is a way to ensure that the

door stays open permanently once the giveup button is pressed. The permanent switchfrom the Beginner Pack (shown above) canbe used to achieve this.

Page 20: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 20/22

 

Note that some of the wires are not shownagain in this image, but remember, that is forclarity - in our tutorials, you should never detach wires unless expressly told to do so.Place the permanent switch next to theexisting logic. You will need to wire thepermanent switch in between the give upbutton and the OR Switch. First, disconnectthe wire from the give up button to the ORswitch. Tweak the permanent switch to bedirectional and wire it to the OR switch asshown above.

Page 21: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 21/22

 

Now tweak the give up button to eitheron/off or one-shot (both have the sameeffect on dissolve material) and connect thewire to the dissolve of the permanent switch.The puzzle should be complete with aworking "give up" button now. Change toplay mode and ensure that it works bothways - both with the newfound give-upbutton and the actual solution.

Everything should work as advertised now! Ifyou're still having issues, check that:

•  You haven't inadvertently gluedyour logic to the back wall.

•  None of your logic's magnetic

keys are interfering with other

Page 22: Logic Tutorial 1

8/9/2019 Logic Tutorial 1

http://slidepdf.com/reader/full/logic-tutorial-1 22/22

magnetic key switches. Bydefault, our key switches havetheir trigger radii tweaked for

minimal interference, butregardless, try to give the logica little breathing room.

•  None of your logic physicallyinterferes with any other logic.In this network, the pistons on

the OR gate need space toextend. More space thannecessary is much safer thannot enough space.

•  None of your magnetic keyswitches are set to on/off 

when they should bedirectional.

The easiest way to troubleshoot a logicproblem is to watch it in action. If you canpinpoint the source of failure, fixing it will bemuch easier. This will get easier as youunderstand how each logic gate is meant towork, assuming you haven't got it figured outalready!

Trouble Shooting