PDA

View Full Version : "and" logic? "or" logic? please explain.



altanonymous
11-08-2008, 01:09 AM
what are these more advanced switch techniques, and how do they work? also, if you guys know of any other switch techniques, could you mention and explain them? i recognize it from script language (if thats the term) but i forget what it means.

RAINFIRE
11-08-2008, 01:28 AM
"AND" logic is basically, saying that you need both of the switches that it is connected to to both be active, "OR" logic is saying that you need only one of those switches to be active (really good if you have mulitple routes and you use swithces in those routs but you want both of those routs to activate the same ending action)

hope this helps

Cheers!

altanonymous
11-08-2008, 01:34 AM
how would you do and logic? dissolve material seperating magnetic key from switch?

DrunkMiffy
11-08-2008, 01:37 AM
Go check out Landails logic gates levels. They'll really confuse you :)

altanonymous
11-08-2008, 01:53 AM
ok, since im on my laptop, im TAKING YOU ALL WITH ME! BWAHAHAHAH... :arg:

ah... that makes alot more sense. just use two pistons, and the magnetic key switch's position determines if it is AND or OR function. what was the XOR function mean though? i didnt quite get it. looks exactly like the OR function.

RAINFIRE
11-08-2008, 02:55 AM
oh there are multiple ways to do it

1. Dark matter rectangle going verticle, 4 smaller boxes, 2 cardboard on the outside and 2 dissolve inbetween those two, each switch connected to dissolve block and then when the key and the swithc touch each other the final action happens, you can do this with as many dissolve blocks as you want

2. one box in the middle, pistons on eiter sides and two boxes connected to the other side of the pistons. a switch in the middle and keys on the other 2 boxes, put the pistons at their minimum length and invert the key, put the switches connected to the pistons to direction and when you pass, or put a sticker on, etc. it moves one of the switches.

3. horizontal box of dark matter and 2 cardboard boxes set pistons connected to one side of the wall and another connected to the the box next to it, set the piston length to stretch to the exact middleline between them or a little less, put a key on one box and a switch on the other and when both are extended they activate.

4. verticle or horizontal but i will use verticle for this, ok so verticle box of dark matter, hollow it out, put 2 cardboard boxes, stack them and put a piston on the bottom and on the bottom of the box, connect the two cardboard boxes with another piston, put a switch on the top of the dark matter box, and a key on the highest cardboard box, put each piston to about half of the dark matter box and when both are extended the key should be at the top of the dark matter box, where the switch is and it activates

there are other ways using circles as carriers, like a small cardboard box with keys on them, a lot of them,and they all extend to the inside where the switch is so you can have a lot of "ANDs" if you want

as you can see there are a lot of ways to do "AND" logic, there are i think even more than the ones i have mentioned, and each one has certain advantages and stuff but just play around with it and you should be just fine

Hope this helps!


Cheers!

altanonymous
11-08-2008, 07:04 AM
hmm... would you happen to know a way that, after you press a button, a piston moves over for a specific, dynamic amount of time, and then returns to its origonal position? its related to making my patapon level possible.

what im trying to do is make it so that you have to play a specific rythem to get a response. the drums need to be played in an EXACT order (this case being 1,1,2,3 to go backwards, and 2,2,2,3 to go forward)

Shiwayari
11-08-2008, 11:38 AM
hmm... would you happen to know a way that, after you press a button, a piston moves over for a specific, dynamic amount of time, and then returns to its origonal position? its related to making my patapon level possible.

what im trying to do is make it so that you have to play a specific rythem to get a response. the drums need to be played in an EXACT order (this case being 1,1,2,3 to go backwards, and 2,2,2,3 to go forward)

Attach the button to an emitter and set it to one shot. Make the emitter spawn an object with a lifetime of the time you want the piston to move. Now place a button or a magnetic switch (then the emitted object has to have a magnetic key on it of course) under the emitter, which will then be active as long as the emitted object exists. Set the button to direction and link it to the piston.
The only problem I can think of with this is that if you step on the one shot button again, the emitter will spawn another object which will then exist for the same amount of time again and make the piston go further without going back first.
I'm not 100% sure, but I think a way around this is to make the emitter spawn the object directly on the button/mgn. switch. That way the emitter will not spawn another object if you step on the button again, as long as the first object is still there and "blocks" the spawn position.

Edit: Oh and you probably need a way to prevent the switch from being pressed again as long as it is not at its starting position. For that either make a mechanism block the switch or set up an AND gate like this:
Make the button (the one you press, not the one the emitter presses!) one input of the AND gate. For the other input set up an magnetic switch which will activate if the piston is at its starting position. Link the output of the AND gate to the piston and set it to direction.
This way the emitter will not spawn an object if the piston is not at the starting position, meaning the button will not work in this case.

Edit 2:
XOR means Exclusively OR -> Activates if one of the inputs is true, but not if both (or all if you have more than 2) are true.

altanonymous
11-08-2008, 10:02 PM
since you brought up emmiters, i had an idea. i could box in an emmiter to drop a magnetic key. below that key would be 2 walls moving with pistons. one is connected to the button and inverted, the other is connected and not inverted. that way, when you press the button once, a key is emmited, but blocked. you have to jump one to get it past the first wall, and hit the button again to get it past the second wall. then the key reaches the emmiter.

does that work? i think it can! ohh... im so phyched about this!

OMG! your idea about preventing the emmiter from activating if the piston isnt in it's origonal position, that's pretty ingenious! i had not even thought about that future problem. mucho gracias mi amigos!

Shiwayari
11-09-2008, 12:32 AM
So now that I got LBP I went back to recreate the switches I made in the beta.
While making an improved version of my "two-way" button, I found out that emitters no longer stop spawning objects if another object is already at the same position. No more "blocking the spawn point".
Theres another way to solve the problem though, but you have to use an AND gate and an additional magnetic switch now. It's not that hard to figure out so I don't want to write another blueprint xD. Feel free to ask if you don't know how though.