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

Question about removing quests and challenges

RestInPieces

New member
Want to completely remove quests (not traders) and challenges from the game.

After doing the modifications listed below they get removed, however, after a while, I get constant null reference errors in the console (after starting a new game) and can't play the game

Does anyone know a way which will let me remove them cleanly?

Thanks.

quests.xml:

<config>
<remove xpath="/quests/quest"/>
<remove xpath="/quests/quest-list"/>
<remove xpath="/quests/quest_items"/>
<remove xpath="/quests/quest_tier_reward"/>
</config>




challenges.xml:

<config>
<remove xpath="/challenges/challenge"/>
<remove xpath="/challenges/challenge_category"/>
<remove xpath="/challenges/challenge_group"/>
</config>



The null reference error in question is this (I have also tried to keep quest list but it still throws a null reference for quests)

Code:
NullReferenceException: Object reference not set to an instance of an object
  at EntityTrader.PopulateQuestList () [0x00050] in <cf106f0fabce4b568ad6c0e783024e88>:0 
  at EntityTrader.OnUpdateLive () [0x00013] in <cf106f0fabce4b568ad6c0e783024e88>:0 
  at EntityAlive.OnUpdateEntity () [0x00035] in <cf106f0fabce4b568ad6c0e783024e88>:0 
  at World.TickEntity (Entity e, System.Single _partialTicks) [0x0011e] in <cf106f0fabce4b568ad6c0e783024e88>:0 
  at World.TickEntitiesSlice (System.Int32 count) [0x00037] in <cf106f0fabce4b568ad6c0e783024e88>:0 
  at World.TickEntitiesSlice () [0x00000] in <cf106f0fabce4b568ad6c0e783024e88>:0 
  at GameManager.UpdateTick () [0x00026] in <cf106f0fabce4b568ad6c0e783024e88>:0 
  at GameManager.gmUpdate () [0x00495] in <cf106f0fabce4b568ad6c0e783024e88>:0 
  at GameManager.Update () [0x00000] in <cf106f0fabce4b568ad6c0e783024e88>:0
 
Last edited by a moderator:
A couple of things.

 - Can you post the error from the log file?

 - Did you modify one or more Challenges,  start a game and then modify the Challenges again - or use an old save after removing them?

   Challenges are not coded like the other xml perks/attribute settings. They do not reset on change.

   My experience is that whenever you modify the Challenges you need to start a new game to test else you will see null error.

   Its like the Challenges are registered with some kind of Agent on first initialisation. Removing challenges doesn't remove them from whatever is referencing them. So the game still thinks the old Challenges should be available. (I cant remember if the issue was with {Remove/Add and Modify} or just {Remove/Add} - it was a while ago.)

   If you could look at the Challenges Window you might be able to see that the Challenge Row isn't displaying properly - though I dont think you can with the error spamming.

Hope that helps

cheers

 
Last edited by a moderator:
You can remove all the quests by muting the traders:

in npc.xml:

<set xpath="/npc/npc_info[@id='traderbob']/@dialog_id">traderMute</set>
<set xpath="/npc/npc_info[@id='traderhugh']/@dialog_id">traderMute</set>
<set xpath="/npc/npc_info[@id='traderrekt']/@dialog_id">traderMute</set>
<set xpath="/npc/npc_info[@id='traderjen']/@dialog_id">traderMute</set>
<set xpath="/npc/npc_info[@id='traitorjoel']/@dialog_id">traderMute</set>




In dialogs.xml:

<!-- see also npc.xml -->
<dialog id="traderMute" startstatementid="start">
<!-- Statements -->
<statement id="start" text="dialog_trader_statement_start">
<!-- no response statements - no trades or quests -->
</statement>
</dialog>


You need the Statement element else mucho errors. You can also keep the statements for Trading, but I removed them in my code.

When someone talks to a trader they only see the the NEXT option. (unless you keep the Trade Statements)

They can still trade using the round popup menu.

If you want to stop Trading completely:

In npc.xml:

<!-- traderInfo 33 is defined in traders.xml
This stops all trading -->
<set xpath="/npc/npc_info[@id='traderbob']/@trader_id">33</set>
<set xpath="/npc/npc_info[@id='traderhugh']/@trader_id">33</set>
<set xpath="/npc/npc_info[@id='traderrekt']/@trader_id">33</set>
<set xpath="/npc/npc_info[@id='traderjen']/@trader_id">33</set>
<set xpath="/npc/npc_info[@id='traitorjoel']/@trader_id">33</set>




and in traders.xml:

<!-- used in npc.xml - all traders have their traderInfo replaced with this one so they dont trade -->
<insertAfter xpath="/traders/trader_info[@id='10']">
<trader_info id="33" reset_interval="3" allow_sell="false" open_time="6:05" close_time="21:50">
<!-- nothing to trade -->
</trader_info>
</insertAfter>




cheers

 
Last edited by a moderator:
Thank you very much for the reply Joe. Updated the OP.

It is a new game - this error seems to be caused by the quest list that has to be populated. However I still got an error when I left the quest list in the game and just removed the quests. When I got time, I will reproduce that.

I wanted to keep trading. Will look into how to remove quest statements only, or mute them and trade via that menu you mentioned (not sure which it is). Thanks again!

 
Last edited by a moderator:
Thank you very much for the reply Joe. Updated the OP.

It is a new game - this error seems to be caused by the quest list that has to be populated. However I still got an error when I left the quest list in the game and just removed the quests. When I got time, I will reproduce that.

I wanted to keep trading. Will look into how to remove quest statements only, or mute them and trade via that menu you mentioned (not sure which it is). Thanks again!


Yeah, deleting all the quests may not delete all the static references in code. So my prefered way was to change the text dialog options the player sees when interacting with the trader.

>or mute them and trade via that menu you mentioned (not sure which it is).

In npc.xml each trader has a npc_info object e.g:

<npc_info
id="traitorjoel"
name="Traitor Joel"
name_key="npc_traitorJoel"
faction="whiteriver"
portrait="npc_joel"
greeting_type="nearby"
stance="Like" voice_set="trader_joel"
trader_id="1" dialog_id="trader" quest_faction="1"
localization_id="npcTraderJoel"
quest_list="trader_joel_quests"
dms_section_type="TraderJoel"
/>




The dialog_id property binds the Trader text options to the trader.

The dialog_id in the above example "trader" is defined in dialogs.xml

The 'trader' dialog is fairly large so am not going to post it but look for the line:

<dialog id="trader" startstatementid="start">

In that object you can see the flow of options and statements that the player can see and interact with.

I copied the whole 'trader' dialog, renamed it and then cut out what I didnt need. Then assigned my new 'trader' dialog (now called 'traderMute') to each npc_info object for each Trader.

Hope that helps

Cheers

 
Last edited by a moderator:
Muted them, thanks! I can use the radial menu but I get an error as soon as I interact with the trader.

I get a "traderMute was not present in the dictionary error". Could it be that something else has to reference it as well? 

The error is this so it has something do to with the UI.

2025-03-06T21:51:03 132.588 ERR [XUi] Error while updating window group 'radial':
2025-03-06T21:51:03 132.590 EXC The given key 'traderMute' was not present in the dictionary.
at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <31687ccd371e4dc6b0c23a1317cf9474>:0
at XUiC_DialogWindowGroup.OnOpen () [0x000aa] in <cf106f0fabce4b568ad6c0e783024e88>:0
at XUiWindowGroup.OnOpen () [0x00006] in <cf106f0fabce4b568ad6c0e783024e88>:0
at GUIWindowManager.Open (GUIWindow _w, System.Boolean _bModal, System.Boolean _bIsNotEscClosable, System.Boolean
_bCloseAllOpenWindows) [0x000d0] in <cf106f0fabce4b568ad6c0e783024e88>:0
at GUIWindowManager.Open (System.String _windowName, System.Boolean _bModal, System.Boolean _bIsNotEscClosable,
System.Boolean _bCloseAllOpenWindows) [0x0004d] in <cf106f0fabce4b568ad6c0e783024e88>:0
at EntityTrader.ActivateTrader (System.Boolean traderIsOpen) [0x00103] in <cf106f0fabce4b568ad6c0e783024e88>:0
at EntityTrader.OnEntityActivated (System.Int32 _indexInBlockActivationCommands, Vector3i _tePos, EntityAlive
_entityFocusing) [0x00021] in <cf106f0fabce4b568ad6c0e783024e88>:0
at XUiC_Radial.handleEntityCommand (XUiC_Radial _sender, System.Int32 _commandIndex, XUiC_Radial+RadialContextAbs
_context) [0x0000b] in <cf106f0fabce4b568ad6c0e783024e88>:0
at XUiC_Radial.CallContextAction () [0x000b4] in <cf106f0fabce4b568ad6c0e783024e88>:0
at XUiC_Radial.Update (System.Single _dt) [0x00117] in <cf106f0fabce4b568ad6c0e783024e88>:0
at XUi.OnUpdateDeltaTime (System.Single updateDeltaTime) [0x00159] in <cf106f0fabce4b568ad6c0e783024e88>:0
Un
ityEngine.StackTraceUtility:ExtractStringFromException(Object)
Log:Exception(Exception)
XUi:OnUpdateDeltaTime(Single)
XUiUpdater:Update()
XUiUpdateHelper:LateUpdate()




This is radial

<window_group name="radial" actionSet="keyboard" controller="Radial">
<window name="windowRadial" />
</window_group>




And this is WindowRadial

<window name="windowRadial" anchor="CenterCenter">
<rect name="radialPanel" repeat_content="true" repeat_count="12" pivot="center">
<radial_entry />
</rect>
<label depth="10" name="selection" width="150" height="50" pivot="center" justify="center" text=" " font_size="26" />
</window>




From the others, could only find "XUiC_DialogWindowGroup" in the ConfigDump folder. No "trader" reference of the original dialog id so that I can replace it.

Code:
    <window_group name="dialog" controller="XUiC_DialogWindowGroup" close_compass_on_open="true">
      <window name="windowRespondentName" />
      <window name="windowStatement" />
      <window name="windowResponses" />
    </window_group>
 
Last edited by a moderator:
None of the windows from your post are an issue.

Can you post your code and also check your log file to make sure your xml was parsed correctly and not ignored with a WRN.

My first read of the error is that when loading the trader's options it cant find the traderMute Dialog - but I could be wrong.

Edit: Also, you can instead just replace the existing 'trader' dialog with your own instead adding a new one - then you dont have to change the dialog_id in the npc_info object.

cheers

 
Last edited by a moderator:
None of the windows from your post are an issue.

Can you post your code and also check your log file to make sure your xml was parsed correctly and not ignored with a WRN.

My first read of the error is that when loading the trader's options it cant find the traderMute Dialog - but I could be wrong.

Edit: Also, you can instead just replace the existing 'trader' dialog with your own instead adding a new one - then you dont have to change the dialog_id in the npc_info object.

cheers


The dialog xml seems to be getting ignored actually with a "Patch type (statement) unknown" error:

2025-03-07T10:41:32 54.981 WRN XML.Patch (/dialog/statement, line 3 at pos 6): Patch type (statement) unknown
2025-03-07T10:41:32 54.982 WRN XML patch for "dialogs.xml" from mod "ClassicHardCore" did not apply: <statement id="start" text="dialog_trader_statement_start" (line 3 at pos 6)



Used this and it worked! I think I get it now - thank you for all your help!
 

Code:
  <config>
    <append xpath="/dialogs">
      <dialog id="traderMute" startstatementid="start">
        <!-- Statements -->
        <statement id="start" text="dialog_trader_statement_start">
        </statement>
      </dialog>
    </append>
  </config>
 
Last edited by a moderator:
Back
Top