hogsy / chronon

This is an open-source reimplementation of Anachronox, built on top of the Quake 2 engine (which funnily enough is the same engine Anachronox was developed upon).
https://hogsy.me
GNU General Public License v2.0
49 stars 3 forks source link

GDB Parser #23

Open hogsy opened 2 years ago

hogsy commented 2 years ago

Fairly simple format which seems to be used for specifying various items and their properties, levels, quests

Generally, syntax looks like this.

// Example comment
#<type> <name>
{
<var> <var_type> <value>
<var> <var_type> <value>
<var> <var_type> <value>
}
#level rowdys
{
    masterlevel float   1
    xp_levels   float   .5
    xp_battles  float   0
    quest_1     string  "Fatima Stop"
    quest_2     string  "Get Your Camera"
    quest_3     string  "Get Some Money"
    quest_4     string  "Use Time Minder"
    quest_5     string  "Talk To Valesta"
}

At the top of quest.gdb the following information is provided. This doesn't seem to necessarily be entirely up-to-date but it's still helpful.

//
//=================================================
// QUEST.GDB
//=================================================
//#quest <name>
//{
//   description
//     desc string "<Description of the quest>"
//   experience awarded upon completion:
//     xp   int    <value>
//   When completed, the next sub-quest can continue with:
//     next_quest string  "<name>"
//   When completed, this APE sequence callback will be triggered
//     quest_callback string "<sequence>"
//   When this quest is added, the following sub_quest will also be added //immediately
//     sub_quest string "<sub_quest>"
//     @@@ OBSOLETE!!!! Gamevar expression to indicate that the quest is done:
//     @@@                   requirement string "<expr>"
//}
// QUEST COMMANDS
// extern add_quest "The Name of The Quest"
// extern complete_quest "The Name of The Quest"
// extern cancel_quest "The Name of The Quest"
// extern is_quest_done "The Name of The Quest" GAMEVAR
//is_quest_done will check to see if you've finished the specified quest, and return
//a value to the GAMEVAR specified. All successfully finished quests will return 2,
//a quest "in progress" will return 1 and a quest you haven't received will return
//0. NOTE that this can be kinda expensive to check, so it shouldn't be used to check 
//every frame if the status of a Quest has changed from 1 to 2, or something like that.
//Use this call with care, and stick to checking the normal gamevars when possible.

On more specific stuff, I'm not yet entirely sure. For example, I'm not sure if the name supplied for #level gets matched up against the name of the bsp or is just referenced by scripts. I'm also not so sure how it works in line with the following comment.

// NOTE: some levels may have more than one configuration.  This is
// useful in cases such as the Bricks where the area will undergo a
// change throughout the course of the game, and its monsters / quests
// / masterlevel / XP distribution will be different the second time
// around.