Home LittleBigPlanet 2 - 3 - Vita - Karting LittleBigPlanet 2 [LBP2] Help!
#1
8-way directional movement
Archive: 4 posts
Having problems creating logic that can detect whether the player is pressing diagonally on either the analog stick or directional buttons. So far I have a couple of direction splitters hooked up to the left analog stick, the outputs from the direction splitters are then hooked into counters that when activated reset each other, so only one counter can be activated at once which hopefully matches the direction the player is pressing. This works fine for 4-way directional movement but when I try to combine signals from the direction splitters to work out if a player is pressing up and right for instance things go crazy. The issue seems to be that my logic doesn't work unless you press the analog stick perfectly in a diagonal direction in 1 frame. I was thinking of adding a 1 or 2 frame delay so the logic would be more lenient to the player but delays suck! Another solution maybe would be to have a circle of holo with a joystick rotator and that activating 8 different magnetic keys, but is there a way to make this 100% accurate? It'd be cooler if it were all-logic so I could put it in a microchip but I'll take what I can get. | 2011-04-05 18:18:00 Author: Ayneh Posts: 2454 |
I had this same problem a while back... What I did was run the different directions (once split) into sequencers set to positional. Then I used a battery at the far end of the sequencer, say 80% or higher, to determine when the player was moving the left analogue stick in that direction. For diagonals, I simply used and AND gate for the two batteries, say up and left, at the same time. Whenever both were true it meant the player was pushing to the upper left. If you need it so only one direction is true at a time, not sure if this would work off the top of my head, but maybe use an AND gate for the diagonal input, and an XOR gate for the single directions individually. That way if the player pushes up and left on the left stick, the diagonal would be true, but not the up or left individually. So run each set of directions through both and AND gate and an XOR gate. (So up is true on its own, but not with left, left is true on its own, but not with up, but when both are true it's diagonal.) Don't have the game in front of me but I think this would work. | 2011-04-05 18:32:00 Author: Unknown User |
I had this same problem a while back... What I did was run the different directions (once split) into sequencers set to positional. Then I used a battery at the far end of the sequencer, say 80% or higher, to determine when the player was moving the left analogue stick in that direction. IIRC the digital aspect of the controlinator output signal already does this kind of 'thresholding' (turns on over 75% and off when it drops back below 25%), so the positional sequencer shouldn't be necessary. | 2011-04-05 22:25:00 Author: Aya042 Posts: 2870 |
I had this same problem a while back... What I did was run the different directions (once split) into sequencers set to positional. Then I used a battery at the far end of the sequencer, say 80% or higher, to determine when the player was moving the left analogue stick in that direction. For diagonals, I simply used and AND gate for the two batteries, say up and left, at the same time. Whenever both were true it meant the player was pushing to the upper left. If you need it so only one direction is true at a time, not sure if this would work off the top of my head, but maybe use an AND gate for the diagonal input, and an XOR gate for the single directions individually. That way if the player pushes up and left on the left stick, the diagonal would be true, but not the up or left individually. So run each set of directions through both and AND gate and an XOR gate. (So up is true on its own, but not with left, left is true on its own, but not with up, but when both are true it's diagonal.) Don't have the game in front of me but I think this would work. Yeah, I had pretty much exactly that setup only the batteries on the sequencers covered the entire strip because I wanted to eliminate the deadzone created by the direction splitters. Thanks for taking the time to write that I'll try making the analog stick deadzone slightly larger and seeing if that makes detection easier tho' I hate to do it. | 2011-04-06 08:07:00 Author: Ayneh Posts: 2454 |
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.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.