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

How to prevent a selector cycling back on itself.

Archive: 19 posts


Hey, I'm Bang126, recently my friend asked me how to prevent there menu selector, only go up and down and not loop back, so I came up with this, when you reach the first/last output it prevents it from looping back.

So, with this method, we are using two inputs, so that we can any direction on a selector, at our choosing. You achieve this by using a direction combiner, and connecting the two inputs to the combiner. Connect the combiner output to the selecotr cycle input. Now when connecting to the combiner, remember the rules of the X and Y axis, positive means Up/Right, negative means Down/Left. So the input you want to go up an output, connect to the positive input ofthe direction combiner and visa versa for the negative input, here's a little picture to explain this:


http://ic.lbp.me/img/ft/dfc623c2ef5ba2f9700b9e5f87423873a3fbd904.jpg

Now, withthat method, the selector can loop, but you might not want that, say you're making a Menu or something similar, here's how we solve that...

Set up as before, but get out two 'And gates' and connect each one to our combiner inputs, then connect Not Gates to each of the 'And Gates'. Then to the other 'And Gates' inputs, connect the normal inputs that would be there if it were to be looping (like in previous example). Now, this is the slightly confusing bit, take your first selector output, and connect it to the 'Not Gate' on the positive side, then take the last selector output and connect it to the 'Not Gate' on the negative side. Here's a picture detailing this:


http://i9.lbp.me/img/ft/c5930bbb342bd8617c4180581e046fa232881d1d.jpg

http://i2.lbp.me/img/ft/922a7da81d9aa52a274435500cf1711e978e96d3.jpg

How does it work?:

Well, it's simple really, whenever the first and last selector parts are activated, it shuts off the signal, preventing it from looping back on itself..

EDIT: Pictures Added
2011-07-16 14:07:00

Author:
Bang126
Posts: 157


Helpful tutorial man, I'm sure many wanting to make menus will use this, but I already knew this. Than again, I never post tutorials 2011-07-16 14:31:00

Author:
Unknown User


IMHO menus that loop are good, they let you move to the bottom faster. More user-friendly. 2011-07-16 14:36:00

Author:
Rogar
Posts: 2284


IMHO menus that loop are good, they let you move to the bottom faster. More user-friendly.

I put that just as an example, obviously, you choose what you see fit when making a menu. The purpose my friend had needed it for was to cycle values of 100%, but he didn't want it to loop from 100% back to 0% as that'd look odd.
2011-07-16 14:48:00

Author:
Bang126
Posts: 157


another way you could achieve this is to put a timer on the last selector branch you are using connected an empty selector branch right below it. As long as you do not have an input into the reset port of the timer, it will always stay on making the empty selector infinitely lit. You're way is good too but you really don't need all that overly complicated logic when one tool can do the same job, unless you like that kind of thing <32011-07-16 16:51:00

Author:
tabycatmeow
Posts: 52


another way you could achieve this is to put a timer on the last selector branch you are using connected an empty selector branch right below it. As long as you do not have an input into the reset port of the timer, it will always stay on making the empty selector infinitely lit. You're way is good too but you really don't need all that overly complicated logic when one tool can do the same job, unless you like that kind of thing <3

Tabycatmeow as a good point, but what would you use it for? I know it will reset back to the bottom but I rather go up and down with mine, that just my preferences(I think I spelled that right) XD
2011-07-16 17:59:00

Author:
zzmorg82
Posts: 948


i'm sure he has a good reason for wanting his selector to go one way. I use selectors but I make this do a bunch of things, they can either go in order up or down or straight to the selector. I have made 30 selectors all linked on one of my levels that all do different things and work only when they are instructed to with certain named tags.

The only reason I could think you would need a one way selector and have locked in place is if after using the selector for making the choice to start, they same selection ques are used in the game as well, which would cause the menu to change as well. If this is case, why not put a destroyer on the menu chip to disappear to simply get rid of it and free up the thermo ?
2011-07-16 22:48:00

Author:
tabycatmeow
Posts: 52


The only reason I could think you would need a one way selector and have locked in place is if after using the selector for making the choice to start, they same selection ques are used in the game as well, which would cause the menu to change as well. If this is case, why not put a destroyer on the menu chip to disappear to simply get rid of it and free up the thermo ?
The circuit in the opening post is handy for other things like changing gears in a car, where you don't want the selector to loop.

Another use would be to count any arbitrary active signal, such as a signal hooked up to a score giver, and limit it to a set number of times it could be activated to limit the highscore.

Maybe you have a set number of items the player can use and you don't want the item count to loop back to the top after they've used them all, but you want to be able to give the player multiple numbers of those items at once which is what the input ports of the selector would serve as.
2011-07-17 02:13:00

Author:
Ayneh
Posts: 2454


I think maybe tabycatmeow and zzmorg82 are misunderstanding the working of the OP set-up. It's not locking a selector, it just uses AND gates to block the cycle input from making the selector cycle up when at the top and down when at the bottom.2011-07-17 20:41:00

Author:
Rogar
Posts: 2284


I use a setup like this in the logic for weapon upgrades in my level; each weapon has 5 steps a player goes through and obviously I wouldn't want it to loop back to the first state. 2011-07-17 22:31:00

Author:
Antikris
Posts: 1340


Or... maybe you do...



Actually after reading the idea of gears I was thinking of combining this with some speed sensors to track and allow extra speed boosts, and the same thing, it wouldn't be good to cycle through. You know, pick up a few speed boost orbs or what-have-you, making sure one too many keeps you in top gear rather than sending you back to the slow setting.

Although an override on the first port to drop you back to square one for weapon upgrades and my speed thing would be a good thing to include gameplay wise.

You know... you hit an enemy and you loose all that built up speed.
2011-07-18 09:25:00

Author:
Mr_Fusion
Posts: 1799


Didn't read the whole thread, but for those of you who are thinking this is just for menus, I use this method for keeping a limited inventory in action/adventure/RPG style games... Like a bomb bag that can only hold 10 bombs... Yeah. It is great for that.2011-07-18 09:40:00

Author:
poorjack
Posts: 1806


http://i2.lbp.me/img/ft/922a7da81d9aa52a274435500cf1711e978e96d3.jpg[/CENTER]

How does it work?:

Well, it's simple really, whenever the first and last selector parts are activated, it shuts off the signal, preventing it from looping back on itself..

EDIT: Pictures Added

A helpful tutorial, but I think the picture (and text description) is slightly incorrect/reversed, and the logic therefore not working as intended...
You need to have the 1st output go through the not gate to the negative(-) side of the combiner, and the 4th output to through a not gate to the positive(+) side.

Otherwise than this it looks mighty fine, and should prove useful to many aspiring creators
2011-07-18 13:12:00

Author:
Slaeden-Bob
Posts: 605


Didn't read the whole thread, but for those of you who are thinking this is just for menus, I use this method for keeping a limited inventory in action/adventure/RPG style games... Like a bomb bag that can only hold 10 bombs... Yeah. It is great for that.

I have a set up similar to this for an RPG battle system I'm working on. I'm using multiple selectors and outputting certain values from the selectors to tags... when some number of those tags are active, it reads as "full HP" and won't allow the player to go over the max. Using multiple selectors with tags allows you to have different tags for different levels so that you can increase your max HP without needing to emit a new counter system. You just turn off the "level 1" microchip and turn on the next.
2011-07-19 19:38:00

Author:
shane_danger
Posts: 283


Now, this is the slightly confusing bit, take your first selector output, and connect it to the 'Not Gate' on the positive side, then take the last selector output and connect it to the 'Not Gate' on the negative side.

That's wrong: down in this case is the positive since it is moving toward the end of the selector, so wire up the first output of the selector to the negative, and vice versa.
2011-07-20 20:28:00

Author:
L1N3R1D3R
Posts: 13447


You could also have 2 extra selector ports, one on the top and bottom, and plug the top output into the second to top input, the bottom output into the second to bottom input. Works exactly the same and you don't need all the extra components.

Don't use the very top and bottom outputs for anything thing else obviously, they're just the edge detection, well, unless you need a one shot at the edges of the menu for any reason.
2011-07-21 22:24:00

Author:
Epicurean Dreamer
Posts: 224


Wow, thanks for the tutorial!2011-07-23 14:10:00

Author:
TheGoldenFlash
Posts: 209


You could also have 2 extra selector ports, one on the top and bottom, and plug the top output into the second to top input, the bottom output into the second to bottom input. Works exactly the same and you don't need all the extra components.

Don't use the very top and bottom outputs for anything thing else obviously, they're just the edge detection, well, unless you need a one shot at the edges of the menu for any reason.

Yes but this method, although a lot simpler, does activate the last one for a split second, whereas mine blocks it completely...
2011-08-06 23:41:00

Author:
Bang126
Posts: 157


But you just need an or gate for the two tops and the two bottoms like this
http://i6.lbp.me/img/ft/8964ef0e8f9bee07604504012042b9ba2ce1df78.jpg
God I love LBP.me
2011-08-07 18:41: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.