LarryG on 27/10/2008 at 05:44
I have hooked up an elevator between two TerrPts. I have a lever which when down sends the elevator down, and when up sends the elevator up. I want to replace the lever with a toggling button. So I set up a marker and gave it the TrapFlipFlop script. The button is the control device for the marker. The marker is the control device for the elevator, replacing the lever.
I think it is supposed to work this way. The first time the button is pushed in, it sends a TurnOn to the marker which sends a TurnOn to the elevator. The next time the button is pushed in, it sends a TurnOn, which the marker's TrapFlipFlop turns into a TurnOff and sends to the elevator. So each button push emulates flipping a lever, just using a button instead.
Only it doesn't. In fact, it doesn't appear to be doing anything. If I hook the lever back up, it works just fine.
So there must be something wrong with the theory. What?
Is there a way for me to observe the signals being sent between these objects? I really would like to see what is actually happening. Is there a debug mode that writes this stuff to monolog?
jtr7 on 27/10/2008 at 06:41
Would the commands show_stats and the stats_full toggle help in this case? EDIT: Nope, never mind. :cheeky:
Nameless Voice on 27/10/2008 at 10:11
You can use one of the "spy" scripts from a custom script module. They report script message information on their object.
TrapFlipFlop is not a standard script as far a I know.
Of course, you could just link the button to the elevator itself, which should tell it to simply go to the next stop.
Yandros on 27/10/2008 at 10:41
I've not heard of TrapFlipFlop. Are you sure you don't mean NVFrobToggle?
LarryG on 27/10/2008 at 13:47
From the documentation for Public Scripts 2.0
TrapFlipFlop
Alternate between TurnOn and TurnOff.
Script: TrapFlipFlop
Inherits: BaseScript
Messages: TurnOn, TurnOff
This trap only responds to TurnOn. Each time it is triggered, it will send either TurnOn or TurnOff, alternating between the two. The Invert and Once trap control flags will be used.
Revision History
Beta 1 - 2006-12-30
[INDENT]Adjustments for compatibility with MSVC.
Drop FrobSounds, StopHere, and TrigBraindead from T1. They're already in Thief Gold.
TrapFlipFlop initializes on BeginScript.
Add IntrinsicText. Affects IntrinsicCover and IntrinsicPlaque.[/INDENT]
So I sort of thought that TrapFlipFlop was a "standard" custom script. It seemed to be just what I needed, more direct than NVFrobToggle. But maybe I should try NVFrobToggle instead.
Nameless Voice on 27/10/2008 at 13:55
Well, did you load script.osm?
LarryG on 27/10/2008 at 13:57
Quote Posted by Nameless Voice
Of course, you could just link the button to the elevator itself, which should tell it to simply go to the next stop.
The problem with linking the button directly is that the button only send a TurnOn and so the elevator gets stuck at the bottom if you hook up the elevator to the button directly.
Also I want to be able to have three buttons in three different locations hooked up so that a single button push will send the elevator to the other TerrPt. Hooking a switch to the elevator instead of a button works with one control device, but you then need to worry about synchronizing multiple switches for what I want to do. TrapFlipFlop seemed custom made to my needs. It is supposed to remember what to send each time it gets a TurnOn and it is supposed to ignore TurnOffs. I just can't make it work!
I could use double buttons at each location and link them normally, but that would mean lots of buttons. Aestheticly, and, now, out of bull-headedness, I want to have only a single button at each location to send the elevator to the next TerrPt in the loop at each press.
Vasmarok on 27/10/2008 at 13:58
Quote Posted by Nameless Voice
Of course, you could just link the button to the elevator itself, which should tell it to simply go to the next stop.
StdElevator script "Listens for TurnOn and TurnOff and will move to the lowest or highest point (respectively) in the terrain path." Unfortunately, a button will send only a TurnON, so you will need more to move it with a button. We just had a similar discussion in another thread.
Edit: Larry I believe you started that other thread: (
http://www.ttlg.com/forums/showthread.php?t=123413&highlight=elevator)
LarryG on 27/10/2008 at 14:18
Quote Posted by Nameless Voice
Well, did you load script.osm?
I did.
.
.
.
I swear I had. :o
Works now.
Thanks NV.:thumb:
LarryG on 27/10/2008 at 14:22
Right, and I never had it working properly with double switches, let alone triple. There was a synchonization issue which required double throws some times. So I kept looking at scripts until I found TrapFlipFlop. But when that seemed to be n/g, I decided to ask about it specificly rather than continue the older thread.
But now I have a 3 button solution which works like a champ. So happy I am.