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

Ammo Consumtion

Archive: 7 posts


I'm having trouble figuring out how to keep track of the amount of ammo stored on a weapon that isn't in use, ammo used, and collected without exceding the max that can be carried. Each of the four weapons I'd like to use would have three different firing modes each consuming a different amount. Any ideas for keeping track of all these numbers?

Thank you in advance to anyone. There's no way I can figure this one out on my own.
I have a feeling in my guts that I'll have to attempt wrapping my brain around this crazy advanced logic some of you are using for rpg inspired games and dumb it down. lol
2011-02-26 07:28:00

Author:
DigiOps
Posts: 111


You'll need counter set to max ammo. Then you need the logic of amount of ammo decreases for each gun hooked up to three separate counters. You'll need to connect the 3 different counters to a first counter that is decremented by the different counters output using an OR gate with three input slots. To do different amounts of damage you may need to put counters on a sequencer that is activated. 3 counters for 3 dmg. 2 counters for 2 dmg, etc2011-02-26 16:08:00

Author:
Shadow_Wolf_1987
Posts: 108


How exactly will this work with a max of either 400 or 500 and getting refills of only 100 at a time without filling the ammo cache completely?

Nevermind. I decided to dig through and figure out Analogue Logic.
2011-02-27 01:11:00

Author:
DigiOps
Posts: 111


Nevermind. I decided to dig through and figure out Analogue Logic.

Yup. You'll most likely want to use a timer. There are tutorials and other posts about how to use a timer as a HP bar. The same thing shouldn't be too hard to adapt to your ammo counter.
2011-02-27 06:08:00

Author:
Sehven
Posts: 2188


Timers just don't seem applicible. Where there is a will, there is a way... unless predetermined limitations put their proverbial boots in my will's behind.
This analogue and binary stuffzors is a lot to wrap my mind around, but what with it being applied to these fancy RPGs for damage and health and all that jazz, No reason why it can't be applied to adding and subtracting rounds for four guns and multiply it by two or three depending on how many button presses in one direction there were to change firing modes. :

Unless... Yeah. Boots... Behinds... It could all just be bad. lol
2011-02-27 07:18:00

Author:
DigiOps
Posts: 111


The problem with counters is that you're limited to adding/subtracting 1 to/from the count every clock cycle or every two clock cycles if you use a strobe signal to control it. If you never need to deal with increments higher than 1, then that should be fine, but if you want to knock two off the count at once, it'll take at least three clock cycles or 0.1 seconds. That doesn't seem like much, but if you were to fire again during that .1 second, it wouldn't be counted, or if you wanted to knock four or five off the count, the delay would start to really hurt.

With timers, you can configure them so that you can knock any amount off that you want. For example, you can set a timer to 0.1 seconds and use a pulsar (counter set to 1 and wired to its own reset gives you a pulse for a single clock cycle 0.03333 seconds) combined with an analog signal to knock a small increment off of it. If your pulsar generates a 100% signal, you would knock a third off the timer, but if it was set to 10%, you'd knock approximately 1/30th off it. You can set up various pulsar battery combinations at various signal strengths and run them through a signal combiner adder (see Rtm's logic blog on addition) and you'll be able to add or subtract multiple values to the timer at the same time without any of them being missed (useful for hp bars when two shots of different power can potentially hit the target at the same time).
2011-02-27 08:36:00

Author:
Sehven
Posts: 2188


Oh, believe you me. I have poking around rtm's blog as we speak.2011-02-27 08:40:00

Author:
DigiOps
Posts: 111


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.