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

Counter Decrease?

Archive: 6 posts


Hello. I've been working with counters to make a health bar. I've been using multiple counters to affect the "hearts" of my bar to increase, using the Increment ports on the counters.

My question is: Is there a way to decrease them by 1 like the Increment increases them by 1?

Thanks!
2011-03-03 11:54:00

Author:
Unknown User


If you feed it a negative signal (not a 'no signal&apos, I think you can. I am still new to analogue logic, but you can try it out by placing a battery set to -100% on a separate microchip; wire the battery to your counter input and wire a button or something to the microchip in order to activate the battery.

Since the counter has only 1 input, if you'd like to feed the counter both a positive and a negative signal, you can put a signal combiner in front of the counter. Negative signal goes to the - input, positive signal to the + input.

I don't know what happens if you feed a counter a signal that is not 100% or -100%, but for instance -50%.
2011-03-03 12:06:00

Author:
Antikris
Posts: 1340


If you want it to be able to increase AND decrease, then all you need is a direction combiner.

Wire the direction combiner into the counter's input, and then put inputs into that.

The positive output brings the counter up, the negative brings it down.
2011-03-03 12:16:00

Author:
KlawwTheClown
Posts: 1106


If you want it to be able to increase AND decrease, then all you need is a direction combiner.

Wire the direction combiner into the counter's input, and then put inputs into that.

The positive output brings the counter up, the negative brings it down.

Ah yes! That simple. No need for separate MC's with +/- batteries on them.
2011-03-03 12:18:00

Author:
Antikris
Posts: 1340


If you feed it a negative signal (not a 'no signal&apos, I think you can. I am still new to analogue logic, but you can try it out by placing a battery set to -100% on a separate microchip; wire the battery to your counter input and wire a button or something to the microchip in order to activate the battery.

...

I don't know what happens if you feed a counter a signal that is not 100% or -100%, but for instance -50%.

Generally your suggestion is quite correct - but I wanted to clear up a point about the signal that's going in to the counter, because it's very useful information if you're going to do logic stuff:

Basically, the counter's input is digital, not analog... The wire carries both analog and digital signals (independently) - and the correlation between the two parts of the signal (if any) depends on the source of the signal. (For instance, If you connect to the analog stick of a controllinator, and start out the stick centered, and push it 70% to the right - it'll still be in an "off" digital state. But if you push it to 75% and then let it drop down to 30%, it'll be in an "on" state.)

Batteries put out a digital "on" state any time they're set to a non-zero value, with the sign of the digital part matching the sign of the analog part. So a battery set to -50% is still "on" and would therefore still trigger the counter to count down a step.

You can see the digital state of a wire when the wire is visible: it'll glow if it's "on" (though you can't tell direction this way...)
2011-03-03 18:10:00

Author:
tetsujin
Posts: 187


Thank you guys so much! You've really helped me out. Hard for me to grasp this stuff. =) I'm sure I'll be bothering you again in the future!2011-03-04 02:30:00

Author:
Unknown User


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.