Logic_case Problem

Kunny

L2: Junior Member
Jan 2, 2017
80
9
I'm having a problem with logic_cases. I am having a logic case that is selecting blocks at random then breaking them. Sometimes the case reselects blocks that have already been broken.
 

Egan

aa
Feb 14, 2010
1,375
1,721
You can try using the logic_case's PickRandomShuffle input instead of PickRandom .

You can also click the Help button in the top right of the entity properties window https://i.imgur.com/iE7Whnr.png for more info on the IO an entity supports.



If that doesn't work (I don't see why it wouldn't, but..) you could add in a fail-safe logic_relay with a delayed Re-Firing of both itself and the PickRandom input of the logic_case:

logic_relay has a CancelPending input to cancel any not-yet-fired outputs (on delays). You could, on the breakables OnBreak output, hit the logic_relay with that CancelPending input.
Code:
logic_relay - OnTrigger - !self - Trigger - on a delay of 1 second
logic_relay - OnTrigger - logic_case - PickRandom - on a delay of 1 second
func_breakable - OnBreak - logic_relay - CancelPending

So the relay constantly re-triggers the PickRandom on the logic_case and itself again (on a 1 second delay, let's say), until an OnBreak output is fired and cancels the relay's outputs. Just hit the relay with a Trigger input to start such a sequence.