displaying a message after choosing an exit

I'd like my player to be able to choose an exit, and then have Quest first display a message, then move them to the new room. And I'd like to be able to configure a different message for each exit in each room, or leave the exit alone and not display one.

Right now, when I type s (for example), the game happily puts me in the room to the south, but there are times when I might like it to first display something like "you walk up a hill, following the stream." and then show the new room.


Well you have two options here. First would be the "run a script" check box in the exit tab of the exit itself. which allows you to make the exit run a script when the player tries to use it. The downside is this overrides the built in movement part of the exit so you have to move the player within the script which can get tedious if used a lot.

The second option is trickier to setup but may result in less overall coding if you're planning to use this a lot. The second method is to create a custom version of the 'go' command, which you do by enabling library elements to be displayed and locating the 'go' command and then hitting the button to create a copy of it, which will then allow you to modify the actual code. Note that I'm not sure if this is possible in the online editor. From there you'll see the 'go' command has an 'if else' block for when an exit is locked and whatnot. What you'll want to add to is the final 'else' since this is what happens when an exit is normally usable. From there I'd add a message display right before the movement that checks the an attribute of the exit itself for a description string and show it if it exists. Then you just need to create that attribute on any exit that has a special movement message.


Ah. Very good. I'm using the desktop version, not the online. I don't want this on every exit in the game, just specific ones, so running a script for those will probably work best. Thanks for the assist.


no problem, figured the exit scripts should be enough but doesn't hurt to know at least one alternative.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums