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

Counting Number Of Tags-Hard Logic Question

Archive: 5 posts


So this is a problem I tried helping someone out on lbp with, turns out I'm not entirely smart so here's the dilemma, there is a central tag sensor that is at a set radius, what needs to happen is that after 10 tags have passed through the radius, regardless if they are still there, or have disappeared, something happens, the problem I was having with this is getting the sensor to detect multiple tags at once and not detecting the same tag twice, (the tag name is the same) and to increment. I tried using a sequencer set to 'positional' but alas it wasn't working, also the tags that enter the radius disappear as well, I thought about using a sequencer that activates a tag before it disappears, but as I've said before, getting a sensor to detect multiple tags at once and incrementing for each new tag is proving difficult, anyone who can answer this, thank you 2012-05-13 21:39:00

Author:
damaz10
Posts: 771


Hmmm.. I think I might know how to do this, but I will need a little more detail to figure it out 100%. Also, I probably won't be able to explain how to do it over LBPC.. Want to send me a friend request on PSN and see if I can help?2012-05-14 03:02:00

Author:
Wolffy123
Posts: 406


If I got it right, you have tags entering a radius. You want to detect any entrance of a tag, but not leaving. If the same tag was to leave and enter again, would it count it again? I guess so, else you would need multiple tags.

Place 10 sensors each set to a different amount of tags, top one being 1 and bottom being 10. Place a selector and make it 11 outputs. Then wire the sensors to the inputs, leaving the top one empty. Now the selector outputs the amount of tag inside the radius. You have to make sure a pulse is triggered only when the selector goes up (um, down when you look at it, but up in terms of math). You need a 1-frame delay chip (we will come to that later). Wire the selector's outputs each to a delay chip and to a pulser, and place AND gates to test if an output is on AND the previous ouput wasn't higher (ex: did output 6 just pulse AND was last frame's output NOT (7 OR 8 OR 9 OR 10 OR 11). You could also test "was last frame's signal lower".

Now to build the delay chip. Place a 2-input selector and wire each output to the other input (out1>in2, out2>in1). It will now change state every frame. Wire the outputs to AND gates (one gate for each output). The other input of those AND gates will be the input of the chip. Then these outputs go into set-resets (1-shot counters). The reset of out1's counter is the out2 of the selector, and vice versa. Since outputting is done before resetting, it should work fine. Finally, use an OR gate on those two counters, and this is the chip's output.

I did not test this, I just thought about it in 15 minutes and it is now 11pm. I didn't make any lbp logic for at least 2 months, and I only slept 7h last night, from 2 to 9. Though I did make an analog frame delayer once (which was a bit worse than this).
2012-05-14 04:04:00

Author:
Unknown User


https://lbpcentral.lbp-hub.com/index.php?t=59607-How-to-buffer-events-%28and-use-it-with-a-counter%29

Here's a thread in the tutorials that covers this very subject. It's very useful...I used to to detect if you eat 2 ghosts at the same time in my Pac Man level.
2012-05-14 04:12:00

Author:
Brannayen
Posts: 438


this thread has several different solutions to your problem
https://lbpcentral.lbp-hub.com/index.php?t=61264-Count-objects-in-area&highlight=counting
2012-05-14 08:19:00

Author:
evret
Posts: 612


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.