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

Wireless Damage Sensor

Archive: 9 posts


For my upcoming sackbot deathmatch I wish for a battle meter that everytime you take or do damage, your battle meter goes up and then your able to use your special attack.

I already know how to raise the battle meter via taking dmage butnot giving damage.

So does anyone know how to make it to where it knows when you did a succesful attack and then raises the battle meter?

I am trying to make this completely wireless as weell.

Can someone please help me with this is.

OH and btw, I'm using timers for health and meter.

Thanks in advance
2011-07-12 20:41:00

Author:
fighterwindplus
Posts: 403


If it's only 2 players, simply pulse a tag along with the damage when a unit is struck. Tag would signal how much damage was done.

If more than 2 players, it's either going to get a little complicated, or annoying. Very annoying option just means that each player needs to have a unique tag for each attack (so if 4 players, there will be 4 '10 damage' attacks, 4 '20 damage' attacks, etc) that are pulsed when hit. Just use an OR gate to combine all the damage signals, and output each individual signal into a separate tag which then returns to the corresponding unit, adding to the battle meter.

The complicated option involves detecting which player had hit last, changing a selector, which allows an analog signal to be sent to a tag for that units battle meter. Based on how much damage is dealt, an analog signal is sent through a tag to a tag sensor for strength. Now just add the value to the meter and you're done.

I would suggest using a feedback loop, since I find they are much easier to use, adjust, and add to, but if you've got it working using a timer, don't change. They both work.

EDIT: After reading that through again, I think the first option is both the more annoying and more complicate method. I'm using something similar to the 2nd option to detect which player killed whom, and it works well.
2011-07-12 21:25:00

Author:
SSTAGG1
Posts: 1136


Each player has unique tag ("hitByP1", "hitByP2", etc) that lights up whenever an attack is made. Target objects registers impact with either of those tags and knows it is being hit. Each of the unique impact sensors briefly activates a chip that has a tag sensor on it measure an analog signal of another unique tag ("strengthP1", "strengthP2", etc.). Because "hitByP#" matches always "strengthP#", you can be sure that not the strength of another nearby player was measured who was hitting something else (or just hitting thin air).

Stream these four analog signal outputs through an OR gate.

What keeps being a problem for people is generic objects - like (controlled) sackbots - that are ID-less because they are all the same. I think I'll do my next tutorial on generating unique-ID instances of a generic object.
2011-07-12 22:11:00

Author:
Antikris
Posts: 1340


I think I'll do my next tutorial on generating unique-ID instances of a generic object.

It's quite a coincidence indeed. Even this post is about the same time as I posted, (https://lbpcentral.lbp-hub.com/index.php?t=59857-Giving-unique-id-s-and-signaling-channels-to-emitted-objects) it seems like we were trying to solve the same problems at the same time.

For 2 players, there's definitely no problem, for 4 players, even sackbots wouldn't be a problem because each seat could emit a modified sackbot. Manual modification of just tag colors would work fine, since there aren't many. Each time you make a logic change, tho, you'd have to make sure you update all 4 sackbots the same. So I don't think id'less objects would cause any problems for this type requirement, my suggestion is that all players would have just different color tags, it would be easier to manage. So it would be more like hitbyplayer (blue) hitbyplayer (red), and any such player specific logic would have a different color unique to each player. Working out names for each player specific logic would be harder to maintain.
2011-07-13 00:52:00

Author:
hesido
Posts: 166


Well SStaggs way seems more complicated than Antikriss but i will say this I forgto to mention this earlier but the full game shall be up to 8 playable characters, but I am worried more about the demo than anything which should only have 3 playable characters.(wierd number) So i'll try both ways to see which is better.

I've changed my mind...if up to four players is complicated...just imagine eight.. O.o
So I might just change it to where theres some type of energy that floats around the stage...like the Smash Ball! That's easier...(i'm taking the easy way) -__-
2011-07-13 03:29:00

Author:
fighterwindplus
Posts: 403


Actually, there should only really be a difference in complexity when there are 1-2 players, and when there 3+ players. It'd just alter which design would make it work. Also, I explained my design poorly, but yeah, Kris seems to be best at these logic things, so that method is probably better.2011-07-13 06:26:00

Author:
SSTAGG1
Posts: 1136


Check out my Cosmic Blasters level and let me know if THATs the kind of effect you are after. Mine works fine with 4 players. If it looks like what you need, I can show you the logic I used and how I came up with it. I'll get some good pics.2011-07-14 11:57:00

Author:
sp0ngyraver
Posts: 407


Check out my Cosmic Blasters level and let me know if THATs the kind of effect you are after. Mine works fine with 4 players. If it looks like what you need, I can show you the logic I used and how I came up with it. I'll get some good pics.

Alright I'll try to check it out as soon as i can, most likely tommorow...I'll message you on psn if it's what i'm looking for.
2011-07-14 21:51:00

Author:
fighterwindplus
Posts: 403


Alright I'll try to check it out as soon as i can, most likely tommorow...I'll message you on psn if it's what i'm looking for.

Plug in a 2nd controller (or get a friend) and play it in battle mode, target mode won't have what I think you're talking about, but battle mode will.
2011-07-14 22:22:00

Author:
sp0ngyraver
Posts: 407


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.