[eTUT] The Dawn Quest and my experiences

By on August 28, 2010 1:38:02 PM from Elemental Forums Elemental Forums

Aexrael

Join Date 08/2006
+14

Download of the Quest

First of, you can grab the quest here if you want. Just dump the xml in your \units\ folder.

It's a lvl 1 quest available from Inns.

 

Foreword and Tools

Now, it took me the better part of yesterday and a good chunk of time today to get it in a state that I'd consider "working". It is by no means pretty, however, or even that exciting.

When I originally set out to make it, I wanted to add some functionality that I ended up dropping (More on that in a bit), simply because I couldn't see a way get it to work, or if it was even possible to do.

There were also considerable time spent hammering my face in the keyboard over issues I could not figure out, only to realize that they were due to pre-set values in other files (More on that later).

A lot of time was also spent looking through Stardock's incoherent XML Quest files, sorry chaps but you could have done that way better. Looking for dependencies and trying to make heads and tails of the various quests. Without any form of reference point, it has been a lot of stabbing in the dark, trying to figure out how the quests are put together, what parameters can be adjusted and so forth. My biggest pet peeve, is that not all quests have comments, and that there is no coherent order in which they are written, some functions come before others in some quests, and after others in other quests. It made it frustratingly more annoying to piece together the Dawn quest. Not to mention, some one-shot quests are simply dumped in the Quest folder or throughout other files, where as I would have expected them all to more consolidated.

Through out this process I also looked around for a better editor for these XML files, as I originally set out I used Notepad, but quickly moved to Notepad++, but I also looked at Eclipse and Visual Studio but came full circle back to Notepad++ as my tool of preference.

Another great program I came across is SadMan Software's Search. It allows you to search through the whole C:\Program Files (x86)\Stardock Games\Elemental\data\English fairly quickly, looking for specific strings of text, it can do "And", "Or", "And Not", and Case Sensitive searches, it has been invaluable in finding specific files and information in them. It's very fast and accurate.

Hopefully my effort can serve as a reference to other aspiring quest makers in the community.

 

Testing The Quest

As for testing the quest, I used the cheat parameter on the Elemental shortcut.

"C:\Program Files (x86)\Stardock Games\Elemental\Elemental.exe" cheat

This allows you to use various commands in game.

The list I know of
CTRL + M = +1000 to all Resouces
CTRL + S = Autosave
CTRL + B = Completes buildings projects
CTRL + J = Completes units projects
CTRL + D = Converts selected Enemy party
CTRL + C = Copy selected party leaders
CTRL + F = Gives you a spouse and children
CTRL + X = Hide/Show Interface
CTRL + K = Kill selected party
CTRL + P = Level Up Party leaders
CTRL + R = Research Current Tech
CTRL + Q = Research Spells (A Little)
CTRL + E = Research Spells (A Lot)
CTRL + U = Reveal Map
CTRL + Z = Starts/Stops Auto Turn
CTRL + T = Teleports the selected character/unit to the cursor
CTRL + K = Kill selected party

In other to make it easier to test just this quest, without the interference from other quests, I removed Quest_EscortNobleman1.xml, Quest_EscortNoblewoman1.xml, Quest_CommonQuests.xml and Quests_Level1.xml from the \\English\CoreQuests folder. They are all files with level 1 quests in them.

I removed the cache file once removing those.

 

Core files and Unit folder

Don't edit the core files in the \\data\English folder.

Always copy files to your \\Unit\ folder.

However if for some reason you mess up the core files, you can fix this.

Open Impulse and click Shift+Right Click on Elemental, there is a Verify Installation option. It'll correct your files and re-download them again.

Know also that Elemental makes a binary file once it has parsed all the XML files, this file is found in \\Data. If you delete this cache, Elemental will need to recompile it, however you can get Elemental to do just that by adding /CreateXMLBinary to the shortcut. If you do not have this parameter, starting a game will take considerably longer, as Elemental parses all the XML files.

Remember to move files out of \\Units before doing this, I think it may include them in the cache.

 

The Dawn Quest XML & Commentary


Code: xml
  1. <Quests>
  2. <QuestDef InternalName="Quest_Dawn">
  3.     <DisplayName>Dawn</DisplayName>
  4.     <Description>A young blond woman approaches you. She is about to reveal her name to you, "My Sovereign, my name is B....", but she's interrupted by a nearby
  5. noise! She quickly explains that she is looking for aid in slaying an unspeakable evil in a nearby nest.</Description>
  6.     <QuestClass>Minor</QuestClass>
  7.     <Repeatable>0</Repeatable>
  8.     <TriggerType>QuestLocation</TriggerType>
  9.     <TriggerOrigin>EventLocation</TriggerOrigin>
  10.     <SpawnRating>1</SpawnRating>
  11.     <TriggerChance>100</TriggerChance>
  12.     <Image>Pub.png</Image>
  13.     <PrefQuestLoc>Quest_Level1_Inn01</PrefQuestLoc>


Right, so first off the QuestDef InternalName as far as I understand, is only to identify this quest, and it should not be the same as an existing quest in the

game. Or if you write multiple quests within the same file, do not lable them the same. Other then that, it could be "HorseWhispere" and it would still work.
The <Quests> tag already defined at the beginning that this is going to be a quest.

DisplayName is the name you see when the quest popups (See Picture #2), this is the actual ingame name of your Quest.

Description as you also see on Picture #2, is the text which appears initially when you trigger the quest.

QuestClass, all quests in game but one is Minor quests. The only major quest that I know of is the MasterQuest, the one for The Forge of the Overlord. If this has

any relevance beyond a simple designation, I do not know.

Repeatable, determines whether you can trigger this quest again or whether it's a one time only. A lot if not all minor quests are repeatable.

TriggerType, I believe this determines whether the quest is triggered off a Quest Location, or whether it's triggered off Capital City population.

TriggerOrigin I believe determines whether the quest is triggered at a Quest Location (NOTE! NOTE NOTABLE LOCATION!), or whether it's a quest that is triggered off

your capital city. There are quests available currently which is based off the population numbers in your capital city. But Stardock has been inconsistent in their

Quest writing, because there is only 1 quest that uses CapitalCity, and that is despite there being 4-5 different quests which is based off CapitalCity population.

SpawnRating I don't really know the effect is of this. It seems to be related to "level" of some kind. Some lvl 5 quests have a rating of 5, some monsters have

rating of 12, and so on. There are even values for -1 for GoodieHuts.

TriggerChance, is the chance of this quest triggering when you go to a quest location. 100 does not mean this will always be the quest, as there are other quests

also with 100.

Image, references the picture in the center of the Quest popup message. I'm not sure if this can search all subfolders or if it draws from a pre-set location, I

chose an image from C:\Program Files (x86)\Stardock Games\Elemental\Gfx\Medallions.

PrefQuestLoc determines what type of Quest location this quest can be triggered at.

Code: xml
  1.         <!-- This objective is to find the nest and move to clear it -->
  2.             <QuestObjectiveDef InternalName="Objective0">
  3.             <ObjectiveID>0</ObjectiveID>
  4.             <NextObjectiveID>1</NextObjectiveID>
  5.             <Description>Find the nearby nest where this unspeakable evil rests!</Description>


QuestObjectiveDef, again this is only a reference point within this quest, not the entirety of all quests. This is important to keep consistent throughout your

quest writing or things don't work.
Likewise with ObjectiveID, this must be consistent throughout. In this case, this is Objective 0, the first one, and thus gets ID0. Next Objective in this quest is

Objective1, and thus ID for next is 1.
Description here is the text you see on picture#3. Notice how it automatically uses the Pub.png image from earlier.

Code: xml
  1.         
  2.         <!-- This is the escort NPC that must be brought to the nest -->
  3.             <GameModifier InternalName="EscortNPC">
  4.                 <ModType>Unit</ModType>
  5.                 <Attribute>UnitJoinArmy</Attribute>
  6.                 <StrVal>EscortDaughter01</StrVal>
  7.                 <UnitClass>Unit</UnitClass>
  8.             </GameModifier>


I decided here that the Player should escort the Blond woman in the text to the location with the monsters in it. So this point spawns an Unit, the unit joins the

Players "Army", and the unit type is EscortDaughter01, which is referenced with stats and everything in \\Core Quests\Questunits.xml.

Code: xml
  1.             
  2.         <!-- Clearing this goodie hut with the escort NPC in your army completes this stage -->
  3.             <GameModifier InternalName="CreateGoodieHut">
  4.                 <ModType>Map</ModType>
  5.                 <Attribute>CreateGoodieHut</Attribute>
  6.                 <UnitClass>RatNest</UnitClass>
  7.                 <StrVal>Rat Nest</StrVal>
  8.                 <Radius>8</Radius>
  9.             </GameModifier>


Here the goodie hut spawns which you must go to next, with the escort NPC. This step actually caused me much headaches, and a considerable time investment. Mostly because I tried to use TerrorizedWorkshop as location, but the TerrorizedWorkshop has some parameters defined that indicates it yields X materials. So when I finally at the of my quest wanted to reward the player, I couldn't figure out why in Mars' name, would it hand out the improper reward.
What I should have done at that point probably, was to duplicate the TerroizedWorkshop, labled it #2, and removed the references to the inate reward. But that's reserved for Dawn Quest 2.0.

Radius here determines Up To, how far away the Rat Nest can spawn from your present location.

Code: xml
  1.         <!-- Success condition -->
  2.             <QuestConditionDef InternalName="Condition1">
  3.                 <Description>Escort the woman to the nest.</Description>
  4.                 <Class>Success</Class>
  5.                 <Type>ClearGoodieHut</Type>    
  6.                 <TextData>RatNest</TextData>
  7.                 <MoreTextData>EscortDaughter01</MoreTextData>
  8.                 <Flag>DestroyUnit</Flag>
  9.                 <Flag>UnitMustBeEscorted</Flag>
  10.                 <Flag>RevealTarget</Flag>
  11.             </QuestConditionDef>
  12.             
  13.         <!-- Failure condition -->
  14.             <QuestConditionDef InternalName="Condition2">
  15.                 <Description>Protect the woman.</Description>
  16.                 <CompletionText>You failed to protect the woman and she died a most gruesome death. The world will never be the same without
  17. her.</CompletionText>
  18.                 <Class>Failure</Class>
  19.                 <Type>UnitKilled</Type>    
  20.                 <Faction>Player</Faction>
  21.                 <TextData>EscortDaughter01</TextData>
  22.                 <NumericData>1</NumericData>
  23.             </QuestConditionDef>


Here is defined two conditions. You must either A) Bring the Escort NPC to the Rat Nest, or Fail, if she dies.
<Flag> is things that happen once the Class/Type paramenters are met, i.e. for Success it's ClearGoodieHut, which means you went to the hut and cleared it, criteria for success is that UnitMustBeEscorted, i.e. the noblewoman, the hut is destroyed, and also RevealTarget I found toggles on/off whether the Rat Nest is shown to the player when you pick up the NobleWoman, see Picture#3.

Code: xml
  1.             
  2.         <!-- nest popup message -->
  3.             <ChoiceText>As you get near the nest, a wave of uncertainty overcomes you. What if you don't return safely from this quest? What will you
  4. do?</ChoiceText>
  5.             <ChoiceMedallion>Gfx\\Medallions\\CaveGrassland_Medallion.png</ChoiceMedallion>
  6.             <ChoiceMedallionFrame>Gfx\\Medallions\\Medallion_Frame_01.png</ChoiceMedallionFrame>                   


This is the message that shows when you approach the Rat Nest, see Picture#4.

Code: xml
  1.     
  2.     
  3.         <!-- Choice 0 -->
  4.              <QuestChoiceDef>
  5.             <Description>Enter the nest.</Description>
  6.             <NextObjectiveID>1</NextObjectiveID>
  7.                       
  8.         <!-- Create Edward and Bella, first one becomes the leader -->
  9.             <Encounter InternalName="EdwardBella">
  10.                       <Liklihood>100</Liklihood>
  11.                       <LevelLo>1</LevelLo>
  12.                       <LevelHi>5</LevelHi>
  13.                       <WillRespawn>0</WillRespawn>
  14.                       <WanderingRadius>100</WanderingRadius>
  15.                   <UnitInstance>
  16.                     <UnitType>Darkling</UnitType>
  17.                     <UnitName>Edward</UnitName>
  18.                     <Level>5</Level>
  19.                  </UnitInstance>
  20.                 <UnitInstance>
  21.                     <UnitType>Darkling</UnitType>
  22.                     <UnitName>Bella</UnitName>
  23.                     <Level>5</Level>
  24.                 </UnitInstance>
  25.             </Encounter>
  26.             </QuestChoiceDef>            


You are presented with two choices when you enter the Rat Nest. Choice 0 or the first one, is "Enter the nest.", which subsequently spawns an encounter.

I didn't mess much with these settings however. I originally thought that LevelLo and LevelHi maybe meant some interval that the monsters in this instance apawned at those levels, but adjusting them did not affect the NPC levels. UnitType determines which type of NPC it is, and UnitName simply names it in the mouseover box.
WanderingRadius I assume, if you flee or lose the fight, they start roaming. Majority of stuff Stardock defined as having 0 radius, or maximum of 4. Which is pratical, so your quest monsters don't roam the world, unless that's what you want them to do.

Code: xml
  1.                
  2.           <!-- Choice 1 -->
  3.             <QuestChoiceDef>
  4.             <Description>You let the woman enter the nest on her own.
  5.             Shortly after you hear a loud scream and something attacks you!</Description>
  6.             <NextObjectiveID>2</NextObjectiveID>
  7.                             
  8.         <!-- Create Edward and Bella, first one becomes the leader -->
  9.             <Encounter InternalName="EdwardBella">
  10.                       <Liklihood>100</Liklihood>
  11.                       <LevelLo>1</LevelLo>
  12.                       <LevelHi>5</LevelHi>
  13.                       <WillRespawn>0</WillRespawn>
  14.                       <WanderingRadius>100</WanderingRadius>
  15.                   <UnitInstance>
  16.                     <UnitType>Darkling</UnitType>
  17.                     <UnitName>Edward</UnitName>
  18.                     <Level>5</Level>
  19.                     </UnitInstance>
  20.                 <UnitInstance>
  21.                     <UnitType>Darkling</UnitType>
  22.                     <UnitName>Bella</UnitName>
  23.                     <Level>5</Level>
  24.                     </UnitInstance>
  25.             </Encounter>
  26.             </QuestChoiceDef>            
  27.             </QuestObjectiveDef>
            
Same as first choice really. Originally it was intended as causing the World NPC level to increase, but that was not possible for now. If I figure out how to then that's going to happen in Dawn Quest 2.0.
    
Code: xml
  1.     <!-- This objective is to kill Edward and Bella  -->
  2.             <QuestObjectiveDef InternalName="Objective1">
  3.                 <ObjectiveID>1</ObjectiveID>
  4.                 <NextObjectiveID>-1</NextObjectiveID>
  5.                 <Description>Slay Edward and Bella!</Description>
  6.                 <PopupObjectiveMsg>0</PopupObjectiveMsg>
  7.             <QuestConditionDef InternalName="Condition3">
  8.                 <Description>Slay Edward and Bella!</Description>
  9.                 <Class>Success</Class>
  10.                 <Type>KillMonster</Type>
  11.                 <TextData>Darkling</TextData>
  12.                 <MoreTextData>Edward</MoreTextData>
  13.                 <NumericData>1</NumericData>
  14.                 <CompletionText>You have saved the world from these abominations. The woman hands you a reward for your effort.</CompletionText>
  15.             <GameModifier InternalName="SuccessReward">
  16.             <ModType>GiveItem</ModType>
  17.             <Attribute>SovereignSword</Attribute>
  18.             </GameModifier>
  19.             </QuestConditionDef>
  20.             </QuestObjectiveDef>
  21.             
  22.         <!-- This objective is to kill Edward and Bella  -->
  23.             <QuestObjectiveDef InternalName="Objective2">
  24.                 <ObjectiveID>2</ObjectiveID>
  25.                 <NextObjectiveID>-1</NextObjectiveID>
  26.                 <Description>Slay Edward and Bella!</Description>
  27.                 <PopupObjectiveMsg>0</PopupObjectiveMsg>
  28.             <QuestConditionDef InternalName="Condition4">
  29.                 <Description>Slay Edward and Bella!</Description>
  30.                 <Class>Success</Class>
  31.                 <Type>KillMonster</Type>
  32.                 <TextData>Darkling</TextData>
  33.                 <MoreTextData>Edward</MoreTextData>
  34.                 <NumericData>1</NumericData>
  35.                 <CompletionText>You have saved the world from these abominations. But the world will forever mourn the loss of
  36. B.....</CompletionText>
  37.             <GameModifier InternalName="FailReward">
  38.                 <ModType>Player</ModType>
  39.                 <Attribute>Treasury</Attribute>
  40.                 <Value>-10</Value>
  41.             </GameModifier>
  42.             </QuestConditionDef>
  43.             </QuestObjectiveDef>
  44.   </QuestDef>
  45.   </Quests>
    

Here comes the objectives for the instances spawned, basically to kill the NPCs, more specifically to kill the Darkling labled Edward.
This is also where the reward is handed out, and the last Popup messages, see Picture #7 and #6.

 

Pretty pictures

 

 

 

Locked Post 19 Replies +3
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
August 28, 2010 1:41:44 PM from Elemental Forums Elemental Forums

I originally intended to incorporate the World NPC Level increase from Adventuring/Domination technology research, in as a consequence for failing to complete the quest.

But I couldn't figure out how to get it to work, if it's at all possible.

Code: xml
  1.         <GameModifier>
  2.             <ModType>Player</ModType>
  3.             <Attribute>UpdateSpawnRating</Attribute>
  4.             <StrVal>CREATURE</StrVal>
  5.         </GameModifier>
Reason for Karma (Optional)
Successfully updated karma reason!
August 28, 2010 1:51:03 PM from Elemental Forums Elemental Forums

Awesome work and much appreciated. I quickly gave up modding but with this information I might give another try. Game sorely needs more quests.

Reason for Karma (Optional)
Successfully updated karma reason!
August 28, 2010 7:35:13 PM from Elemental Forums Elemental Forums

Looks good, but I can't find the units folder.  Can you give a full path?

Reason for Karma (Optional)
Successfully updated karma reason!
August 29, 2010 5:06:10 AM from Elemental Forums Elemental Forums

Quoting Bill Farrar,
Looks good, but I can't find the units folder.  Can you give a full path?

 

Vista/7

C:\Users\UserName\Documents\My Games\Elemental\Units

Reason for Karma (Optional)
Successfully updated karma reason!
August 29, 2010 6:25:34 AM from Elemental Forums Elemental Forums

Updated OP with commentary for the XML instead of just the XML dump.

Reason for Karma (Optional)
Successfully updated karma reason!
August 29, 2010 6:11:29 PM from Elemental Forums Elemental Forums

Quoting Novaburst,



Quoting Bill Farrar,
reply 3
Looks good, but I can't find the units folder.  Can you give a full path?


 

Vista/7

C:\Users\UserName\Documents\My Games\Elemental\Units

Ah, Documents, notv Program Files.  Thank you very much.

Reason for Karma (Optional)
Successfully updated karma reason!
August 29, 2010 6:17:19 PM from Elemental Forums Elemental Forums

But why the units folder? Wouldn't it go in the quests folder?

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 1:49:30 PM from Elemental Forums Elemental Forums

I was gonna do a writeup of all the variables possible for each of the tags, but it's been put on hold.

 

Here's what I have so far. If anyone wants to finish the list, by all means, knock your self out

<QuestClass> Minor / Major

<Repeatable> 0 / 1

<TriggerType> QuestLocation / City Population

<Triggerchance> 1-100

<TriggerOrigin> EventLocation / CapitalCity

<PrefQuestLoc> Quest_Level1_Inn01, Quest_Level2_Hut01, Quest_Level3_Ruin01, Quest_Level4_Dungeon01, Quest_Level5_Fortress1

<ModType> Player, Unit, Resource, GiveItem, ResouceMultiplier, City, ConstructionResourceCost, LevelBarrier, Map, TacticalUnit

<Attribute> AbilityBonus, UnlockTech, Materials, Metal, AdjustUnitStat, BuildingDiscount, Treasury, Research,

<UnitClass> QuestBanditCamp, DragonFountain, Level1_Hut_01, Terroizedvillage, LostHorse, TerroizedWorkshop, Level2_WolfPack_01, Level1_Treasure_01, Level2_AlchemistLab....

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 2:18:02 PM from Elemental Forums Elemental Forums

WanderingRadius I assume, if you flee or lose the fight, they start roaming. Majority of stuff Stardock defined as having 0 radius, or maximum of 4. Which is pratical, so your quest monsters don't roam the world, unless that's what you want them to do.

I'm pretty sure this was used in creature nests during beta. Remember those spider webs that constantly spawned spiders that roamed around a bit until you cleared the notable location?

Also, here's something new to ponder. What's the difference between <NextObjectiveID>-1</NextObjectiveID> and <QuestEnd>1</QuestEnd>? Quest_RatsInTheRuins uses QuestEnd tags instead of NextObjectiveID for its final objective. As far as I can tell, NextQuestObjectiveID -1 tends to be used when you're "canceling" action. Like if you look at the Lost Horse quest. When prompted to fight you can either accept, which sets up the next objective, or decline which sets it to -1 and you can hit the tile again.

But yeah, the quest formatting is just all over the place.

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 2:35:44 PM from Elemental Forums Elemental Forums

Good observation and questions Annatar, it warrants experimenting with at some point.

As for roaming monster, if you spawn an encounter, but lose or flee, it should put that encounter on the world map (it did with me in the quest for the forge), and I figured that the roaming radius would dictate how far away from the Location they would run around.

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 2:38:09 PM from Elemental Forums Elemental Forums

Ah, that is an interesting mechanic. In that case yeah, I imagine you're quite correct on the roam radius

Here's another thing.. have you gotten to play around with more than 2 choices of action?

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 2:50:47 PM from Elemental Forums Elemental Forums

Quoting Novaburst,
I originally intended to incorporate the World NPC Level increase from Adventuring/Domination technology research, in as a consequence for failing to complete the quest.

But I couldn't figure out how to get it to work, if it's at all possible.

Code: xml
        <GameModifier>
            <ModType>Player</ModType>
            <Attribute>UpdateSpawnRating</Attribute>
            <StrVal>CREATURE</StrVal>
        </GameModifier>

 

The Worldawareness and updatespawnratting are both hardcoded, or atleast nobody knows how to modify them, so it would mess up the techs if you changed them anyway. Atleast as far as I have read from what people have written here.

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 4:13:48 PM from Elemental Forums Elemental Forums

Quoting Annatar11,
Ah, that is an interesting mechanic. In that case yeah, I imagine you're quite correct on the roam radius

Here's another thing.. have you gotten to play around with more than 2 choices of action?

 

Not yet. I could easily see there being 4 options available, but the hard part is actually making something other then hello spawn monsters, or hello you suck for saying no to this quest.

In theory you could make a choice that grants you an permanent NPC, or kills you by adding negative HP (like the rat quest does upon clearing the nest).

I might experiment with those at a later stage.

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 4:14:40 PM from Elemental Forums Elemental Forums

Quoting Callesen58,

Quoting Novaburst, reply 1I originally intended to incorporate the World NPC Level increase from Adventuring/Domination technology research, in as a consequence for failing to complete the quest.

But I couldn't figure out how to get it to work, if it's at all possible.

Code: xml
        <GameModifier>
            <ModType>Player</ModType>
            <Attribute>UpdateSpawnRating</Attribute>
            <StrVal>CREATURE</StrVal>
        </GameModifier>
 

The Worldawareness and updatespawnratting are both hardcoded, or atleast nobody knows how to modify them, so it would mess up the techs if you changed them anyway. Atleast as far as I have read from what people have written here.

 

Good to know.

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 4:38:17 PM from Elemental Forums Elemental Forums

Not yet. I could easily see there being 4 options available, but the hard part is actually making something other then hello spawn monsters, or hello you suck for saying no to this quest.

In theory you could make a choice that grants you an permanent NPC, or kills you by adding negative HP (like the rat quest does upon clearing the nest).

I might experiment with those at a later stage.

I actually decided a 3-option quest to see if it works.

I mainly asked because currently, the initial objective always has the NextObjectiveID of 1, and your choice to fight only creates what to fight, the NextObjectiveID bleeds through. Your choice not to fight sets the NextObjectiveID to -1 and resets. But the interaction between the objective's NextObjectiveID and the ChoiceDef's NextObjectiveID isn't clear. Does it overwrite? Is NextObjectiveID -1 treated as a "break", so when you hit it it just automatically exits the quest? If the ChoiceDef's NextObjectiveID does not overwrite anything and -1 is like a "break", then I don't actually see multi-choice objectives working because you either have the static NextObjectiveID defined in the current objective, or -1.

Reason for Karma (Optional)
Successfully updated karma reason!
August 30, 2010 6:07:56 PM from Elemental Forums Elemental Forums

Quoting Annatar11,

Not yet. I could easily see there being 4 options available, but the hard part is actually making something other then hello spawn monsters, or hello you suck for saying no to this quest.

In theory you could make a choice that grants you an permanent NPC, or kills you by adding negative HP (like the rat quest does upon clearing the nest).

I might experiment with those at a later stage.
I actually decided a 3-option quest to see if it works.

I mainly asked because currently, the initial objective always has the NextObjectiveID of 1, and your choice to fight only creates what to fight, the NextObjectiveID bleeds through. Your choice not to fight sets the NextObjectiveID to -1 and resets. But the interaction between the objective's NextObjectiveID and the ChoiceDef's NextObjectiveID isn't clear. Does it overwrite? Is NextObjectiveID -1 treated as a "break", so when you hit it it just automatically exits the quest? If the ChoiceDef's NextObjectiveID does not overwrite anything and -1 is like a "break", then I don't actually see multi-choice objectives working because you either have the static NextObjectiveID defined in the current objective, or -1.

Ok, let me see if I understand you right.

"initial objective always has the NextObjectiveID of 1", yes because initial objective is objective 0. After 0 comes 1, it follows a chronological order. You could make it 5, as long as you are consistent throughout your file. But for sanity purposes, keep it simple I say.

Initial choices to fight are based in Objective0. But define their own <NextObjectiveID>. In one of the choices I could have utilized -1, to end the quest right there after picking one of the choices, and let the other spawn the monsters and reward loot. But I tried to make it a little more interesting.

Took me five minutes, but I finally understand what you mean now. Yes there are <NextObjectiveID>1</NextObjectiveID> in the <QuestObjectiveDef InternalName="Objective0"> definitions, I however suspect that it's an error, and shouldn't have been there. I was going to write, I need to test what happens when I delete that line, but I already answered that when I made the example quest below.

 

Multiple choice should still be very possible.

 

See this code for reference. It basically loops the quest from the choice. I threw it together quickly, based on first half of the Dawn Quest. Note how <NextObjectiveID>1</NextObjectiveID> has no relevance to the quest, the <NextObjectiveID>0</NextObjectiveID> in the choice overruled it.

 

Code: xml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Quests>
  3. <QuestDef InternalName="Quest_Time">
  4.     <DisplayName>Time Loop</DisplayName>
  5.     <Description>A young blond woman approaches you. She needs you to find the Time Loop.</Description>
  6.     <QuestClass>Minor</QuestClass>
  7.     <Repeatable>0</Repeatable>
  8.     <TriggerType>QuestLocation</TriggerType>
  9.     <TriggerOrigin>EventLocation</TriggerOrigin>
  10.     <SpawnRating>1</SpawnRating>
  11.     <TriggerChance>100</TriggerChance>
  12.     <Image>Pub.png</Image>
  13.     <PrefQuestLoc>Quest_Level1_Inn01</PrefQuestLoc>
  14.         <!-- This objective is to find the nest and move to clear it -->
  15.             <QuestObjectiveDef InternalName="Objective0">
  16.             <ObjectiveID>0</ObjectiveID>
  17.             <NextObjectiveID>1</NextObjectiveID>
  18.             <Description>Find the nearby nest where Time Loop is.</Description>
  19.         
  20.         <!-- This is the escort NPC that must be brought to the nest -->
  21.             <GameModifier InternalName="EscortNPC">
  22.                 <ModType>Unit</ModType>
  23.                 <Attribute>UnitJoinArmy</Attribute>
  24.                 <StrVal>EscortDaughter01</StrVal>
  25.                 <UnitClass>Unit</UnitClass>
  26.             </GameModifier>
  27.             
  28.         <!-- Clearing this goodie hut with the escort NPC in your army completes this stage -->
  29.             <GameModifier InternalName="CreateGoodieHut">
  30.                 <ModType>Map</ModType>
  31.                 <Attribute>CreateGoodieHut</Attribute>
  32.                 <UnitClass>RatNest</UnitClass>
  33.                 <StrVal>Rat Nest</StrVal>
  34.                 <Radius>8</Radius>
  35.             </GameModifier>
  36.         <!-- Success condition -->
  37.             <QuestConditionDef InternalName="Condition1">
  38.                 <Description>Escort the woman to the nest.</Description>
  39.                 <Class>Success</Class>
  40.                 <Type>ClearGoodieHut</Type>    
  41.                 <TextData>RatNest</TextData>
  42.                 <MoreTextData>EscortDaughter01</MoreTextData>
  43.                 <Flag>DestroyUnit</Flag>
  44.                 <Flag>UnitMustBeEscorted</Flag>
  45.                 <Flag>RevealTarget</Flag>
  46.             </QuestConditionDef>
  47.             
  48.         <!-- Failure condition -->
  49.             <QuestConditionDef InternalName="Condition2">
  50.                 <Description>Protect the woman.</Description>
  51.                 <CompletionText>You failed to protect the woman, you suck.</CompletionText>
  52.                 <Class>Failure</Class>
  53.                 <Type>UnitKilled</Type>    
  54.                 <Faction>Player</Faction>
  55.                 <TextData>EscortDaughter01</TextData>
  56.                 <NumericData>1</NumericData>
  57.             </QuestConditionDef>
  58.             
  59.         <!-- nest popup message -->
  60.             <ChoiceText>You find Time Loop inside the nest!</ChoiceText>
  61.             <ChoiceMedallion>Gfx\\Medallions\\CaveGrassland_Medallion.png</ChoiceMedallion>
  62.             <ChoiceMedallionFrame>Gfx\\Medallions\\Medallion_Frame_01.png</ChoiceMedallionFrame>                   
  63.     
  64.         <!-- Choice 0 -->
  65.              <QuestChoiceDef>
  66.             <Description>Enter the time Loop.</Description>
  67.             <NextObjectiveID>0</NextObjectiveID>
  68.             </QuestChoiceDef>
  69.             
  70.   </QuestDef>
  71.   </Quests>
Reason for Karma (Optional)
Successfully updated karma reason!
September 1, 2010 8:24:31 PM from Elemental Forums Elemental Forums

Hi, I tried to create a test quest using your guide but couldn't get it to work.

Following your steps I:

  • removed all the level 1 quest files
  • deleted my data.zip cache file
  • started the game and had it recompile the cache
  • exit game
  • dropped Quest_EscortNobleman1.xml and another test quest i made into my quest dir
  • start new game
  • reveal map and teleport to inn
  • enter inn
  • nothing happened

Is there a step I'm missing here?

Thanks

* EDIT * Ah nevermind, I found the issue - the nobleman escort quest did not have a triggerchance element by default

Reason for Karma (Optional)
Successfully updated karma reason!
September 2, 2010 3:39:29 AM from Elemental Forums Elemental Forums

Quoting psikatt,
Hi, I tried to create a test quest using your guide but couldn't get it to work.

Following your steps I:


removed all the level 1 quest files
deleted my data.zip cache file
started the game and had it recompile the cache
exit game
dropped Quest_EscortNobleman1.xml and another test quest i made into my quest dir
start new game
reveal map and teleport to inn
enter inn
nothing happened

Is there a step I'm missing here?

Thanks

* EDIT * Ah nevermind, I found the issue - the nobleman escort quest did not have a triggerchance element by default

 

For what it's worth, simply move the files to a temporary location next time, you don't have to re-create the cache while testing, if you can live with the long load times when the cache is not present.

Reason for Karma (Optional)
Successfully updated karma reason!
September 5, 2010 9:08:19 PM from Elemental Forums Elemental Forums

Novaburst, thank you for taking the time to write up this information.  It's very helpful.

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108433  walnut3   Server Load Time: 00:00:00.0000703   Page Render Time: