Making laser receiver with time requirement
If the two catchers need to be active at the same time you either need
- two logic_branches and one logic_branch_listener OR
- a logic_compare
Hope I could help.
Laser_relay one had a logic_relay called laser_relay_on_1 and laser_relay_off_1
And there was a math_counter called laser_counter that was used to check if they were both fired. (with a maximium legal value of 2)
The laser_relay one had outputs:
Instance:Onpowered; logic_relay_on_1; trigger
Instance:OnUnpowered; logic_relay_off_1; trigger
Logic_relay_on_1:
OnTrigger, logic_relay_off_1; cancelpending 0.00
Ontrigger, laser_counter; add; 1; 1.00
Logic_relay_off_1
OnTrigger, logic_relay_on_1; cancelpending 0.00
OnTrigger, laser_counter; subtract; 1; 0.05
then the same for the second relay but with 1 replaced by 2.
Then have laser_counter, onhitmax, <<what you want to do>>
El Farmerino wrote:
And I didn't know about the cancelpending command either - very handy!
Well, ever since I discovered it, I use it all the time overall for every element that allows at least 2 possibilities. on and off (closed/open, disable/enabled, etc.). It's crucial to avoid bugs. It's important to have always a pair of relays where the first thing each does is to cancelpending the other... and the the rest settings you need with a delay of 0,20 secs for example...