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

Randomisers and duplicate outputs

Archive: 5 posts


Does anyone have any good methods for combatting a situation where a randomiser's output is the same twice in a row? I need each subsequent randomiser output to be different, but there's no "Remove Duplicates" option in the tweak menu.2011-02-08 18:27:00

Author:
Holguin86
Posts: 875


If you have your Randomizer hooked up to a Selector, you can connect each state's output to its own AND gate and directly put a line from the Randomizer into the other input of each AND gate; so, when for instance the active state is "2" and the Randomizer outputs "2", AND gate #2 will become active. Hook up all the AND gates to an OR gate and have that output to... And here ends my train of thought.

You need to get a new number when either of the AND gates is activated. However, if you rely on a Randomizer set to accept an ON/OFF signal, then passing on the AND gates output is not gonna get you any new numbers...

How about this, community? Randomizer set to Override Pattern and have a self-resetting Timer in front of it as a pulsar to make it give off a random number every X seconds? Then there could be an OR gate in between the Timer and the Randomizer and the output of the AND gates could go to its input...

Sorry I cannot give a definitive answer.
2011-02-08 18:47:00

Author:
Antikris
Posts: 1340


The AND Gate > OR Gate method sounds interesting ... I'll have to do some experimenting to see if the randomiser switches off momentarily before outputting along the same wire though, else this method won't remove triplicates or more. But thanks, that's really helped 2011-02-08 18:54:00

Author:
Holguin86
Posts: 875


I am testing this right now and it does not work: the Randomizer is hooked up to the inputs of the Selector and also the AND gates; it treats the AND gates as random targets as well. I.e. the Randomizer sees 6 targets instead of just the three on the Selector.2011-02-08 19:43:00

Author:
Antikris
Posts: 1340


I present for your consideration what I hope is a solution to your problem. It works for emitters and other inputs that take a single shot input. Hopefully you want to set off something like that:
http://i6.lbp.me/img/fl/c96010d5fa452b8ea575b5febb4f132ccfa60aa1.jpg
Now the hard part, explaining the thing...
Basically we use a timer (which is on its own chip above the toggle) to send a signal to the randomizer, each time the timer activates it sends a pulse to the randomizer. We use a toggle to turn off and on the chip that the timer is located on. When the red button is pushed it activates the toggle, which turns on the chip and activates the timer. The timer counts up and then activates one of the four counters (set to 1) in the left column (from top to bottom: blue, green, yellow, red), when a counter is activated it turns on the same colored pulse counters to its right (second column. each set to 1 and wired to reset itself). when the pulse counters are activated they turn on an emmiter. At the same time they send a signal through the purple OR gate (far right), this OR gate is wired into the toggle (through an OR gate along with the red button's output). when the OR gate recieves a signal it turns the toggle off.. which turns off the timer.
Now, if the randomizer chooses a counter that was previously activated (in the pic here its the yellow one) the counter since it is on, will not send a signal to the purple OR gate, which leaves the toggle on and the timer on as well, which means the timer will send another signal to the randomizer. This will keep happening until the randomizer chooses a new input. If a new input is choosen, signal gets sent to toggle, which turns off the timer.
Now the additional part (hard to see from the pic), is that each of the column 1 counters is wired into three out of the four or gates at the top (in thier own microchip for neatness sake. Basically, each counter is wired into an OR gate, except their own. So yellow, blue and green are wired into Red OR gate. Do same for others). each of these OR gates (color coded) is wired into the resets of the column one counters (red to red, so on and so forth). So if a new signal is sent successfully, they will reset any previously full counters.
Dear god that was a mouthful. I hope I made sense and if you want I could just publish this if you can't see the pics well. Hope this solves your issue. It was at least fun to figure something like this out.

PS Not in the pic, but you should wire the red button into a pulse counter (one shot pulse) and then wire that pulse counter into the first OR gate. This will keep everything from staying on so long as the button is pressed (unless you want that) .
PSS Ok I made it into a short and copyable tutorial. Then published it. http://lbp.me/v/xkjszz
Also by hooking the output of the chip into a selector, you can keep the last output on until button is pressed again. So you can use it for things besides 1 shot inputs.
2011-02-08 22:08:00

Author:
kemengjie
Posts: 42


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.