Jump to content

Need help creating custom trader quests


mjrice

Recommended Posts

I'm trying to do something relatively simple to play around with the trader quest system. The idea was just to make a basic "go fetch" quest. In the example below the objective is supposed to be go to get 200 plant fibers and return them to the trader. But when I load this mod and access the trader, I get a NullReferenceException: Object reference not set to an instance of an object.

 

<append xpath="/quests">
<quest id="tier1_gofetch">
	<property name="name" value="go fetch" />
	<property name="subtitle" value="Just what I wanted!" />
	<property name="description" value="Ive got a hankering for something special" />
	<property name="icon" value="ui_game_symbol_quest" />
	<property name="repeatable" value="true" />
	<property name="category_key" value="quest" />
	<property name="offer" value="Here is my offer" />
	<property name="difficulty" value="easy" />
	<property name="difficulty_tier" value="1" />
	<property name="statement" value="here is my statement" />
	<property name="response" value="here is my response" />
	<property name="login_rally_reset" value="true" />

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

	<objective type="FetchKeep" id="resourceYuccaFibers" value="200" phase="1" >
		<property name="phase" value="1" />
	</objective>

	<objective type="ReturnToNPC">
		<property name="phase" value="2" />
	</objective>

	<objective type="InteractWithNPC">
		<property name="phase" value="2" />
	</objective>

	<reward type="Exp" value="1000" />
	<reward type="Item" id="casinoCoin" value="200-500" />

	<reward type="LootItem" id="questMelee,questRanged" ischosen="true" isfixed="true" value="1" />
	<reward type="LootItem" id="questArmor,questMedical" ischosen="true" isfixed="true" value="1" />
	<reward type="LootItem" id="questAmmo" ischosen="true" value="1" />
	<reward type="LootItem" id="questTools" ischosen="true" value="1" />
	<reward type="LootItem" id="questSchematics" ischosen="true" value="1" />
	<reward type="LootItem" id="questMods" ischosen="true" value="1" />

</quest>

</append>


<append xpath="/quests/quest_list[@id='trader_quests']">	
	<quest id="tier1_gofetch" />
</append>

Link to comment
Share on other sites

I made some progress but I could still use some help.

 

The solution to the first problem is that apparently the quest needs to be inserted in the xml before the quest list (I don't know why), so changing the first line to this makes it work:

 

<insertBefore xpath="/quests/quest_list[@id='trader_quests']">

 

However, the next problems are:

 

1. The name does not display on the list of quests (it just shows a blank entry with "Tier 1" next to it). But you can start the quest and it does give the proper instructions.

 

2. At the end of the quest the trader should take away the items you were sent to fetch, and instead he just gives the reward and leaves the items in the player inventory. I assume there is a way to do this, since that is how the original "fetch" style quests work but I don't know what I'm missing to make it happen.

Link to comment
Share on other sites

  • 2 weeks later...

I notice the base fetch quests have this line in them

 <objective type="FetchFromContainer">
		<property name="phase" value="3" />
		<property name="quest_item_ID" value="1" />
		<property name="item_count" value="1" />
		<property name="default_container" value="cntFetchQuestSatchel" />
	</objective> 

It might have something to do with that instead of using Fetch.

Link to comment
Share on other sites

  • 1 year later...

I've been messing around with quests a little and yeah, I think its weird that "quest_item_ID" value = 1 and all "Fetch" quests use it. I think its literally a special item that you have to have to let the trader know you "fetched it". I don't know (yet) if there's a way to make it a different item (like a named item, not some number). I believe the "FetchKeep" objectives are just to indicate you gathered "something", and don't need (or cannot) go back to the trader to get a reward because the items you gathered are not the special quest_item_ID item. I'm interested if anyone knows a way to get what you're trying to accomplish to work. Good luck!

Link to comment
Share on other sites

wait. I may have misspoken (not tested). I poked around and found this lingering in quests.xml

<quest_items max_count="100">

<quest_item id="1" name="questWhiteRiverSupplies" description_key="questSuppliesGroupDesc" icon="questWhiteRiverSupplies" icon_color="255,255,255"/>

<quest_item id="2" name="questCassadoreSupplies" description_key="questSuppliesGroupDesc" icon="questCassadoreSupplies" icon_color="255,255,255"/>

</quest_items>

 

I'm interpreting this as "if you add an item to this list, then it can be a fetcchable item". So maybe adding a 3rd line of:

<quest_item id="3" name="resourceYuccaFibers" ....>

 

Then using <property name="quest_item_ID" value="3" /> it will make it "fetchable" so when you return to the trader you can turn it in. I haven't tested it, but if this works I'll be a happy camper myself. I'll update here if I can get some testing done tonight

Link to comment
Share on other sites

wait. I may have misspoken (not tested). I poked around and found this lingering in quests.xml

 

 

I'm interpreting this as "if you add an item to this list, then it can be a fetcchable item". So maybe adding a 3rd line of:

<quest_item id="3" name="resourceYuccaFibers" ....>

 

Then using <property name="quest_item_ID" value="3" /> it will make it "fetchable" so when you return to the trader you can turn it in. I haven't tested it, but if this works I'll be a happy camper myself. I'll update here if I can get some testing done tonight

 

Cool! I am interested in this as well! :)

Link to comment
Share on other sites

TLDR: I don't think you can really change the current 2 quest items much using regular XMl modding, other than maybe? change the container the quest item is in. I can always be wrong though!

 

Whelp, I did not get far....

"quest_item id" appear to refer to a list you can append new stuff to BUT it appears there's a special property in the item that you point to called "LootList" e.g.

<property name="LootList" value="72"/>, which is applied to the items in "quest_item id" 1 and 2. The LootList is the list that loot is taken from. Seems easy then, just choose whatever LootList you want ( or add your own)....but ...it appears that LootList 72 in loot.xml is special and literally for the quest item:

 

<!-- cntFetchQuestSatchel -->

<lootcontainer id="72" count="0" size="6,2" sound_open="UseActions/open_backpack" sound_close="UseActions/close_backpack" open_time="1.5" loot_quality_template="qualBaseTemplate">

</lootcontainer>

 

So: From what I can tell, you can add a new item to the quest_items in quests.xml, BUT it has to point to one of the special items that are already in the lootlist

(questWhiteRiverSupplies or questCassadoreSupplies) which are in item_modifiers.xml ... which ultimately has to point to lootcontainer id="72" which is a special loot container. I think all of these special things are baked into the game so you can get the quest item from a POI (starting the quest causes the quest block to be spawned) and the quest item itself cannot be changed because its special as well (the item is what the trader needs, you cannot just make this any item).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...