PDA

View Full Version : How to Build a Sniper Rifle



Avocado15
11-27-2014, 10:13 PM
Hello! I recently developed a functional sniper rifle powerup for my level using the new Blaster Handle feature for Littlebigplanet 3. It's working so well that I thought I'd write up a tutorial so you can make your own! I apologize for having no pictures, so I will try to make this tutorial as clear and specific as possible. Enjoy!

Part 1: The Gun
1. Design what you want your rifle to look like. I won't help with this step, as the look of yours should probably be unique. However, it is recommended that you make it using the small grid so that later steps are easier.
2. Create a Powerup Pedestal or Sackpocket Pedestal somewhere in your level.
3. Attach a blaster handle to where Sackboy will hold on to it. At this point, you may want to go to the pedestal, capture the rifle so far, and use it as the Adventure Item. Then test it in Play or Preview mode to make sure the handle doesn't look awkward. There are also handles practically built for Blaster Handle weapons in the Equipment sections of the Goodies bag.
4. Go to the Lights section of the Tools bag. Select a Laser Light and put it in your level.
5. Tweak the Light's color and other properties. This will become the aiming light for your rifle, so choose wisely. For mine, I set the color to red, the brightness to 200%, the radius to 50, the fogginess to 10%, and high beam. The input should be on/off.
6. Attach an opacity tweaker to the Laser Light. Set this to 0% and the fade time to 0 seconds. Then dephysicalize the Laser Light.
7. Use the grid to reduce the Laser Light's size to its minimum. Then place it inside the gun on the edge of the barrel. Glue the Laser Light to the gun. Make sure the light is coming out of the center of the barrel. Otherwise, the aiming will be imprecise.

Part 2: Logic
1. Place an emitter on right on top of the part of the gun where the Laser Light is. Set the linear velocity to however fast you want, but I made mine 100 to be more realistic. Set Ignore Parent Velocity, Emit Once, the Lifetime to 1 second, the max emitted to infinite, the max emitted at once to 100, Destroy Oldest when Max Emitted Reached to yes, and choose your create/destroy effects.
2. Choose whatever you want the sniper rifle to shoot. Put a Microchip on it with an Impact Sensor, Destroyer, and Anti-Gravity tweaker. Connect the Impact Sensor's Output to the Destroyer's Imput. Choose the Destroyer's effect; Explode would probably work the best. Finally, tweak the Anti-Gravity Tweaker's Anti-Gravity and Zero Buoyancy to 100% and Damping to 0%.
3. Then save this object and put it in the emitter. Use the Grid to make sure that it is emitted right in front of the barrel of the gun and the exact same direction as the Laser Light's beam.
4. Open up the Blaster Handle's circuit board. Connect the Blaster Handle Trigger's output to the Laser Light's On/Off Input.
5. Place a Timer on the Blaster Handle's circuit board. Tweak the Target Time to 0.1 seconds and the Current Time to 0 seconds. The Input Action should be Start/Stop.
6. Place a NOT Gate on the circuit board as well. Invert its output. Connect the Blaster Handle Trigger's output to the inputs of both the timer and the NOT gate.
7. Place an AND Gate on the circuit. The Number of Ports should be 2. Connect the outputs of both the NOT Gate and the Timer to the two inputs of the AND Gate.
8. Connect the AND Gate's output to the emitter's Emit Once input.
9. Place a Sound Object on the circuit board and connect the AND Gate's output to its input. Change the sound it makes to whatever you want. This will be the noise the rifle makes when it fires.
10. Close the circuit board. Go to the Sackpocket/Powerup Pedestal, capture the newly finished rifle, and select it as the adventure item. Go into Preview or Play mode to test it out. If you built the sniper rifle correctly, you should be able to move it around with the right stick, hold R1 to aim, and release it to fire. If you used the grid and Anti-Gravity tweaker correctly, the bullet should go exactly where the light was aiming.

I hope this was helpful! If you have any questions then just let me know.

tdarb
12-01-2014, 07:33 PM
Interesting tutorial. It's a little hard to follow without some pictures, but I think I got the gist of it. Thanks for posting

Sean88
12-04-2014, 05:26 PM
Brilliant tutorial Avocado15. Well explained :)