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

Help Implementing Logic

Archive: 6 posts


I'm creating something in the game but i'm having a hard time implementing the logic to make it work.

I've got a button attached to both a light and a magnet. basically when i hit the button, the light and the magnet turn on. now what i want to happen is when i use a counter, with each button press, some time is taken away. when the timer is depleted, i want both the magnet and light to stay off permanently (even if sackboy hits the button again), UNLESS the sackboy comes in range of a sensor. once this happens, the timer will reset itself and both the light and magnet should turn on by hitting the button. anyone know what kind of logic to set up in order for this to happen?
2011-10-02 05:36:00

Author:
Unknown User


And is the timer going down continuously on its own?2011-10-02 06:24:00

Author:
xero
Posts: 2419


i've got the timer set to countdown mode but it only starts counting down with each button press. if sackboy is not on the button, no time is taken away2011-10-02 06:26:00

Author:
Unknown User


Not sure I completely understand, but if I get what you are saying, here is one way to do it.

You will need:
Two timers
a Battery
an XOR gate
two AND gates
a counter


Take one of your timers and set it for however long you want the magnet to be on each time you press the button, and set its current time to make it full. We'll call this Timer 1.

Take the other one and set it to invert output and set it to however long you want the magnet to be active in total. We'll call this one Timer 2.

Run your activation button into the counter. Set the counter to count to 1, and run its output into its own reset port and the first AND gate. Run the output of Timer 1 into the other part of the AND gate, and run that out to the reset port of Timer 1. What this does is ensures that the running time of the magnet can only be activated if it is not currently counting down, and makes sure standing on the activation button won't activate it again. Sackboy will have to actually jump off and back on once the timer has finished to activate a second cycle

Take the output of Timer 1 and plug it into the input of the XOR gate, and run the battery into the other input of the XOR.

Plug the output of your XOR into the input of Timer 2, and int one input of the second AND gate.

Now, connect the output of Timer 2 into the other port of the AND gate, and run that out to your magnet/light.

Take your sensor for resetting, and plug it into the reset port on Timer 2.

Now, whenever you press the button Timer 1 starts counting back up. This makes the XOR have an active output and starts the countdown on Timer 2. As long as both the XOR and Timer 2 have live outputs the magnet will be active. Once Timer 1 fills up again, the XOR deactivates stopping the countdown on Timer 2, and deactivating the AND gate.
2011-10-02 07:20:00

Author:
tdarb
Posts: 689


i've got the timer set to countdown mode but it only starts counting down with each button press. if sackboy is not on the button, no time is taken away
Ok, based on your description I may have a solution for you. It's somewhat complex, and utilizes analog signal manipulation, but it should work. I'll have to either draw up some diagrams or take some screen shots and post them. In the meantime, anyone else is also welcome to help tackle this problem.

EDIT: Sniped by tdarb! Hopefully his solution works for you. If not, I'll post mine.
2011-10-02 07:20:00

Author:
xero
Posts: 2419


hey thanks guys, but i finally figured out a way. i would tell you how i got it to work but i'm still trying to figure out how it works. to me the basic logic is advanced and vice versa. i may have more questions. thanks for taking the time to help me anyway.

forgot to say that i initially told you wrong. the timer is set to on/off. not set to a countdown.
2011-10-02 09:05:00

Author:
Unknown User


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.