View Single Post
Old 09-07-2004, 04:20 AM   #8
Molly
Senior Member
 
Join Date: Apr 2002
Location: Sweden
Home MUD: 4 Dimensions
Posts: 574
Molly will become famous soon enoughMolly will become famous soon enough
Angie: I always try to avoid entire phrases as keywords, so as not to limit the script too much. Unless of course the phrase is some kind of 'invocation', in which case I always make sure that the EXACT phrase is written down somewhere in the zone, (maybe on a paper that the absentminded mage put in a hidden drawer, to remember the wording himself). But otherwise I just use single keywords, and try to guess at things the player might say.  

In DG_scripts there is a very useful if-check:
if (%speech.contains(keyword)%

This enables you to use the same script for as many keywords as you like, meaning that you'll have one long script instead of several short ones.

Using the if-check you can for instance make the mob respond with the same phrase to the same keyword with and without questionmark:

if ((%speech.contains(john)%)||(%speech.contains(john ?)%)
 say whatever
endif

( The || sign stands for 'or' )

You can also make the same script respond to an infinite number of names or keywords, giving different responses to each name.

In some of our zones the heavily scripted quest mobs may answer to around 30 different names or words, sometimes giving random replies to the same name. This makes for a great variety, and also makes the mobs seem at least semi intelligent. You can actually engage in a conversation with some of them.

Usually it is set up so that one response from the mob would automatically lead to a new question from the player, and in this way they can work their way to a solution by just talking to a mob. In other cases the mobs are just set up to drop random hints, so that you may have to speak to 5 different mobs before you figure out what to do next. And in yet other cases the mob responses are just set up to add to the atmosphere of the zone, like citizens of a town exchanging idle gossip with a stranger.

It's always up to the player to decide what is useful information and what is not.
Molly is offline   Reply With Quote