GDB Intro
The GDB is the game database that keeps track of numerous things in the game including items, mystech, battleskills, quests, weapons, monsters, and more.
It basically consists of numerous files in the Anachronox directory tree, (usually with a .gdb extension), that contain text entries that describe the previously mentioned elements of a
game. Let's look at a few examples.
Item:
#object HealGrease Complete
{
type string "item"
classname string "get_healgreasecomplete"
buy_value int 500
desc string "Complete heal of person, or adjacent person in battle."
effect string "add_hp=9999"
use_script string "battle/items/healgrease"
use_target string "party"
}
Lets take a look at what the above means:
- First we have the #object string which is "HealGrease Complete". This is the name of this GDB object / entry.
- Next we have a type string "item". There are several pre-defined type strings in the GDB, they each tell
Anachronox what to do with that item. For example, since this is an "item" string,
Anachronox knows, among other things, that:
A) This is something that can be added to the inventory.
B) It should be shown in the item list in the Fatima Inventory Screen.
- Next we have the classname string. This is the entity.dat object that is associated with this GDB entry. So if you were to look up "get_healgrease" in the entity.dat, you would find that it references "healgrease.md2" which is the
little healgrease model that you see in the game. The classname string is not mandatory in an item.
- The buy_value int 500 line tells the GDB how much you could sell this item for in a shop.
- The desc string is what is displayed to the user when they click on the item in the Fatima screen or in a shop.
- This particular item has an effect string. Effect strings are effects that get executed when that item is used or invoked. This particular item has an effect string of
"add_hp=9999" which tells Anachronox to add 9,999 hitpoints to whoever just used this item.
- The use_script string is the planet script that should be played if this item is used in battle.
- The use_target string tells Anachronox who this item can be used on. In this case it can be used on anyone in the party.
Quest:
#quest Get Your Camera
{
area string "Anachronox"
type string "sub_quest"
desc string "Get the camera off your desk."
xp_shares float 1
quest_parent string "Fatima Stop"
}
Lets take a look at what the above means:
- The area string is what area this Quest takes place in. So in this case, the user would see this quest displayed in Fatima under "Anachronox".
- For this entry the type string is a "sub_quest".
- Once again the desc string is the description the user will see in the Fatima screen.
- The xp_shares represent how much experience the player gets for completing the quest. The xp_shares are multiplied by 100 to derive the XP, so in this case the party would get 100xp for completing this quest.
- The quest_parent string tells Anachronox what quest this subquest belongs to. That way, Anachronox knows how to visually stack the quests. Additionally if parent quest is completed and there are sub_quests are open underneath it, Anachronox knows to erase those quests from Fatima.