slavatrumpevitch on 24/4/2017 at 21:35
I'm trying to make a combo switch lock as follows:
There are 10 switches, if you have the correct 5 of them flipped, a door will open. I have the correct 5 hooked up directly to a RequireAll trap, and the remaining five hooked up indirectly via a RequireAny trap and an inverter. This works in the sense that the door will only open if the correct 5 (and only the correct 5) are flipped---i.e., correct 5 switched is a necessary condition. But this doesn't seem to be a sufficient condition. If I hop into game mode and immediately flip the correct 5 switches, nothing happens. But then, if I flip one incorrect switch on and then back off, then the gate opens.
Why won't it work off the bat? Why does it need an incorrect input first?
LarryG on 24/4/2017 at 22:15
The RequireAny trap won't send a TurnOn until a state change on one of the 5 linked switches. So the inverter won't send a TurnOn until one of the switches gets switched on and then off.
slavatrumpevitch on 24/4/2017 at 22:55
Interesting... Is there an easy workaround? Perhaps I'll need to build it again from the ground up.
LarryG on 25/4/2017 at 00:29
You could do a double frob on one of the switches at Sim. I like using an NVRelayTrap for that. (NVRelayTrapOn="Sim"; NVRelayTrapOff="Null"; NVRelayTrapCount=1; NVRelayTrapTOn="FrobWorldEnd"; NVRelayTrapRepeat=2; and so on)
slavatrumpevitch on 25/4/2017 at 02:21
sorry but I guess I'm too much of a noob, and don't quite know how to implement that.
I loaded nvscript, and placed an NVRelayTrap script on a switch. Then, under design note, I copy and pasted what you provided:
NVRelayTrapOn="Sim"; NVRelayTrapOff="Null"; NVRelayTrapCount=1; NVRelayTrapOn="FrobWorldEnd"; NVRelayTrapRepeat=2;
(I corrected what I assume was a typo in NVRelayTrapTOn="FrobWorldEnd")
But it's still not working. What am I doing wrong?
Thanks so much!
Yandros on 25/4/2017 at 02:26
That wasn't a typo, change it back to NVRelayTrapTOn. And then add NVRelayTrapTDest="[me]" to the design note so it targets itself. Otherwise you could put all the NVRelay stuff on a marker and CD-link it to the lever.
slavatrumpevitch on 25/4/2017 at 02:42
Thanks, I'm getting closer but still not there. If it set NVRelayTrapCount to an odd number, the switch is in the on mode when I enter the game, but everything works as it should. If I set it to an even number, the switch is in the off mode (as desired) but the original problem persists. It's as if the switch had always been off, rather than toggled a non-zero, even number of times...
Yandros on 25/4/2017 at 03:34
Try adding a delay between the frobs: NVRelayTrapDelay=500;
john9818a on 25/4/2017 at 03:49
I haven't had time to test this, but what if you CD link a lever from the inverter to the RequireAllTrap and set the lever to On? This lever will serve as a phantom 6th lever needed to satisfy the conditions of the RequireAllTrap. When any of the five bad levers is turned on the inverter will send an Off to that lever and disqualify the condition of the RequireAllTrap.
Btw I didn't mean to interrupt the current solution being posted. :o
slavatrumpevitch on 25/4/2017 at 03:57
Success! Thanks Yandros!
John, your idea is intriguing too. I might try that next time. For now, just happy I got it up and running! Cheers, all :)