Create/Change exit to ... Script?

Anonymous
24 Apr 2004, 20:59
I know you can create/change an exit but what I want to do is change an exit not to another room but to a script command. Is this possible and if so how?

billchelonis
27 Apr 2004, 16:20
Hi. First time posting on this forum. Anyway perhaps I can help answer this. I think what you're asking is can you create something like a door object in a room, right? Something that goes to another location but does not show up on the compass or exits list, right? If that's what you mean then I think I know how you'd do that. Create a door object in the start room and one in the end room (if you want a 2-way door), and on each door object you'd have properties (variables) like so:
IsOpen=0
IsLocked=0
KeyTag=DEFAULT_KEY_TAG
DestroyKeyOnUse=0
DestinationTag=MyOtherRoom
DestinationDirection=North
DestinationDoorTag=MySecondDoorObject
DoorStuckAfterOpen=0

Also for OOP make sure to set object type as "door."

Setup the second door like the fist but change your variables accordingly, then make an "open" and "close" script (and "lock" and "unlock" if you want" for completeness). The variables on the object itself are checked from your open/close script. In the setup above if you opened that door object the script would create a room exit north to destination "MyOtherRoom." Optionally you can just have it teleport the player there and not create an actual literal exit. Is this sort of what you wanted to know?

By the way I sort of snagged the door idea from the Neverwinter Nights door object. Works great but you have to setup the variables by hand in the start and end rooms, but once you get the hang of it it's pretty simple. My question now to the developer of Quest is... is there a library out there already that includes things like door objects? You know, just some global user group library to get everyone up to some set standard and also so we're not reinventing the wheel? If so it would be nice to be able to drag those objects from a picklist from the library and into your game world in the QDK pro editor. Just an idea.

[edited]
Oh... re-read the question. If you meant can you make it so when a player clicks on the "north" arrow (for example) that the click action then launches a script... um... Don't know if that can be done. A workaround is to make an exit to a dummy room somewhere and have the "when the player enters the room" script launch the code you want and then send the player back to the start room without reading off the dummy-room's room description.

Anonymous
27 Apr 2004, 18:07
Well the door thing is interesting but your right, not what I was looking for. Although I might use something like that sometime in the future. The idea of the dummy room did get me thinking.

But I didn’t need a dummy room. What I did is if a certain condition was met I ran a procedure that would turn off the output, move the player back, turn the output back on and then run the script I wanted to in the first place. The player never realizes they went anywhere. A bit strange but it works.

Thanks for the ideas.