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

Logic order

Archive: 6 posts


Im having some issues with the order my logic is executed
http://i3.lbp.me/img/ft/9132e372d667f507960071574c45630544591362.jpg
I have 2 colored tags if the green one is activated it will simply set the selector to the 3rd state. Now if the blue one is activated I want it to look if state 2 was active on the selector, if yes it should give a score ( the cable going up offscreen). Now if it state 2 wasn't active I want it to activate state 2 on the selector but NOT give a score.
Now my problem is I need to do it in that order and stop looking. Otherwise it switches to the state 2 on the selector and gives the points after that. So my question is how can I check for one state 1st, and AFTER that for state 2?

(ps. Hope it makes sense, I'm bad at explaining )
2011-09-08 21:13:00

Author:
Tricky
Posts: 46


You might try putting a counter set to 1 between the blue tag sensor and the top AND switch. Have the counter reset itself. It should pulse the AND gate and then not re-trigger until the tag sensor is switched off and on again. If that isn't enough delay add a 1 ms timer delay between position 2 selector output and the first AND gate.2011-09-08 21:36:00

Author:
Death_with_an_H
Posts: 72


I found a solution for you!

http://i4.lbp.me/img/ft/954c1f9a7b06e560f8855fb4303e963229d95e25.jpg

That's a counter, set to 2. When the blue tag is activated, it increments the counter once. Activating it again (and again, and again, etc.) gives you points because of the AND gate. If the green tag is activated, the counter is reset, requiring the blue tag to be activated twice before points are given again.
2011-09-08 23:13:00

Author:
Unknown User


I think the issue with the original set up is where the NOT gate is being activated from. The way you have is this: the NOT gate is being fed by the AND gate connected to the blue sensor and selector. I think connecting selector output 2 to the not gate input, and a 1 count self-resetting counter between the blue sensor and the outputs would fix it.2011-09-09 00:14:00

Author:
Brannayen
Posts: 438


I think you have it almost right. If all you need is a quick pulse to give a score, I would get rid of everything except tag 1, tag 2, the sequencer, and the top AND.

Run the blue tag to a counter set to count to 1, and set to reset itself. Then run that out to selection 2, and out to your AND gate.

The only issue that you will have is that the green tag will override the blue one. Selectors use the highest order input. If there is an active signal on 2, and 3 becomes active, it will switch to 3. On the other hand, if 3 has an active signal from the green tag sensor, and the blue tag sensor tries to activate 2, nothing will happen.
2011-09-09 00:54:00

Author:
tdarb
Posts: 689


So my question is how can I check for one state 1st, and AFTER that for state 2?

Problem is that everything's happening in one simulation frame, so port #2 is being activated at the same time as everything else is going on, so a 'single-frame pulse' (i.e. a self-resetting counter) won't work in isolation. You can simply introduce a single frame of latency in a Selector by using the Toggle input to activate the port you want, instead of activating it directly, which I had to use in my shift-register design.

With minor changes...

http://ic.lbp.me/img/ft/18c1f8594d55e6514739626b0ede1b5971b45a89.png

...works correctly, although the behavior when port #1 is activated is undefined, since it's not clear what its purpose is. TBH, though, if port #1 isn't needed, I'd just go with Chaozplayerp's design.
2011-09-09 02:42:00

Author:
Aya042
Posts: 2870


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.