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

Mana/MP/Magic Bar problems

Archive: 4 posts


Okay, so, I need some help figuring out some logic stuff.
I'm making a sort of RPG level with a health bar and a mana bar.
The health bar is fine, but I'm having issues with the mana bar.
I've made them using counters. So, when the player "casts a spell", an object is emitted and the mana counter decreases by one, and it stops emitting when the counter is at zero.
My issue is that I want to make different spells with different "mana" costs. So, one spell depletes only 1 count, while another costs 3 or something. But I can't figure out how to make the counter go down more than one unit at a time.
So yeah, that's what I need to know how to do. Thanks in advance!
2011-12-22 00:09:00

Author:
Unknown User


What's a mana bar? Don't know if it's totally relevant, sounds just like a magic bar so I'll assume it is.

I... don't think you can make a counter deplete more than once with only one activation, but I'm probably wrong. Instead though I'd go with a timer and there's an excellent tutorial by Comphermc here that details what you need to do:

http://www.youtube.com/watch?v=JXJzQrsGxpc&hd=1

It's for health bars, but the same scenario is applicable here once you've adapted it somewhat, as health and magic bars have pretty much the same premise.
2011-12-22 02:31:00

Author:
Xaif
Posts: 365


i don't know about counters for health/mana systems but using the timer system that Xaif linked to, i've been able to adapt it to a stamina/mana system. once you've got it set up it's very easy to hook up different abilities with different costs, and i even have a slow regeneration for my stamina bar! i can't make vids or pics but if you decide that you want to use that system i can help you adapt it.2011-12-23 17:19:00

Author:
harbingernaut
Posts: 126


Maybe this will help you. Say, you have a spell that costs 3 mana.
1) create a counter, max 3, output inverted (A)
2) create a timer, target time .2 (B). This timer will "activate" the logic that will decrease your mana by 3.
3) drop an AND gate (C).
4) output from (A) will go to one port on AND gate (C)
5) output from (B) will go to other port on AND gate (C)
6) drop a direction combiner (D)
6) output for AND gate (C) will go to reset timer (B), increment counter (A), and negative input on direction combiner (D)
7) create a 1 shot counter (E), output to input on timer (B)

Now, set up so when the player casts the spell, it activates counter (E). It will click off a negative output as many times as the max on counter (a). Connect the direction combiner to the mana bar (use an or gate as needed). You can copy this logic and set counter (A) to different amounts for different spells. Just make sure you reset for additional use. Let me know if you have any questions about this. I'll see if I can post a picture.

http://i4.lbp.me/img/ft/734e3933a224544c5c50dbae2ac0d8472e9e7dc1.jpg
2011-12-24 03:34:00

Author:
Brannayen
Posts: 438


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.