(Solved) Default message for any unused command in a specific room

I want to know if there is a way to catch any unused or mistaken commands and present the user with a default message, once I can do that I can easily have specific messages to whichever room you are currently in. Can someone point me in the right direction?


I'm not exactly sure if this is what you're asking for, but there's the 'unresolved' String/Script Attribute for Commands:

http://docs.textadventures.co.uk/quest/elements/command.html

but it only catches an inputted Object that doesn't exist within its scope/location


If the game element has a script attribute named unresolvedcommandhandler, it will be used when the player types an unrecognised command. Within that script, you can assume that there is a local variable named command, which will contain what the player typed (minus any spaces at the beginning or end, I think, but not entirely sure about that)

If you enable the "advanced scripts" feature in the editor, you can edit this script on the "advanced scripts" tab.


Hey thanks, the Advanced Scripts default command did the trick so I added the player object as one of the parameters to know the current location for a specific message per room by using the .parent attribute and then checking other room attributes using HasAttribute().


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

Support

Forums