[crossfire] Dialog modification

Nicolas Weeger nicolas.weeger at laposte.net
Sun May 11 12:53:32 CDT 2008


Well, I did rewrite a big part of the dialog system.

The server will now display a list of possible choices, as defined by the map 
maker.

At some point I'll add either a special message type or some way for the 
server to send the value/message pairs to the client in a format that can 
easily be parsed for menu display or such.



From doc/Developers/objects:


The message structure in a monster may contain:
@match <key>|<key>[...]
[@reply value message] (multiple possible)
[@question value message] (multiple possible)
  [text]
[...]

This identifies what the monster will say if talked to with a text that 
matches
any keys.  They keys are processed as primitive regular expressions, so some
characters act as match operators or metacharacters.  The asterisk, caret,
square braces, and dollar characters are useful to some degree.

The '@reply' and '@question' lines will be sent to the client so the player 
knows available replies.
The 'value' is a text that should correspond to a @match, and 'message' is 
what the player
will actually say when saying the 'value'. If using '@reply', the server will 
display 'player replies: message',
with '@question' it will be 'player asks: message'.
Note that the order of @reply and @question is non significant, they can be 
mixed, and can probably be
in the middle of the message's text (though easier to put'em at top).
Also, 'value' can't contain spaces.

An example of usage:

@match hello|hi
Welcome, good friend!
@match bye
Goodbye!
@match sss
@reply yes Yes, isn't it a shame?
@question no No, why?
Whasssamatter?  You got a lisssp or sssomething?
@match yes
Sssorry, me too.
@match ^no$
You're lucky!
@match *
What did you sssay?


---------------

(note that there is also documentation in doc/Developers/dialog.dox, and you 
can check out the test/say map)

Nicolas

-- 
http://nicolas.weeger.org [Petit site d'images, de textes, de code, bref de 
l'aléatoire !]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mailman.metalforge.org/pipermail/crossfire/attachments/20080511/fcdd0212/attachment.pgp 


More information about the crossfire mailing list