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

How To Create a Chargeable Attack (FIXED)

Archive: 21 posts


How To Make A Chargeable Attack


Alright, so it seems like a couple people here are having trouble with this, so I've decided to write up a little guide to creating a chargeable attack. Please states any issues you may see with what I explain.


The Initial System:


Here's a simple little circuit that will charge up an attack, and only "activate" upon release:

You need 1 each of the following (for the initial system at least):


Controllinator
Timer (Power, set max to time to fully charge)
NOT gate
Counter (max at 1)
Sequencer (Positional) with battery covering entire thing (not over left edge though)
AND gate

Create the following system:


Fire Button (eg: X) -> Timer Input (Power)
Timer (Power) -> AND gate
Fire Button -> NOT gate
NOT gate -> Counter Input
Counter -> Counter Reset
Counter -> AND gate
AND gate -> Action
AND gate -> Sequencer
Sequencer -> Timer reset (Power)

Holding X will increase the timer, and upon release, the counter will pulse, sending the timer value out to be converted into something useful (see 'Other Stuff' for more details). The pulse of the timer (count up) and the counter also resets the entire system.

Works very well.


Creating a Charge-Up Animation:


Option A) Timer Output -> Sequencer (Positional) (not the same one as from initial set up)

Sequencer could have batteries that activate holograms with each 'stage' of the charge up sequence.

Option B) Timer Output -> Speed / Strength Scale of something (eg: Rotator)

This would mean that as your charge level increases, the mechanism increases in speed/etc (eg: rotator spins faster).


Other Stuff: (More complex stuff about dealing with the timer output)


Depending on how you are dealing with how much damage each charge level does, you will need to use some different methods.

Know that the max time of your timer will impact how quickly the charge builds up (higher values increasing slower than lower values.

Some of these designs I will try to explain below:

Using A speed scale timer damage system:

Output timer analog signal directly into your combiner circuit. This produces a range of damages of the charge from 0 to 100 (based on a 300 health, 0.1 second timer)

If you want cutoff (so your charge up doesn't deal 100 damage when full):

Output timer analog signal into an AND gate, with a battery (or counter) set to the max damage you want the charged attack to do. The AND outputs the smallest input, so your gradually increasing timer value will be the output until it passes the value of the battery, which then becomes the lowest value, thus limiting the output to the battery strength.

Using 'stages' of charge to deal damage:

Output the timer signal into a sequencer (if using Option A), then just use that one). Place the same number of batteries as there are charge levels in your attack. Make sure they don't overlap.

In increasing position on the sequencer, output each battery to each 'stage' of your charge.

If this is for animations, output directly into whatever it is you want to activate at that charge level (eg: holograms).

If this is for an emitter, output into an AND, which has it's other input as the counter (from the initial system), and output to the emitter.


Notes:


I made this system as modular as possible, so there are some unnecessary parts (eg: you don't need a timer if you don't deal with speed scale stuff, since the 'Fire button' could go directly into the sequencer (set to 'play', no loop), and have it's reset as the NOT).

That's all. I'll try to answer any questions about this setup, as I do realize it it quite hard to convert written instructions into an actual design.

EDIT: Fixed problem where system reset before signal was passed on.
2011-02-24 04:23:00

Author:
SSTAGG1
Posts: 1136


Thanks again. I'm anxious to try this out. Does this system allow you to choose what direction you want to shoot in. Or do you have to create this separately?2011-02-24 04:43:00

Author:
rambo3416
Posts: 179


It's just for the actual charge-up attack, aiming would have to be done separately.

What you could do, is have a selector with 2 outputs, one going all the right emitters, the other for the left. Make sure you convert the analog signal from the left stick into a digital signal through the use of a full duration battery on a sequencer. Then output left to the left option, and right to the right option.

From my last point about emitters. Instead of putting the AND into the emitter, put it into the AND with the selector input, then go on to the emitter, this could also be done for the animations, where the output determining which stage of animation you use goes through an AND, with the selector input as the other input. Output to your chosen animation and it should work.

I need to make this tomorrow, so I'll see if it works then.
2011-02-24 04:52:00

Author:
SSTAGG1
Posts: 1136


And this is done independent of the charge attack correct? By the way I just started inputting your tutorial. Works so far, minus shooting in a particular direction. Right now I have the counter going straight to the emitter and it works. What then, would I hook the selector into to get a directional attack? I'll continue to play with it too. I learn a lot that way...lol.

Yo.....Discovered a problem with the tutorial. I can hold down the attack button and charge up a shot, but I can also release these same charged blasts by rapidly pressing the attack button. Maybe I did something wrong. I plugged the counter into the emitter.
2011-02-24 05:29:00

Author:
rambo3416
Posts: 179


Yeah, you need to use the timer going into a sequencer, with batteries for each level of charge. It seems like you missed the charging part of the setup, as the counter directly to the emitter would activate every time you press the button.

I'll make some pics tomorrow, and since I haven't actually made this yet, I'll see what needs to be fixed then.
2011-02-24 06:25:00

Author:
SSTAGG1
Posts: 1136


OK Dude....I appreciate everything seriously man. I'm further along than before with this tutorial. So I know once I see your photos I'll get it. Can't wait.2011-02-24 06:29:00

Author:
rambo3416
Posts: 179


Exactly how are you achieving the various charge levels? Purely timer based or is it going through the sequencer?2011-02-24 07:01:00

Author:
SSTAGG1
Posts: 1136


Thats something else i gotta figure out. Youre talking about damage levels right? Yeai figured id cross that road once i got to it. Im willing to change my whole damage/healing system if i have to....lol

Im not that good with sequencers yet so ive been using timers
2011-02-24 07:08:00

Author:
rambo3416
Posts: 179


I love LBP logic, the posibilities are endless! 2011-02-26 03:50:00

Author:
vicander
Posts: 13


Just made and fixed this system, works very well. See OP.2011-02-26 05:44:00

Author:
SSTAGG1
Posts: 1136


Could you please make a video of this. Some if it is kind of hard to follow. I would love you forever. And will send you flowers on your birthday.

Edit: Could you also explain how to increase the distance an object is launched when a button is held.
Like stages of power on a bar which increases when "X" is held and when released it launches at a certain velocity according to the stage of power it was released on. Kind of like Worms.
2011-03-07 06:58:00

Author:
GaGun
Posts: 4


Yeah, sure, though you could probably leave out the flowers, and the loving, lol.

Your problem has an easy fix, though it would require different emitters (unless you want to make a more complicated tag detection based acceleration at launch, which I'll also make because I could actually use it as well for some of my ideas).

I've received a request to make a video tutorial for a damage system and this, so when I have time, I'll get on it (have a 2 day experiment tomorrow, epic, 20 hours of science)
2011-03-07 07:54:00

Author:
SSTAGG1
Posts: 1136


oh awesome! i could use the damage one as well.

Also I have a question!

How do i balance an object to make it stop from tipping over. I have a box like machine that hops every time it moves but it keeps falling over. I tried using the Mover, the GyroScope, different material. It just keeps tipping over and humping the floor.

Thank YOU and good luck with your 20 hours of science.
2011-03-07 08:53:00

Author:
GaGun
Posts: 4


Did you bring up the strength of the Gyroscope?2011-03-07 15:14:00

Author:
jalr2d2
Posts: 256


Yeah, use a gyroscope with maxed out strength (or less if you want some wobble)2011-03-07 17:58:00

Author:
SSTAGG1
Posts: 1136


o poop. i didnt know u can increase the strength on gyroscope. Well ill give it a try when i get the chance. I dont want any wobbling.
But what if the machine is going up a hill or something? will it tip over then?
2011-03-08 09:04:00

Author:
GaGun
Posts: 4


Some people were asking about different directions... Here ya go.

http://i11.photobucket.com/albums/a182/Darkclaude/APhoto.jpg

The Initial System:

Here's a simple little circuit that will charge up an attack, and only "activate" upon release:

You need each of the following (for the initial system at least):
* 1 Controllinator
* 1 Timer (Power, set max to time to fully charge)
* 1 NOT gate
* 1 Counter (max at 1)
* 2 Sequencers (Positional) with battery covering entire thing (not over left edge though)
* 3 AND gates
* 1 Selector
* 1 Direction Splitter
* 1 Or Gate

Create the following system:
* Controlinator Output: Left Stick Left/Right -> Direction Splitter
* Direction Splitter (pos) -> Input 1 of the Selector
* Direction Splitter (neg) -> Input 2 of the Selector
* Fire Button (eg: X) -> Timer Input (Power)
* Timer (Power) -> AND gate 1
* Fire Button -> NOT gate
* NOT gate -> Counter Input
* Counter -> Counter Reset
* Counter -> AND gate 1
* AND Gate 1 -> AND Gate 2
* AND Gate 1 -> AND Gate 3
* Selector Output 1 -> And Gate 2
* Selector Output 2 -> And Gate 3
* AND Gate 2 -> Sequencer 1
* AND Gate 3 -> Sequencer 2
* Sequencer 1 -> OR Gate
* Sequencer 2 -> OR Gate
* OR Gate -> Timer (Reset Input)

This was made purely to go along with SSTAGG1's guide. This is just a simpler and more efficient way to select animations/attacks or even shooting fire or something with direction. Using this the positive input is when your facing right, and the negative input is when your facing left.


Edit: Forgot to mention that using this and his original guide you don't actually have to hold down the action button to charge the timer even tapping it rapidly works. Is there a way to fix this? What I mean is if you let go of the action button before the timer finishes it resets itself.

Edit 2: Alright figured it out my self it's real simple. If you want to make it so people can't just tap the action button to get a charge add a second OR Gate to my tut. from here:

OR Gate 1 -> OR Gate 2
Action Button -> Or Gate 2
OR Gate 2 -> Timer (Reset Input)
2011-03-09 06:57:00

Author:
KingBalmung
Posts: 17


I'll get some pics posted soon, I haven't been on LBP for a while (well, have been on, but only fleetingly). I've been doing some intense science and designing a motorized 3 person tank, but I'll probably have some pics of both methods tomorrow.

Just a comment on the above: Using my method, the timer reset every time you let go of the button, so it had to be held to charge. You're solution was exactly what I did, though I had to introduce a delay so the timer value would be passed on for a single frame before getting reset, hence the sequencer.
2011-03-09 07:35:00

Author:
SSTAGG1
Posts: 1136


I'll get some pics posted soon, I haven't been on LBP for a while (well, have been on, but only fleetingly). I've been doing some intense science and designing a motorized 3 person tank, but I'll probably have some pics of both methods tomorrow.

Just a comment on the above: Using my method, the timer reset every time you let go of the button, so it had to be held to charge. You're solution was exactly what I did, though I had to introduce a delay so the timer value would be passed on for a single frame before getting reset, hence the sequencer.
I used your guide with mine on accident, and it made it not reset.

Edit: I can add a picture of my method right now if you would like
2011-03-09 07:45:00

Author:
KingBalmung
Posts: 17


Yeah, go ahead, I'm not going to be on my PS3 for a while.2011-03-09 22:03:00

Author:
SSTAGG1
Posts: 1136


Some people were asking about different directions... Here ya go.

http://i11.photobucket.com/albums/a182/Darkclaude/APhoto.jpg

The Initial System:

Here's a simple little circuit that will charge up an attack, and only "activate" upon release:

You need each of the following (for the initial system at least):
* 1 Controllinator
* 1 Timer (Power, set max to time to fully charge)
* 1 NOT gate
* 1 Counter (max at 1)
* 2 Sequencers (Positional) with battery covering entire thing (not over left edge though)
* 3 AND gates
* 1 Selector
* 1 Direction Splitter
* 1 Or Gate

Create the following system:
* Controlinator Output: Left Stick Left/Right -> Direction Splitter
* Direction Splitter (pos) -> Input 1 of the Selector
* Direction Splitter (neg) -> Input 2 of the Selector
* Fire Button (eg: X) -> Timer Input (Power)
* Timer (Power) -> AND gate 1
* Fire Button -> NOT gate
* NOT gate -> Counter Input
* Counter -> Counter Reset
* Counter -> AND gate 1
* AND Gate 1 -> AND Gate 2
* AND Gate 1 -> AND Gate 3
* Selector Output 1 -> And Gate 2
* Selector Output 2 -> And Gate 3
* AND Gate 2 -> Sequencer 1
* AND Gate 3 -> Sequencer 2
* Sequencer 1 -> OR Gate
* Sequencer 2 -> OR Gate
* OR Gate -> Timer (Reset Input)

This was made purely to go along with SSTAGG1's guide. This is just a simpler and more efficient way to select animations/attacks or even shooting fire or something with direction. Using this the positive input is when your facing right, and the negative input is when your facing left.


Edit: Forgot to mention that using this and his original guide you don't actually have to hold down the action button to charge the timer even tapping it rapidly works. Is there a way to fix this? What I mean is if you let go of the action button before the timer finishes it resets itself.

Edit 2: Alright figured it out my self it's real simple. If you want to make it so people can't just tap the action button to get a charge add a second OR Gate to my tut. from here:

OR Gate 1 -> OR Gate 2
Action Button -> Or Gate 2
OR Gate 2 -> Timer (Reset Input)

Hi i tried out ur guide but i'm still clueless on how to make it shoot in the direction the user desires with the controllinator and tags and also shoot further as the action button is held down longer and when released it shoots a certain distance. kind of like a cannon.

Also i was wondering how, if possible, can u make a 2D object flip the opposite when left or right is pressed. because its a machine that is created facing right. and it can go forward and backwards but it cannot turn the other way and go forward (the way its facing). So i was wondering if it is even possible to make it do that.

I was thinking maybe i can:
highlight the object
flip it
capture it
emit the reversed object when the direction opposite of the way it is facing is pressed.
destroy the original one and continue gameplay with the new object which is facing the opposite direction.
But my problem is that how do i take control of the new object? ill probably need sackbots right?

Some pictures would be nice!

PS: the gyroscope WORKED! i gave it some strength and made it face upwards and put a bouncer and anti gravity with some dampening so it hops while it walks and and it doesnt tilt over! THANK YOU!
2011-03-28 02:19:00

Author:
GaGun
Posts: 4


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.