Story Tutorial for DungeonDoom6XP:

This tutorial contains specific information for adding new story/quest elements to DungeonDoom.

**************************************************************************************

Chapter 1: Adding or modifying a quest:

**************************************************************************************

All quests are defined in the file quests.def. If you want to add additional quests, you will need to increase the value in "questnum" at the beginning of the definition. The value in "npc_prob" should usually be kept at 50.

Each quest needs the following parameters:

quest: the name of the quest
char: the classname of the npc which gives the quest
min: the minimal dungeonlevel the player has to advance to be able to take this quest (see note1)
max: the maximal dungeonlevel the player can advance before this quest will not be offered anymore (see note1)
m0: the caption of the quest message (must be different from "")
m1_1: text body of the initial quest text given by the questgiver. there is no limit for the number of lines included, but
m1_2: each line should be limited to about 120 characters. As the space needed for each character is variable the
m1_3: text message should be tested.
...
m2: text displayed if the reward is given
m3: text displayed to remin the player of the quest
m4: text displayed at the moment when the quest objective is met
gold: gold reward
exp: experience reward
u: classname of the item/mosnter that needs to be found/killed
z: z offset for spawning the item/monster (0 for all objects in the current quests)
l: level at which this item/monster will be encountered
s: reminder displayed in the stats screen/quests tab
t: type of quest: can be either item or monster

monster quests need further definitions for the monster properties:

mon_keys: number of keys to set on the questmonster
mon_key1: keys to set on the questmonster. format for setting the key is: key*val (for example
mon_key2: "DDinfl1*monster_shot" sets the key "DDinfl1" to the value "monster_shot". see the
mon_key3: custom monsters tutorial for more information on setting up monter capabilities)

...

monexp: direct experience reward
mongold: direct gold reward

each quest gets a prefix that defines which number it is reference with. Currently, quest numbers do not have any special additional function. If you want to display the dungeonlevel at which the quest has to be taken use the phrase @lvl This phrase will be replaced by the actual level displayed in the game (see note1).

Example of a item quest:

"1_quest" "Lost_Keys"
"1_char" "alphalabs3_fragchamber_scientist"
"1_min" "0" //corresponds to level 0 in short gameplay variant
"1_max" "15" //corresponds to level 3 in short gameplay variant, level 7 in medium gameplay variant (see note1)
"1_m0" "Confuse scientist:"
"1_m1_1" "I have lost my keys in the Dungeon. Now there are strange monsters down there. Do you want to look for my keys? They are"
"1_m1_2" "in Dungeonlevel @lvl."
"1_m2" "Many thanks. Please take this reward of 150 gold (you gain 150 experience)"
"1_m3" "Are you still looking for my keys? They are in Dungeonlevel @lvl."
"1_m4" "You found the Lost Keys! Return them to the scientist to receive the reward."
"1_gold" "150"
"1_exp" "150"
"1_u" "models/mapobjects/boxes/metalbox1.lwo"
"1_z" "0"
"1_t" "item"
"1_l" "0"
"1_s" "Retrieve the scientist's key from level @lvl."

Example of a monster quest:

"2_quest" "Disease"
"2_char" "char_betruger"
"2_min" "0" //corresponds to level 0 in short gameplay variant
"2_max" "15" //corresponds to level 3 in short gameplay variant, level 7 in medium gameplay variant (see note1)
"2_m0" "The Major:"
"2_m1_1" "I have seen a strange black creature in town. Afterwards, people become very sick."
"2_m1_2" "Can you kill it? I followed it down to Dungeonlevel @lvl."
"2_m2" "Many thanks. Please take this reward of 200 gold (you gain 200 experience)"
"2_m3" "Are you still looking for the black creature? It is in Dungeonlevel @lvl."
"2_m4" "You killed the Infectious Zombie! Go back to the major for the reward."
"2_gold" "200"
"2_exp" "200"
"2_u" "monster_infectious_zombie"
"2_z" "0"
"2_mon_keys" "5"
"2_mon_key1" "DDname*Infectious Zombie"
"2_mon_key2" "DDinfl1*poison"
"2_mon_key3" "DDinfl1ARG1*5"
"2_mon_key4" "DDinfl1ARG2*100"
"2_mon_key5" "DDinflnum*1"
"2_monexp" "exp4"
"2_mongold" "gold4"
"2_t" "monster"
"2_l" "15"
"2_s" "Kill Infectious Zombie in level @lvl."

**************************************************************************************

Chapter 2: Adding or modifying a story line:

**************************************************************************************

DungeonDoom6xp incorporates a flexible story parsing system. Right now, only one story has been made, but it is easy to modify this story or to write a new one. The current story is saved in the file story1.def. I will explain how this story is set up. This will enable you to write similar stories or more complicated ones. The story system will b e further extended and it will be useful for me to hear what types of story events you would like to have.

Each story is organized as a sequence of events. At the beginning of the game, events can either be active or inactive. An active event will trigger automatically, unless a trigger condition is set. If such a condition is set, an active event will only trigger if the trigger condition is satisfied as well. There are different types of events:

.....................................................................
teletext
.....................................................................

Teleport the player to a story room and spawn a npc to interact with the player. Trigger a text choice.

keys:

storyplayerspawn: name of entity defining the coordinates of the playerspawn position in the story room
storyplayerang: angle to which the player should head after spawning
storyentityspawn: name of entity defining the coordinates of the npc spawn position in the story room
storyentityang: angle to which the npc should head after spawning
storyentity: classname of the npc spawned in the story room
storyentitylook: set to "active" if the npc should look at the player
storyambient: ambient sound to play in the story room
storysound: sound to be triggered when entering the story room
story_m0: heading of the message (currently not used, must be different from "")
story_m1: text body of the message. there is no limit for the number of lines included, but each line
story_m2: should be limited to about 120 characters. As the space needed for each character is
story_m3: variable the text message should be tested.
story_m4
...
story_a1: text for choice option 1
story_a2: text for choice option 2. If no choice is required leave this blanc.
story_event1: number of event which should be set to active status if choice 1 was chosen.
story_event2: number of event which should be set to active status if choice 2 was chosen. (use the same
event as 1 if you do not need a choice)

.....................................................................
text
.....................................................................

Additional text displayed after the player had been teleported to the story room. Trigger a text choice.

keys:

story_m0: heading of the message (currently not used, but should be filled in for future implementation)
story_m1: text body of the message. there is no limit for the number of lines included, but each line
story_m2: should be limited to about 120 characters. As the space needed for each character is
story_m3: variable the text message should be tested.
story_m4:
...
story_a1: text for choice option 1
story_a2: text for choice option 2. If no choice is required leave this blanc.
story_event1: number of event which should be set to active status if choice 1 was chosen.
story_event2: number of event which should be set to active status if choice 2 was chosen. (use the same
event as 1 if you do not need a choice)

.....................................................................
boss
.....................................................................

Teleport the player to a boss room and spawn a level boss. The player will need to kill the boss to advance.

keys:

boss: classname of the boss
boss_gamename: name to be displayed on screen
bosssound: ambient sound to play in the boss room
bossspawn: number of spawn entities to which the player, boss and minions will spawn

for example, if set to 1, the player will be spawned to the coordinates of the entity playerspawn1 and the boss will be spawned at coordinates of the entity bossspawn1. Minions will be at the pos of minionspawn1_1, minionspawn1_2...

bossang: angle to which the player should head after spawning
bosslevel: not used anymore
boss_minions: number of minions to be present at a time
boss_respawn: how often minions will respawn
boss_gold: direct reward in gold
boss_exp: direct reward in experience
boss_keys: number of keys to set on the boss
boss_key1: keys to set on boss. format for setting the key is: key*val (for example
boss_key2: "DDinfl1*monster_shot" sets the key "DDinfl1" to the value "monster_shot". see the
boss_key3: custom monsters tutorial for more information on setting up monter capabilities)
...
boss_red: monster light source color
boss_green: monster light source color
boss_blue: monster light source color
minion: classname of minions
minion_gold: direct reward in gold
minion_exp: direct reward in experience
minion_keys: number of keys to set on the minion
minion_key1: keys to set on minions. format for setting the key is: key*val (for example
minion_key2: "DDinfl1*monster_shot" sets the key "DDinfl1" to the value "monster_shot". see the
minion_key3: custom monsters tutorial for more information on setting up monter capabilities)
story_event: number of event which should be set to active status if boss is killed if no other event is active after killing the boss, the player will return to the dungeon

.....................................................................
return
.....................................................................

Return the player to the dungeon.

keys:

storyplayerang: angle to which the player should head after returning

.....................................................................
killed
.....................................................................

Instantaneously kill the player.

keys:

storysound: sound to be triggered when event is triggered

.....................................................................
finish
.....................................................................

Show the finish screen

Example story1.def:

If we look at story1.def the events which make up the story are triggered in the following way:

At the beginning of the game 7 events are active, however all of these events have the key "trigger" set to a certain dungeonlevel. Therefore, at the beginning, none of the events are triggered. At level 15 (in the short gameplay variant this corresponds to level 3, see note1) the first event is triggered. This is event 1:

"eventtype_1" "teletext"
"eventstat_1" "active"
"trigger_1" "level_15"
"storyplayerspawn_1" "darkroom_player"
"storyplayerang_1" "270"
"storyentityspawn_1" "darkroom_entity"
"storyentityang_1" "90"
"storyentity_1" "char_labcoat_black"
"storyentitylook_1" "active"
"storyambient_1" "ambience_deathmachine"
"storysound_1" "sound/xian/creepy/betruger_laughs/laugh_12.wav"
"story_1_m0" "The Summoner's Prophet:"
"story_1_m1" "Your deeds have reached far from your home, great warrior. We are the Prophets of the Chamber of the Apocalypse. We are at"
"story_1_m2" "war with an ancient power which leaves us helpless. The hideous Arch-Mage Silmarus awakened the dead and controls their"
"story_1_m3" "lost souls in this fierce war. The only way to stop his invasion leads through an ancient artefact hidden within a"
"story_1_m4" "powerful demon 'The Balrog'. Many of our best warriors died in their attempts to defeat 'The Balrog'. You are our last"
"story_1_m5" "hope. Will you help us to defeat 'The Balrog' and retrieve the powerful Phasing Heart hidden within the beast?"
"story_1_a1" "Yes, I will defeat the Balrog."
"story_1_a2" "No, I do not take orders from you."
"story_1_event1" "2"
"story_1_event2" "3"

This event will teleport the plyer to the position of the entity "darkroom_player" and spawn a npc of type "char_labcoat_black" to the position of entity "darkroom_entity". A few sounds are triggered and a message is displayed and the player is given a choice. Depending on the choice either event 2 or event 3 is set to the active status.

Lets first consider the answer "No, I do not take orders from you." In that case, event 3 will be activated:

"eventtype_3" "text"
"eventstat_3" "inactive"
"story_3_m0" "The Summoner's Prophet:"
"story_3_m1" "We cannot force you to fight for us, but we cannot allow you to leave this place."
"story_3_a1" "Press Enter to continue."
"story_3_a2" ""
"story_3_event1" "4"
"story_3_event2" "4"

As the eventstat is set to active by the previous answer, this event is now active and it will trigger. All that the event is doing is to display another text message and the choice is limited to one answer, which will activate event 4:

"eventtype_4" "killed"
"eventstat_4" "inactive"
"storysound_4" "sound/xian/creepy/betruger_laughs/laugh_12.wav"

Event 4 simply kills the player. Not very good for the players progress... He probably should have accepted his destiny...

Now lets consider what happens if the player answered the first question with "Yes, I will defeat the Balrog.", which will activate event 2. The original definition of this event is:

"eventtype_2" "text"
"eventstat_2" "inactive"
"story_2_m0" "The Summoner's Prophet:"
"story_2_m1" "You are truly a great warrior, as the Prophecy has foreseen. The Balrog is located in level @lvl in the Dungeon of Doom."
"targetlevel_2_m1" "100"
"story_2_m2" "You will encounter inscriptions on your way through the dungeon. Read them carefully, as they contain valuable information"
"story_2_m3" "you will need to finish your task. You will occasionally find teleporters on your way through the dungeon. These will"
"story_2_m4" "enable you to travel back to the surface where you can regenerate. Good luck."
"story_2_a1" "Press Enter to continue."
"story_2_a2" ""
"story_2_event1" "5"
"story_2_event2" "5"

Again, this event will display a text message without a choice which will then activate event 5:

"eventtype_5" "return"
"eventstat_5" "inactive"
"storyplayerang_5" "270"

Setting event 5 to active will simply return the player to the dungeon.

When the player first gets to level 20 (level 4 in the short gameplay variant see note1) the next event will be triggered:

"eventtype_6" "teletext"
"eventstat_6" "active"
"trigger_6" "level_20"
"storyplayerspawn_6" "darkroom_player"
"storyplayerang_6" "270"
"storyentityspawn_6" "darkroom_entity"
"storyentityang_6" "90"
"storyentity_6" "char_labcoat_black"
"storyentitylook_6" "active"
"storyambient_6" "ambience_deathmachine"
"storysound_6" "sound/xian/creepy/betruger_laughs/laugh_12.wav"
"story_6_m0" "The Summoner's Prophet:"
"story_6_m1" "The following level is guarded by one of the minions of Silmarus: By the stinking 'Yellow Bastard'. Be careful. Although he"
"story_6_m2" "does not look very dangerous he is a master of arcane powers."
"story_6_a1" "Press Enter to continue."
"story_6_a2" ""
"story_6_event1" "7"
"story_6_event2" ""

This is again a very simple event which will display a text message from a npc. Once confirmed, event 7 will be triggered:

"eventtype_7" "boss"
"eventstat_7" "inactive"
"boss_7" "monster_yellowbastard"
"boss_gamename_7" "Yellow Bastard"
"bosssound_7" "ambience_yellowbastard"
"bossspawn_7" "1"
"bossang_7" "180"
"bosslevel_7" "20"
"boss_minions7" "2"
"boss_respawn7" "10"
"boss_gold7" "gold4"
"boss_exp7" "exp4"
"boss_keys7" "10"
"boss_key1_7" "DDinfl1*monster_shot"
"boss_key2_7" "DDinfl1ARG1*paralyze_shot"
"boss_key3_7" "DDinfl1ARG2*star_fireball.prt"
"boss_key4_7" "DDinfl1ARG3*20"
"boss_key5_7" "DDinfl1ARG4*3"
"boss_key6_7" "DDinfl1ARG5*0.5"
"boss_key7_7" "DDinfl1ARG6*0.5"
"boss_key8_7" "DDinfl1ARG7*1"
"boss_key9_7" "DDinfl1ARG8*whispers_02"
"boss_key10_7" "DDinflnum*1"
"boss_red_7" "1"
"boss_green_7" "1"
"boss_blue_7" "0"
"minion_7" "monster_zombie_fat"
"minion_gold7" "gold1"
"minion_keys7" "5"
"minion_key1_7" "DDinfl1*teleport"
"minion_key2_7" "DDinfl1ARG1*0.75"
"minion_key3_7" "DDinfl1ARG2*10"
"minion_key4_7" "DDinfl1ARG3*10000"
"minion_key5_7" "DDinflnum*1"
"story_7_event" ""

Event 7 teleports the player to the first bossroom and defines the properties of the first boss and its minions. After killing the boss no further events are triggered ("story_7_event" is set to ""), therefore nothing special will happen - the player will simply return to the dungeon.

Similarly, the following bosses will be triggered by a short message that will be activated before in events 8-17. Finally, in event 17:

"eventtype_17" "boss"
"eventstat_17" "inactive"
"boss_17" "monster_demon_balrog"
"boss_gamename_17" "The Balrog"
"bosssound_17" "ambience_end_level"
"bossspawn_17" "0"
"bossang_17" "90"
"bosslevel_17" "100"
"boss_minions17" "9"
"boss_respawn17" "90"
"boss_gold17" "gold9"
"boss_exp17" "exp9"
"boss_keys17" "3"
"boss_key1_17" "DDname*Balrog"
"boss_key2_17" "DDinfl1*darken"
"boss_key3_17" "DDinflnum*1"
"boss_red_17" "0"
"boss_green_17" "0.03"
"boss_blue_17" "0.02"
"minion_17" "monster_zombie_tough"
"minion_keys17" "0"
"story_17_event" "18"

event 18 will be triggered if the boss is killed:

"eventtype_18" "finish"
"eventstat_18" "inactive"

event 18 will simply end the game!

Please let me know if you have any additional questions.

-hellborg

Back to Tutorials Overview...

note1:
The level system depends on the gameplay variant: i.e. if you play the game in the short variant, level 15 will be displayed as level 3, as internally, in that variant, the player advances 5 levels with each transition. In the medium gameplay variant the player advances 2 levels, thus level 15 would no be reachable at all. To correct for this, in the medium variant, level 15 corresponds to the level (x-1)/2, i.e. level 7.

contact: leif@gravity-music.net