Vasmarok on 27/10/2008 at 14:43
Yes, the TrapFlipFlop was a good find. It certainly makes it easier:thumb:
hopper on 10/11/2015 at 21:15
I'm trying to turn an EmitStreamTrap on and off using a button. I've CD linked the button to a marker with the TrapFlipFlop script on it, and then CD linked the marker to the emitter. But it doesn't work. I gave the emitter the Spy script, and it doesn't get any messages.
So then I created a RelayTrap and tried the same with that (while also removing the original TrapRelay script on it). Now the emitter gets messages, but only TurnOn. The RelayTrap with the TrapFlipFlop script doesn't turn every other message into a TurnOff. script.osm is loaded.
I'm at the end of my wits here. Any suggestions would be welcome.
Edit: Silly me, I deleted the TrapFlipFlop instead of the TrapRelay script from the RelayTrap. :o With the same scripts, both work the same way: They send only TurnOn messages to the emitter with TrapRelay, and nothing at all with TrapFlipFlop. Using both scripts at the same time makes no difference: The emitter gets only TurnOn messages.
'Nother Edit: I'm using NewDark, so that might be an issue?
LarryG on 10/11/2015 at 21:55
NewDark should not be an issue. Can you diagram your link setup and provide the details on your object properties?
Yandros on 11/11/2015 at 00:52
TrapRelay will only relay what it receives, and from a button that is only TurnOn, which is why it doesn't alternate TurnOn and TurnOff. I did this just the other day by using NVFrobToggle on the button:
(load NVScript of course)
1. Add S > Scripts and add NVFrobToggle, leave "Don't inherit" unchecked
2. Add Editor > Design note and add NVFrobToggleTDest="&ScriptParams";
3. Link the button to the emitter with a ScriptParams link instead of ControlDevice
The StdButton script on the archetype is needed for it to depress and play the sound, but it will only send signals over ControlDevice, so without that link it won't do anything to interfere with the NVFrobToggle, which is configured to work over ScriptParams instead.
It also occurs to me that you probably need to add the ReloadTweqEmit script to the emitter if it's to work more than once.
R Soul on 11/11/2015 at 01:24
ReloadTweqEmit isn't needed for an EmitStreamTrap. hopper's setup should work (using a marker with TrapFlipFlop), so there's probably one small thing getting in the way. It almost sounds like script.osm hasn't been loaded, but a clarification is needed: hopper, when you say "Now the emitter gets messages, but only TurnOn", do you mean you see that message on screen because of the Spy script, or do you just mean the trap starts firing?
LarryG on 11/11/2015 at 01:32
TrapFlipFlop works just fine, but you have to load public scripts to use it.
Quote:
TrapFlipFlopAlternately relays <kbd style="color: rgb(51, 51, 51); font-size: 1em; line-height: 19.6px; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Bitstream Vera Sans Mono', 'Nimbus Mono L', Monaco, 'Courier New', monospace; direction: ltr; box-shadow: rgb(204, 204, 204) 0px 0px 0.3em inset; border-radius: 2px; background-color: rgb(251, 250, 249);">TurnOn</kbd> and <kbd style="color: rgb(51, 51, 51); font-size: 1em; line-height: 19.6px; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Bitstream Vera Sans Mono', 'Nimbus Mono L', Monaco, 'Courier New', monospace; direction: ltr; box-shadow: rgb(204, 204, 204) 0px 0px 0.3em inset; border-radius: 2px; background-color: rgb(251, 250, 249);">TurnOff</kbd> when it receives <kbd style="color: rgb(51, 51, 51); font-size: 1em; line-height: 19.6px; font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Bitstream Vera Sans Mono', 'Nimbus Mono L', Monaco, 'Courier New', monospace; direction: ltr; box-shadow: rgb(204, 204, 204) 0px 0px 0.3em inset; border-radius: 2px; background-color: rgb(251, 250, 249);">TurnOn</kbd>. The trap control flags and delay time have no meaning for this script.
NVFrobToggle can be used on objects you want to frob. But you can't use it to change successive TurnOns into alternating TurnOn / TurnOff. Again you need to load the osm, in this case NVScripts for it to work.
Quote:
NVFrobToggle (NVTrigger)
When an object with this script is frobbed, either in the world or in inventory (FrobWorldEnd and FrobInvEnd messages), alternating TurnOn and TurnOff messages are sent along its ControlDevice links.
As this is an NVTrigger script, you can use <kbd style="font-family: 'Courier New', Courier, mono; font-weight: bold; color: rgb(0, 0, 102); font-size: small;">NVFrobToggleTDest="[Me]"</kbd> to send the messages to the object itself, rather than along the links; this is of particular use in this case as it can allow you to cut down on objects.
If you want the object to start 'on' (the first frob will send TurnOff, rather than the default TurnOn), use the <kbd style="font-family: 'Courier New', Courier, mono; font-weight: bold; color: rgb(0, 0, 102); font-size: small;">NVFrobToggleStart=1</kbd> parameter.
hopper on 11/11/2015 at 10:19
Thanks everybody for your suggestions!
To clarify: when you say I need public scripts, do you mean script.osm? That package is loaded, and so is nvscript. Monolog tells me so, and besides, Spy is giving me on-screen messages, and it is part of the script.osm package.
R Soul, I meant that Spy tells me on-screen that the emitter only receives TurnOn messages. It also starts firing, of course. This is with TrapRelay on the marker. With TrapFlipFlop, Spy gives me nothing (and nothing else happens).
About NVFrobToggle: If I understand correctly, it will change the behaviour of the button from sending TurnOn with every frob, to sending TurnOn/TurnOff alternately - but only over links with the ScriptParams flavour. So this means that if I link the same button to another object with a CD link, that object will still get TurnOn messages only? Because I want the button to activate another object as well: a Vator going back and forth between two TerrPts (it stops at each TerrPt, and another push of the button is needed for it to move back). This is already set up and working smoothly.
hopper on 11/11/2015 at 11:00
Oh. :o
Thanks!
Yandros on 11/11/2015 at 11:54
You were loading up the old Gaylesaver script.osm?