An initial thought (and I'm sure I'll have more): the goal I had with my response library was to try to unify things, so that you could treat everything the same, whether it be a room description, a command processor, conversation/dialogue or async actions. I realize that the current Quest model is being redone in a JS format, but I'd like to throw in the possibility of doing some unification - assuming I can come up with a reasonable plan.
Things you might like a command to do:
- run script
- output text
- set variables
- other?
I think a first step would the first two. For example, the sample file starts off with this:
command:
pattern: say #text#
script:
function(text) {
msg ("You say '" + text + "', but nobody replies.");
}
This command really is just outputting some text. It would be great if you could just do something like:
command:
pattern: say #text#
text: You say {text}, but nobody replies.
You might to have both text and script:
command:
pattern: take #object#
text: You take {object}.
script:
function(object) {
setParent(object, "player");
}
A room description might want script as well:
location: lounge
description:
text: This is quite a plain lounge with an old beige carpet and peeling wallpaper.
script:
function(object) {
// set some flag or start a timer or something.
}
south: kitchen
I realize that there might be a question of order. I know for my code, I just picked one. (e.g. text came first, then scripts, then state setting, etc). But I think if we could incorporate some generalizing ideas into this, where all the game responses (whatever they may be - descriptions, command handling, object descriptions, etc) are all handled the same way, then it could make life easier for people who don't know how to script very well and just want simple things to happen.
If you wanted to go beyond that, you could pick up some other ideas I had like setting variables, etc.
command:
pattern: push elevator button
text: The elevator button lights up. (Some sort of conditional here?)
sets: elevator.called
And then other code would key off of that. Anything to make common things not so "scripty". lol