• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Trouble Adjusting Quest Objectives

Ashiel

New member
I'm trying to create a simple modlet for my friends that changes the clear quests to kill x zombies instead (reason spoilered below for anyone who cares), where the number of zombies to be killed is based on the tier of the quest.

We've been playing 7d2d and some of the clear quests keep bugging out on us where we can't complete them (the most egregious was one at a power station that the orange final zombie marker was floating in the air in a spot with no zombies and nothing to interact with).


Spoilered below is the quest from quests.xml.

<!-- *** CLEAR_QUESTS -->
<quest id="tier1_clear">
<property name="name_key" value="quest_tier1_clear" param1="name"/>
<property name="subtitle_key" value="quest_clear_subtitle"/>
<property name="description_key" value="quest_clear_description"/>
<property name="icon" value="ui_game_symbol_quest"/>
<property name="repeatable" value="true"/>
<property name="category_key" value="quest"/>
<property name="offer_key" value="quest_tier1_clear_offer" param1="offer"/>
<property name="difficulty_tier" value="1" param1="difficulty"/>
<property name="statement_key" value="quest_clear_statement"/>
<property name="response_key" value="quest_clear_response"/>
<property name="login_rally_reset" value="true"/>
<property name="reward_choices_count" value="5"/>
<property name="extra_tags" value="" param1="extra_tags"/>
<property name="shareable" value="true"/>

<property name="completiontype" value="TurnIn"/>
<property name="completion_key" value="quest_clear_completion"/>

<objective type="RandomPOIGoto">
<property name="phase" value="1"/>
<property name="biome_filter_type" value="SameBiome" param1="biome_filter_type"/>
<property name="biome_filter" value="" param1="biome_filter"/>
<property name="nav_object" value="quest"/>
<property name="poi_tier" value="-1" param1="poi_tier"/>
</objective>

<objective type="RallyPoint">
<property name="phase" value="2"/>
<property name="nav_object" value="rally"/>
</objective>

<objective type="ClearSleepers">
<property name="phase" value="3"/>
<property name="nav_object" value="sleeper_volume"/>
</objective>

<objective type="POIStayWithin">
<property name="phase" value="3"/>
<property name="radius" value="25"/>
</objective>

<action type="UnlockPOI" >
<property name="phase" value="4"/>
</action>

<objective type="ReturnToNPC">
<property name="phase" value="4"/>
<property name="nav_object" value="return_to_trader"/>
</objective>

<objective type="InteractWithNPC">
<property name="phase" value="4"/>
<property name="nav_object" value="return_to_trader"/>
</objective>

<reward type="Exp" value="3000"/>
<reward type="Item" id="casinoCoin" value="400"/>

<reward type="LootItem" id="groupQuestFood,groupQuestAmmo,groupQuestSchematics" ischosen="true" value="1"/>
<reward type="LootItem" id="groupQuestFood,groupQuestAmmo,groupQuestSchematics" ischosen="true" value="1"/>
<reward type="LootItem" id="groupQuestFood,groupQuestAmmo,groupQuestSchematics" ischosen="true" value="1"/>
<reward type="LootItem" id="groupQuestFood,groupQuestAmmo,groupQuestSchematics" ischosen="true" value="1"/>
<reward type="LootItem" id="groupQuestMedical,groupQuestAmmo,groupQuestSchematics" ischosen="true" value="1"/>
<reward type="LootItem" id="groupQuestResourcesT0" ischosen="true" value="1"/>
<reward type="LootItem" id="groupQuestResourcesT0,groupQuestT1SkillMagazineBundle" ischosen="true" value="1"/>
</quest>



The modlet I made to adjust the quest is as follows.

<configs>

<!-- Tier 1 - Clear Quests -->
<!-- Remove the ClearSleepers objective. -->
    <remove xpath="/quests/quest[@id='tier1_clear']/objective[@type='ClearSleepers']" />
   <!-- Replace the ClearSleepers objective with EntityKill to count zombies killed. -->
    <insertAfter xpath="/quests/quest[@id='tier1_clear']/objective[@type='RallyPoint']" >        
        <objective type="EntityKill" value="4" phase="3"/>
    </insertAfter>
    
</configs>




This worked perfectly. If I take a t1 clear quest, upon activating the rally point you're tasked with killing 4 zombies. After killing 4 zombies, you can return to the trader and turn in the quest.

The problem comes in with the T2+ versions of the quests. Spoilered below is the T2 version of the clear quest from quests.xml for reference.

<quest id="tier2_clear" template="tier1_clear">
<variable name="name" value="quest_tier2_clear"/>
<variable name="offer" value="quest_tier2_clear_offer"/>
<variable name="difficulty" value="2"/>
<variable name="extra_tags" value=""/>
<variable name="biome_filter_type" value="SameBiome"/>
<variable name="biome_filter" value=""/>

<reward type="Exp" value="4500"/>
<reward type="Item" id="casinoCoin" value="500"/>

<reward type="LootItem" id="groupQuestFood,groupQuestAmmo,groupQuestSchematics,groupQuestMods" ischosen="true" value="2"/>
<reward type="LootItem" id="groupQuestFood,groupQuestAmmo,groupQuestSchematics,groupQuestMods" ischosen="true" value="2"/>
<reward type="LootItem" id="groupQuestMedical,groupQuestAmmo,groupQuestSchematics,groupQuestMods" ischosen="true" value="1"/>
<reward type="LootItem" id="groupQuestMedical,groupQuestAmmo,groupQuestSchematics,groupQuestMods" ischosen="true" value="1"/>
<reward type="LootItem" id="groupQuestMedical,groupQuestAmmo,groupQuestSchematics,groupQuestMods" ischosen="true" value="2"/>
<reward type="LootItem" id="groupQuestResourcesT0,seedsNoFlowers" ischosen="true"/>
<reward type="LootItem" id="groupQuestResourcesT0,groupQuestT1SkillMagazineBundle" ischosen="true"/>
</quest>



Pretty much just forwards everything from the t1 by using the tier1_clear quest as a template, just changing the variables in some of the properties and overwrites the rewards. However, for some reason it breaks the kill count objectives. The EntityKill objective seems to get forwarded  by the template but killing zombies doesn't advance the counter at all (and thus breaks the quest). For example, here's what the T1 clear quest does when killing zombies, versus what the T2 clear quest does when killing zombies.

Tier 1 Quest Objectives
image.png


Tier 2 Quest Objectives

image.png


I asked on the Unofficial Modding Discord but we were unable to collectively figure out what's wrong. I had suspected that I would need to overwrite the objective in the same way that the rewards are overwritten for the quest, but nothing really seems to be working at all. At this point, I'm considering removing the T2+ versions of the quest and rewriting them entirely without templating them, just to see if it would work if they're stand-alone. I feel like this is something that's probably very simple but I'm overlooking something.

Any help/suggestions would be appreciated. ♥

 
I dont know if this will help, but my experience with templates is that changes to the base template dont appear to effect anything derived from the template. I usually end up rewriting all the derived objects to achieve what I want.  I'm guessing it has something to do with how the engine is reading the xml and creating objects from the code. For your problem I would delete all of the relevant quests and create them from scratch the way I want them to behave. If it works, I would then reduce the code to balance it i.e. first make something entirely mine that works then see if I can modify the existing code to match the same behaviour knowing that as a final resort I can just use the fully rewritten code if I need because I know that works.

cheers

 
Back
Top