Skip to content

Instantly share code, notes, and snippets.

@kreezxil
Created April 24, 2022 16:10
Show Gist options
  • Save kreezxil/392f8e5bc5e5810da214262448c5f804 to your computer and use it in GitHub Desktop.
Save kreezxil/392f8e5bc5e5810da214262448c5f804 to your computer and use it in GitHub Desktop.
Example Parser Template
ROOM CODE
@CODE_BEGIN
inherit "/std/room";
void setup() {
@CODE_END
@INJECT set_short("
@PROMPT "Enter a brief room description:"
@INJECT ");
@NEWLINE
@INJECT set_long("
@PROMPT "Enter a verbose room description:"
@INJECT \n");
@NEWLINE
@INJECT add_item("
@PROMPT "Add an item:"
@INJECT ,
@PROMPT "Add the items description:"
@INJECT \n");
@NEWLINE
@INJECT add_exit("
@EXIT_DIR
@INJECT ,
@EXIT_PATH
@INJECT ");
@NEWLINE
@CODE_BEGIN
}
@CODE_END
As you can see the parser can be quite complex to look at, but this ability gives us far more flexiblity and power over other more simplistic offline room generators. By leaving proper code syntaxing up to you and only requiring that you understand how to use the parser language, the possibilities of VLS grow exponentially. I can see from this above example that I have provided, I may need to have loop directives, variable storage and other types of conditional structures. Time will tell of course as I want to achieve the most with least. And depending on what is said in ideas from the first beta test (still yet to be released), VLS versions 2.0 and higher might take an even more different route than I have previously envisioned.
Page last updated: June 22, 2004, 10:53 am
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment