[SOLVED] Removing an Item from a logic_case?

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
I don't think this is possible, but I've seen maps where a random action is done and then not done again.

using a logic_case and the input of PickRandom I can get the logic_case to fire outputs from OnCase[numb], although each time a random option is picked it has the possibility of being picked again. How would make it that after a random option is picked, it's done with and the next time a PickRandom input is fired, only the other cases have the possibility of being picked?
 

killohurtz

Distinction in Applied Carving
aa
Feb 22, 2014
1,016
1,277
If you send PickRandomShuffle instead of PickRandom, it will go though the cases in random order with no repeats, though it starts over after that so you'll have to suppress the I/O if you want it to stop there.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,258
999
You can also set each output of the logic_case to 'Fire once only'.
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
You can also set each output of the logic_case to 'Fire once only'.
Won't that just make it so that if that case is picked twice, nothing happens?
I want it to pick a different case, not just make nothing happen.
killohurtz's suggestion works perfectly
 
Last edited:

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,258
999
A case output can't be picked if it doesn't exist. If logic_case worked like that, you would need to fill all sixteen case outputs. When an output is fired, and it has been set to fire only once, it is removed.

If you only want each output to fire once and never be repeated, then you would need to limit the number of times the logic_case is used so it doesn't exceed the number of outputs. To do that, you would either set up individual inputs for each output (e.g. if you had sixteen case outputs, have sixteen input events rather than the same one reused) or a math_counter. The former option could be harder to debug and the latter would use an extra entity.