Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Firing a Charged Up Blast

Archive: 10 posts


I've created a sackbot whose similar to Megaman. He shoots in both directions and if you hold down the shoot button he'll start to charge up a mega blast. The blast effects are awesome. The way it works is, you have to hold down the shoot button for 2 seconds before the blast is ready. And to fire the blast just simply let go of the button. This is how I did it:

1. Hook up the left analog thumb stick, left/right into a direction splitter.
2. Then I hooked both outputs of the splitter into a 2 port selector.
3. Then I put two and gates onto the microchip.
4. I then plugged both outputs of the 2 port selector into one input of each and gate.
5. Then I placed two timers onto the microchip.
6. I then placed two additional inverted and gates on the microchip
7. I plugged the first two and gates into the two timer outputs and resets and one input of each inverted and gate.
8. I plugged the output of each timer into the other input of each inverted and gate.
9. The inverted and gates are then plugged into the emitters for the charge blast.

I can shoot in which ever direction I'm facing and it appears to work perfectly. But the problem is, when I complete charging the blast and still have the shoot button held down and I turn in the opposite direction, the blast fires automatically without me letting go of the shoot button. It's not supposed to fire unless I let go of the shoot button. But when I turn the opposite way, it registers as me letting the button go and fires. I would like to hold the button down for as long as I want and not fire until I let go of the button. Can anyone help me with this? Does anyone have a better way of doing it? I know it's a long thread, but I've been trying for hours to fix this problem.
2011-02-18 07:09:00

Author:
rambo3416
Posts: 179


you will need to have the firing mechanism completely sepperate from aim (any form of analogue input from left or right sticks)

Best way to do this is to have an invisible piece of hollo follow the sack bot. Make the holo, 1 small grid big, on the thin layer behind the bot, have the holo twice as tall as the bot. On the bottom of the holo place a follower unit, place a tag on the sackbots chip and make the follower unit follow that tag.

Next at the 'top' of the holo, place a chip and in the chip place a joystick rotator, attatch the rotator to the left/right > up/down inputs of the left stick.

Next place an emitter in the chip and have it emitting whatever projectile you are using. Don't plug anything into the mitter yet.
You now need to re-create the logic you made for the 'charge' mechanism and keep it completely seperate from any form of directional input from the left or right sticks. Plug this logic into your emitter, It needs to be in a charge state when held, and release when let go, no other signal should interfeer with this process.

How you have it, the AND gate input from the current direction is allowing you to keep a charge, when you turn, the directional input is releasing from the AND gate input, the logic is no longer recieving adequate inputs, the circuit is broken and the charge releases.

Are you able to get ingame, like now or soon? It would be better if i came in game and helped you out. I enjoy solving little pickles like this

Check my Sig below for details.
2011-02-18 08:35:00

Author:
Epicurean Dreamer
Posts: 224


Another way to do it, that wouldn't need follower holo, is to make one of the conditions for firing a charge shot a counter set to one. For the right-firing charge shot, wire positive horizontal input to add a point to the counter, and wire negative horizontal input to the reset. Do the reverse for the left-firing charge shot. Now if you face one way, charge the shot, then turn, the counter resets and the conditions are no longer met to trigger your emitter.

Or, simplify it even further and make it work even better: make one of the conditions for each charge shot a NOT gate. Wire negative horizontal input to the NOT gate for right-firing shots and positive horizontal input to the NOT gate for left-firing shots. That way you can't fire if you're pushing in the opposite direction as the way you want to fire. It's four in the morning so I might not be thinking clearly, but I believe that would also let you "conserve" the charge while facing one way and then fire it when facing the other, so you could face right, charge up the shot, and then turn left and shoot it.
2011-02-18 09:00:00

Author:
Speed Racer
Posts: 156


played around a bit and came up with this:

http://i7.lbp.me/img/ft/ef75d1ac392ac9fd2e9349f7d874ab888cd472c0.jpg

It shoots a 'small' projectile from a single press of the 'fire' button, it can be linked to whatever button you wish.

If the same button is held down for 2 seconds it 'charges' a larger projectile and once 2 seconds has passed once the button is released it fires the 'charged' projectile. The sackbot will retain the 'charge' indeffinately untill the button is released.

If the button is held down instead of pressed but NOT held down for long enough, the charge is 'lost' and the player will have to press and hold for a further 2 seconds to attain a charge. This is intentional, plus it keeps the charge mechanism in sync for the two seconds build-up. Its possible to remove it though if its not to your taste.

You can rapidly press the fire button for a 'rapid fire' style thing, firing smaller shots, or you can hold the same button down to charge up a larger more powerfull shot.

The entire shooting/charging mechanism works regardless of which direction the sackbot is facing. It's currently set up to aim via input of the left stick, which will also be the same direction sackbot is running, except more acurate to the 'actual' angle of the left stick.

You can run one way, charge a shot, aim back the other way and let the shot off... so on and so forth.

Also with a tiny bit of really quick and easy re-wiring the aiming mechanism can be customized to exactly how you want it to work. For example, have this aiming system in place, yet have the right stick overide the shot direction if its used, only for the base aiming system to re-take control when the right xtick has been let go. so on and so forth.

the emitters for standard shot and charged shot are, well, emitters, so you can place whatever you want in each to act as the standard and charged shots.

It is also possible to add further logic within the system to create sound effects and charge animations e.t.c., if this is what you have created already in your design, its possible to port it across and integrate it no problem.

Hope its what you're looking for.

I'de be happy to pass it over to you and explain to you in more detail how it works and how you can customize it and such. Come find me in game, PSN is in my sig.
2011-02-18 10:42:00

Author:
Epicurean Dreamer
Posts: 224


Hey guys I appreciate all the responses. Sorry for the slow response. I'm in the U.S., so while you were writing this, it was like 3 A.M here. I will try out these methods to see which one works best. Eupicurean Dreamer, I am now playing the game if you still want to join.

Eupicurean Dreamer, I really appreciate what you did. I tried it out and it worked perfectly. Man, I was trying to get this for hours. Thanks a lot. The attempt I made worked exactly like this, except for the problem I explained above. Now it works exactly the way I intended.
2011-02-18 14:17:00

Author:
rambo3416
Posts: 179


no problem atall man. I'm always up for helping out a fellow happy gadder

I'm glad it worked out for you. Sadly i'm not able to get in game at the moment, I'm not at home.

I'm still up for passing you this over if you want to take a look at the 2 state trigger mechanism for the single button. (i'm quite chuffed at the design actually, came up with it on the fly while experimenting). I've saved the contraption to a crator incase you wanted it.

I'll possibly be on later on tonight, I'm GMT time so for you it'll be your time +5 hours (if you're PST, i believe). Around half 8, 9 GMT.

catch you round, and keep on gadding
2011-02-18 15:47:00

Author:
Epicurean Dreamer
Posts: 224


Cool, is it published? What's your name in LBP? I'll put in a friend request, and you can just send a level key to me and I can study what you did. I have it, but I'm not the best with logic yet, and I'd like to know every step you made. Once again thanks for everything.2011-02-18 16:31:00

Author:
rambo3416
Posts: 179


Its not published no, i have nothing published to date, purposefully. I have something quite special in the works, been working on it since release date, and im determined it is going to be the first thing i release.

To get this across to you, you will have to meet me, I'll host and take you to the crator. Its better that way so i can walk you through the logic step by step. Sorry for the wait though, extended family responsabilities (dinner at the girlfriend's folks house ) Will deffinately be back later tonight. I'll see you then, add me, my PSN is in my sig and on the left in the poster's info. I'll accept when i get on and if ur on we're good to go!
2011-02-18 17:36:00

Author:
Epicurean Dreamer
Posts: 224


Thanks dude. I'll try to definately be online. I need to try to convert the time from your time zone to mine. I'm central U.S. 8 or 9pm where you are could be when I'm in the bed for the night. I don't know. I'll have to check.

I just deleted the mircrochip that I created. I exited the level without saving. I feel sick because I don't remember the exact steps I did to do the charge shot. I'll play around with it again, but I'm not the best with logic. I think the only thing I need to know is, what you put into the sequencer. Don't know if you can remember or not.
2011-02-18 18:31:00

Author:
rambo3416
Posts: 179


yeh the sequencer has 2 batteries in it, The first set to half a bar, the second off set the end of the first battery so it begins one 'notch' in from the end of the first battery, this is routed into the sequencers reset. All it does is dissallow the 'small' shot to be let off if the button is held down.. The sequencer is set to each bar being .3 seconds.

So when you press the button, it fires off the sequencer, you then have a 0.15 second gap (half 0.3) to release the button (I.E. simply tapping the button rather than holding it down) for the NOT gate to give the 2nd AND gate input a true state, which triggers the 1 shot emitter. Holding the button down for any longer resets the sequencer, dissalowing the small shot from firing off, while symultaniously filling up the 2 second counter for the charge shot, if the button is released at any point 'after' 0.15 and 'before' 2 seconds, everything resets.

Its quite a simple (yet supprisingly effective) circuit using a few release switches and such like.

Don't worry about loosing your chip, whats important is the knowledge gained from the experience, it can be re-created, nothing can ever be unlearned

Central us is roughly GMT -5 so unless you sleep at about 3 in the afternoon you'll most likely be awake at 8-9 GMT

catch you soon.
2011-02-18 18:42:00

Author:
Epicurean Dreamer
Posts: 224


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.