ZylonBane on 28/7/2013 at 02:27
In SS2, there's a script "LevelChangeButton" that you can put on on a button. When you frob the button, it loads the specified level. Pretty simple. What I'd like to do instead is invoke this script via a tripwire. My random flailing about has thus far yielded no success. I'm guessing I need to have the tripwire send a FrobWorldBegin message to a marker with the level change script on it, but I have no idea how to go about actually doing that. I'm hoping it doesn't require conversations and blue rooms.
Yandros on 28/7/2013 at 03:52
NVRelayTrap can easily send a FrobWorldBegin or FrobWorldEnd message to a marker with that script on it. Or for that matter, make it an actual button but stick it outside of any roombrush so the player doesnt hear it being frobbed. Your trigger, then, be it a bounds trigger or whatever, would just need to send TurnOn (or the SS2 equivalent) to the NVRelay. (
http://thiefmissions.com/telliamed/allscripts.html#levelchangebutton) Telliamed's docs for that script mention FrobWorldEnd, not Begin, by the way.
ZylonBane on 28/7/2013 at 05:41
I figured it would be FrobWorldBegin since buttons fire immediately when clicked on.
So, I can't get this to work. I have a tripwire switchlinked (CD linked) to a button. The tripwire has NVRelayTrap, with Objlist Arg 'NVRelayTrapTOn=TurnOn;NVRelayTrapTDest="&SwitchLink"'. I'm thinking I should see the button activate when I walk into the tripwire, but nothing's happening. Same when the message is FrobWorldBegin and FrobWorldEnd.
Yandros on 28/7/2013 at 14:41
I assume a tripwire is like a bounds trigger? It sends TurnOn down its links when the player collides with it? Perhaps you need the NVRelayTrap on a marker and switchlink the tripwire to that marker normally, like it was any other trap. NV may have to help out here, since he's familiar with ShockEd (at least more so than I am).
ZylonBane on 28/7/2013 at 16:53
Yeah, a tripwire (or trap... I'm not entirely clear on which term is most correct for these things) is a box that makes things happen when players/AIs enter or leave it.
So good news, thanks to NVSpy, figured out which messages I needed to be catching/sending. Ended up with a two-object setup--
Tripwire, with NVRelayTrap, parameters: NVRelayTrapOn=PhysEnter; NVRelayTrapTOn=FrobWorldEnd
Control linked to an instance of the "base" button class, with the level change script.
Seems to work great so far. I tried a single-object configuration, putting the BaseButton and level change script on the tripwire object and sending the frob message to itself, but for whatever reason that didn't fire.
EDIT: Well, almost there. Just triggering on PhysEnter causes it to fire on everything, even thrown objects. Adding the usual player-only control flag has no effect. Looks like I'll be doing a three-object setup after all.
Nameless Voice on 28/7/2013 at 22:22
Couldn't you just use the TrapTripLevel script instead? It's for a tripwire that triggers a level transition.
Note that it will not transport elevatorable objects - you'll need to use the LevelChangeButton script for that.
Also note that you could put the NVRelayTrap on the button itself, and have it convert TurnOn into FrobWorldEnd
NVRelayTrapTOn="FrobWorldEnd"; NVRelayTrapOff="Null"; NVRelayTrapTDest="[Me]";
(The null on off is to stop it infinitely sending turnoff to itself in a loop.)
Finally, you could save a script and object by using the NVTrigOBB script on your tripewire instead of the usual script.
NVTrigOBBPlayer=1; NVTrigOBBTOn="FrobWorldEnd;" NVTrigOBBTOff="Null"; NVTrigOBBTDest="[Me]";
And then put the level change button script onto the tripewire too.
ZylonBane on 28/7/2013 at 22:54
Yeah, I specifically want to elevator objects. There's no TurnOn-aware script in SS2 that does elevatoring.
Thanks for the object-saving tips. This script business is all new to me.
EDIT: The single-object solution worked perfectly. Huzzah!