I need help with applying lists to my games

I spent a lot of time reading and figuring out how to use lists (thanks code alpaca for posting that one thing on them) and I get how they work but not how to use them to do what you want. I need it to select what things you have chosen out of a wide categorie and then randomly choose one.

1 Like

Write now I’m just using globals, randoms, filters, and routers.

can you state your question better?

Yeah the question being asked is a bit unclear.
It sounds kind of like this
You have numbers from 1-100
Then you pick 20 of those numbers
Of those 20 are picked, randomly select one. Is that correct?

If so, which parts do you have done? And any additional context would be great :+1:

2 Likes

So you select some things and it adds a number specific to each thing you have selected so like you can choose the stuff you want. And later it needs to randomly choose some of the numbers and choose animations based off of what the numbers are.

Add the numbers to a List
Shuffle the List (With the “List Modify” behavior)
“Pop” the however many items you want from this shuffled List

I made a number randomizer a while ago, will this work for you?

1 Like

Hey, your code and examples are getting pretty good!

2 Likes

Oh, thank you! I am learning every day, and I learn from your examples too!

2 Likes

How do you make it so it changes the list based off of things you click and then it randomly chooses one. And if you save a list will it save the whole list.

1 Like

Are you wanting a random list? Like a set of numbers all between 1 and 20 for example?

If you do want something like that, here is what you’ll want to do;

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":-90,"y":-16,"group":"c716dd954b7a324c","id":"c7170e0d5e964f49","portId":"c716dd954b7a324co0","tag":"List","dataType":3},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":90,"y":64,"group":"c716dd954b7a324c","id":"c71730161bf96144","portId":"c716dd954b7a324co1","tag":"Done","dataType":2},{"inputCount":7,"outputCount":5,"name":"Number List","behaviorType":"logic.data.NumberList","x":-270,"y":0,"group":"c716dd954b7a324c","id":"c7176e8a53fdf345","startVal":[]},{"inputCount":1,"outputCount":1,"name":"Number List Count","behaviorType":"logic.data.ListCount","x":-90,"y":64,"group":"c716dd954b7a324c","id":"c71798533a808c46"},{"inputCount":3,"outputCount":1,"name":"Random","behaviorType":"logic.logic.Random","x":-450,"y":-64,"group":"c716dd954b7a324c","id":"c717ce66a149f249","min":1,"max":25},{"inputCount":2,"outputCount":2,"name":"Repeater","behaviorType":"logic.logic.Repeater","x":-630,"y":16,"group":"c716dd954b7a324c","id":"c7185a2e8e299c43","repeatCount":10},{"inputCount":0,"outputCount":1,"name":"Once","behaviorType":"logic.triggers.Once","x":-810,"y":48,"group":"c716dd954b7a324c","id":"c718b70681b12444","resetOnLevelStart":false},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":-810,"y":-64,"group":"c716dd954b7a324c","id":"c7198dffb5785b46","notes":"How many numbers do you want in the list?","n_o":1,"startVal":10,"tag":"Count","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":-630,"y":-176,"group":"c716dd954b7a324c","id":"c71a2a3d45e38445","startVal":1,"tag":"Min","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":-630,"y":-80,"group":"c716dd954b7a324c","id":"c71a3e7ee429ac45","startVal":25,"tag":"Max","roundMode":1}],"links":[{"input_id":"c7170e0d5e964f49i0","output_id":"c7176e8a53fdf345o0"},{"input_id":"c71730161bf96144i0","output_id":"c71798533a808c46o0"},{"input_id":"c7176e8a53fdf345i1","output_id":"c717ce66a149f249o0"},{"input_id":"c7176e8a53fdf345i2","output_id":"c7185a2e8e299c43o1"},{"input_id":"c7170e0d5e964f49i0","output_id":"c7176e8a53fdf345o0"},{"input_id":"c71798533a808c46i0","output_id":"c7176e8a53fdf345o0"},{"input_id":"c71798533a808c46i0","output_id":"c7176e8a53fdf345o0"},{"input_id":"c71730161bf96144i0","output_id":"c71798533a808c46o0"},{"input_id":"c717ce66a149f249i0","output_id":"c7185a2e8e299c43o0"},{"input_id":"c717ce66a149f249i1","output_id":"c71a2a3d45e38445o0"},{"input_id":"c717ce66a149f249i2","output_id":"c71a3e7ee429ac45o0"},{"input_id":"c7176e8a53fdf345i1","output_id":"c717ce66a149f249o0"},{"input_id":"c7185a2e8e299c43i0","output_id":"c7198dffb5785b46o0"},{"input_id":"c7185a2e8e299c43i1","output_id":"c718b70681b12444o0"},{"input_id":"c717ce66a149f249i0","output_id":"c7185a2e8e299c43o0"},{"input_id":"c7176e8a53fdf345i2","output_id":"c7185a2e8e299c43o1"},{"input_id":"c7198dffb5785b46i1","output_id":"c718b70681b12444o0"},{"input_id":"c7185a2e8e299c43i1","output_id":"c718b70681b12444o0"},{"input_id":"c7198dffb5785b46i1","output_id":"c718b70681b12444o0"},{"input_id":"c71a2a3d45e38445i1","output_id":"c7198dffb5785b46o0"},{"input_id":"c71a3e7ee429ac45i1","output_id":"c7198dffb5785b46o0"},{"input_id":"c7185a2e8e299c43i0","output_id":"c7198dffb5785b46o0"},{"input_id":"c71a2a3d45e38445i1","output_id":"c7198dffb5785b46o0"},{"input_id":"c717ce66a149f249i1","output_id":"c71a2a3d45e38445o0"},{"input_id":"c71a3e7ee429ac45i1","output_id":"c7198dffb5785b46o0"},{"input_id":"c717ce66a149f249i2","output_id":"c71a3e7ee429ac45o0"}]}}}

No, it saves a list of numbers you choose and then retrieves that list somewhere else and randomly picks one. (sorry for being bad at explaining stuff btw.)

1 Like

Oh, ok. I think I am getting the idea now.
When you press a button, have it send a number list to the randomizer, and use the list input on the ‘Custom Number Randomizer’ I made.

Well… So you make a team right. So it saves numbers in the list for each thing in your team and then later you randomly get someone from your team so it gets that list, and chooses a random number.

1 Like

Just a question, how do you save a whole list?

1 Like

You can switch a save function to save number list!!!
blow-mind-mind-blown

1 Like

The team list can be inputted into the bundle. Then use the ‘new’ input.

Ha. Yes, there is one for that, also I have made a Save+ bundle. This lets you save different lists in one save. It’s good for a inventory, or save slots.

I replied to your help request before you know

1 Like

Oh wait thought this was a different topic lol

1 Like