Jump to content

[Solved] Looking for an expert on adding quests.


Taien

Recommended Posts

I've created a new quest on my server as an attempt to learn how to make new quests. :p  The problem is that once I add it to the list of trader quests, the server throws a null reference exception each time it tries to get the list.  It's not game-breaking but it is annoying and so I'd like to solve it.  I'm certain it has something to do with the quest I added.  Here's the xml:
 

	<append xpath="/quests">
		<quest id="quest_FindMythril">
			<property name="name_key" value="quest_FindMythril"/>
			<property name="subtitle_key" value="quest_FindMythril_subtitle"/>
			<property name="description_key" value="quest_FindMythril_description"/>
			<property name="icon" value="ui_game_symbol_mining"/>
			<property name="repeatable" value="true"/>
			<property name="category_key" value="quest"/>
			<property name="offer_key" value="quest_FindMythril_offer"/>
			<property name="difficulty" value="medium"/>
			<property name="difficulty_tier" value="3"/>
			<property name="statement_key" value="quest_FindMythril_statement"/>
			<property name="response_key" value="quest_FindMythril_response"/>
			<property name="login_rally_reset" value="true"/>

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

			<objective type="FetchKeep" id="resourceMythrilPowder" value="100" phase="1"/>

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

			<objective type="InteractWithNPC">
				<property name="phase" value="2"/>
				<property name="nav_object" value="return_to_trader" />
			</objective>
				
			
			<reward type="Exp" value="5000"/>
			<!--<reward type="LootItem" id="groupQuestMods" ischosen="true" value="1"/>-->
			<reward type="Item" id="casinoCoin" value="800"/>
		</quest>
	</append>
	<append xpath="/quests/quest_list[@id='trader_quests']">
		<quest id="quest_FindMythril" />
	</append>

 

And here's the error I get from the server:
 

NullReferenceException: Object reference not set to an instance of an object
  at EntityTrader.PopulateQuestList () [0x00074] in <f6e64c46c798481d83242e5018924c0b>:0 
  at EntityTrader.OnUpdateLive () [0x00013] in <f6e64c46c798481d83242e5018924c0b>:0 
  at EntityAlive.OnUpdateEntity () [0x0001e] in <f6e64c46c798481d83242e5018924c0b>:0 
  at World.TickEntity (Entity e, System.Single _partialTicks) [0x00127] in <f6e64c46c798481d83242e5018924c0b>:0 
  at World.TickEntitiesSlice (System.Int32 count) [0x00037] in <f6e64c46c798481d83242e5018924c0b>:0 
  at World.TickEntitiesSlice () [0x00000] in <f6e64c46c798481d83242e5018924c0b>:0 
  at GameManager.UpdateTick () [0x00026] in <f6e64c46c798481d83242e5018924c0b>:0 
  at GameManager.gmUpdate () [0x00305] in <f6e64c46c798481d83242e5018924c0b>:0 
  at GameManager.Update () [0x00000] in <f6e64c46c798481d83242e5018924c0b>:0

 

For now I'll remove the quest from the list again, but I'm baffled as to what I'm missing.  I've added the appropriate entries in Localization.txt and even if I hadn't that wouldn't cause a null ref exception.  Any insight from someone who is an expert in the field of adding trader quests?

Edit:

Ok so thanks to help from the community here the solution is to insert new quests before the quest_list section so that they are the last quests in the list (first in the list also works, but I chose last in the list).  This is because if they are added after the quest list section, the quest list is loaded first and references a quest which hasn't been loaded yet, producing a null ref. 

 

Here's my current xml:
 

	<insertBefore xpath="/quests/quest_list[1]">
		<quest id="tier5_find_mythril">
			<property name="name_key" value="quest_FindMythril"/>
			<property name="subtitle_key" value="quest_FindMythril_subtitle"/>
			<property name="description_key" value="quest_FindMythril_description"/>
			<property name="icon" value="ui_game_symbol_mining"/>
			<property name="repeatable" value="true"/>
			<property name="category_key" value="quest"/>
			<property name="offer_key" value="quest_FindMythril_offer"/>
			<property name="difficulty" value="Medium"/>
			<property name="difficulty_tier" value="5"/>
			<property name="statement_key" value="quest_FindMythril_statement"/>
			<property name="response_key" value="quest_FindMythril_response"/>
			<property name="login_rally_reset" value="true"/>

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

			<objective type="RandomGotoNPC" phase="1">
				<property name="completion_distance" value="20"/>
				<property name="distance" value="100-200"/>
				<property name="nav_object" value="quest" />
        	</objective>
		
			<objective type="FetchKeep" id="resourceMythrilPowder" value="1000" phase="2"/>

			<objective type="Craft" id="resourceMythril" value="50" phase="3"/>

			<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="5000"/>
			<reward type="LootItem" id="schematicsToolsT2" ischosen="true" isfixed="true" value="5"/>
			<reward type="LootItem" id="schematicsWeaponsArmorT2" ischosen="true" isfixed="true" value="5"/>
			<reward type="LootItem" id="schematicsToolsT2" ischosen="true" value="5"/>
			<reward type="LootItem" id="schematicsToolsT2" ischosen="true" value="5"/>
			<reward type="LootItem" id="schematicsWeaponsArmorT2" ischosen="true" value="5"/>
			<reward type="LootItem" id="schematicsWeaponsArmorT2" ischosen="true" value="5"/>
			<reward type="Item" id="casinoCoin" value="800"/>
		</quest>
	</insertBefore>
    <append xpath="/quests/quest_list[@id='trader_quests']">
		<quest id="tier5_find_mythril" />
	</append> 

 

Edited by Taien (see edit history)
Link to comment
Share on other sites

First, have you tried the quest by itself to see if it works?

 

Type givequest quest_FindMythril in the console with dm mode on in a test world.  If it doesn't give you any errors, that quest is fine.

 

Not sure about the trader part, but if you notice the trader quests are setup in tiers (tier1, tier2, etc).  Try changing the quest name to follow the same pattern (tier1_FindMythril).

 

Those are a couple of things I would try at first.

Link to comment
Share on other sites

Ok, I tried giving myself the quest and it worked fine and I was able to turn it in.  I tried changing the name as well, and I'm still getting the error when the quest is in the trader list.  Maybe I'll try making it all lowercase as well, since the other quest names are all lowercase.

Nah, still not working.  The quest itself works fine, but I can't add it to the trader list without getting a null reference exception.  I'm stumped.

Link to comment
Share on other sites

Maybe it is just a pathing issue.  I noticed you are using append to insert it into the group, so it will add it to the end of trader_quests.  At the end of the trader_quests node, there are the special Find the next trader quests.  I wonder if putting it there rather than in front is causing the issue.

 

Maybe try this instead

<insertAfter xpath="/quests/quest_list[@id='trader_quests']/quest[@id='tier3_buried_supplies']">

<quest id="quest_FindMythril"/>

</insertAfter>

 

That should put this quest in the Tier3 grouping right after buried supplies.

Link to comment
Share on other sites

19 hours ago, Ganeshakw said:

Ask this question in the following forum. You will find experts there.

 

 

 

No, this is the proper place. This has nothing to do with Darkness Falls, that forum should only be used to ask questions about Darkness Falls.

 

23 hours ago, Taien said:

I've created a new quest on my server as an attempt to learn how to make new quests. :p  The problem is that once I add it to the list of trader quests, the server throws a null reference exception each time it tries to get the list.  It's not game-breaking but it is annoying and so I'd like to solve it.  I'm certain it has something to do with the quest I added.  Here's the xml:
 

	<append xpath="/quests">
		<quest id="quest_FindMythril">
			<property name="name_key" value="quest_FindMythril"/>
			<property name="subtitle_key" value="quest_FindMythril_subtitle"/>
			<property name="description_key" value="quest_FindMythril_description"/>
			<property name="icon" value="ui_game_symbol_mining"/>
			<property name="repeatable" value="true"/>
			<property name="category_key" value="quest"/>
			<property name="offer_key" value="quest_FindMythril_offer"/>
			<property name="difficulty" value="medium"/>
			<property name="difficulty_tier" value="3"/>
			<property name="statement_key" value="quest_FindMythril_statement"/>
			<property name="response_key" value="quest_FindMythril_response"/>
			<property name="login_rally_reset" value="true"/>

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

			<objective type="FetchKeep" id="resourceMythrilPowder" value="100" phase="1"/>

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

			<objective type="InteractWithNPC">
				<property name="phase" value="2"/>
				<property name="nav_object" value="return_to_trader" />
			</objective>
				
			
			<reward type="Exp" value="5000"/>
			<!--<reward type="LootItem" id="groupQuestMods" ischosen="true" value="1"/>-->
			<reward type="Item" id="casinoCoin" value="800"/>
		</quest>
	</append>
	<append xpath="/quests/quest_list[@id='trader_quests']">
		<quest id="quest_FindMythril" />
	</append>

 

And here's the error I get from the server:
 

NullReferenceException: Object reference not set to an instance of an object
  at EntityTrader.PopulateQuestList () [0x00074] in <f6e64c46c798481d83242e5018924c0b>:0 
  at EntityTrader.OnUpdateLive () [0x00013] in <f6e64c46c798481d83242e5018924c0b>:0 
  at EntityAlive.OnUpdateEntity () [0x0001e] in <f6e64c46c798481d83242e5018924c0b>:0 
  at World.TickEntity (Entity e, System.Single _partialTicks) [0x00127] in <f6e64c46c798481d83242e5018924c0b>:0 
  at World.TickEntitiesSlice (System.Int32 count) [0x00037] in <f6e64c46c798481d83242e5018924c0b>:0 
  at World.TickEntitiesSlice () [0x00000] in <f6e64c46c798481d83242e5018924c0b>:0 
  at GameManager.UpdateTick () [0x00026] in <f6e64c46c798481d83242e5018924c0b>:0 
  at GameManager.gmUpdate () [0x00305] in <f6e64c46c798481d83242e5018924c0b>:0 
  at GameManager.Update () [0x00000] in <f6e64c46c798481d83242e5018924c0b>:0

 

For now I'll remove the quest from the list again, but I'm baffled as to what I'm missing.  I've added the appropriate entries in Localization.txt and even if I hadn't that wouldn't cause a null ref exception.  Any insight from someone who is an expert in the field of adding trader quests?

 

I've run into this before. You're getting a null reference exception because you're appending your quest after everything else in the <quests> node. That includes the <quest_list>, <quest_items>, and <quest_tier_rewards> nodes.

 

So the trader quest list has an entry for your quest, but it can't find it, because it hasn't been loaded yet. (EDIT: this is because the XML is parsed from the top to the bottom, not all at once.)

 

You should either add your quest before the first quest, or after the last. I personally do the second option by inserting it before the first <quest_list> node, and not after the last <quest> node. That avoids cases where someone else makes the same mistake (it happens surprisingly often) and your quest goes after theirs.

 

Example:

 

    <insertBefore xpath='/quests/quest_list[1]'">
        <quest id="quest_FindMythril">
            <!-- ...snip... -->
        </quest>
    </insertBefore>
    <!-- This should work now -->
    <append xpath="/quests/quest_list[@id='trader_quests']">
        <quest id="quest_FindMythril" />
    </append>

 

EDIT: If you want to make sure it works, when the game starts, open the console (F1) and type "exportcurrentconfigs" (no quotes). It will dump the XML files to your save folder, and tell you the exact location where it saved them.

Edited by khzmusik (see edit history)
Link to comment
Share on other sites

10 hours ago, khzmusik said:

I've run into this before. You're getting a null reference exception because you're appending your quest after everything else in the <quests> node. That includes the <quest_list>, <quest_items>, and <quest_tier_rewards> nodes.

 

Thanks @khzmusik!  I was on the right path (pun intended) but didn't think about seeing where he was placing the initial quest in his file.

 

@Taien Try the changes that khzmusik gave you and it should work now.  And welcome to modding!  I did the same type of issue on the loot file early in my mod (I referenced a loot group that wasn't established until later in the file) so I automatically now try to place things in logical order when I do it.  I didn't put 2 + 2 together because my error message specifically told me that the lootgroup didn't exist rather than the general null reference error we see for a lot of issues.

10 hours ago, khzmusik said:

EDIT: If you want to make sure it works, when the game starts, open the console (F1) and type "exportcurrentconfigs" (no quotes). It will dump the XML files to your save folder, and tell you the exact location where it saved them.

 

Off topic, but is this step necessary?  Meaning having to type in exportcurrentconfigs?  What I have been doing is load up a new game with my changes in the mod folder, get to the point where the survivor has woken up (and I click on all the automatic messages at the start), then close the game.  Every time I did it this way, I was able to find my save config files and review them to see if my code is doing exactly like I want it to.

 

Curious if I am missing out on any important debugging information by not doing this step above.

 

Thanks!

Link to comment
Share on other sites

Thanks so much guys.  I will try that and get back to you.  But I'm sure you're right as you're the experts here. :)  I have a new problem I'm about to post about in a minute too, so fun times in the modding forum!

58 minutes ago, BFT2020 said:

 

Off topic, but is this step necessary?  Meaning having to type in exportcurrentconfigs?  What I have been doing is load up a new game with my changes in the mod folder, get to the point where the survivor has woken up (and I click on all the automatic messages at the start), then close the game.  Every time I did it this way, I was able to find my save config files and review them to see if my code is doing exactly like I want it to.

 

Curious if I am missing out on any important debugging information by not doing this step above.

 

Based on what the console says when you perform the command, I think it is done automatically on start every time and you already know the location so you're basically just ahead of the game BFT. :)  This is new to me so I appreciate the excessive information.

Link to comment
Share on other sites

  • Taien changed the title to [Solved] Looking for an expert on adding quests.

@khzmusik Thank you so much for your help.  May I ask one more question after this one?  The question is this:  

Is there a way to remove an item from the player's inventory once it has been acquired?  The quest makes the player find some mythril, but the player can use any mythril they have already mined to finish the quest by holding it in their inventory.  Or maybe there's a better way to track mining the ore than having it in your inventory.  I do have terrain blocks in the world that are made of the ore...is there a way to track breaks of a specific type of block instead of checking for 100 mythril in the inventory?  (See the OP above for the current objectives)

Link to comment
Share on other sites

So with the changes above, I can now load in and approach a trader without null errors.  And the quest works when given manually.  But no matter how many times I refresh the trader I cannot get it to show up in their list.  Am I missing something still?  

Link to comment
Share on other sites

2 minutes ago, Taien said:

So with the changes above, I can now load in and approach a trader without null errors.  And the quest works when given manually.  But no matter how many times I refresh the trader I cannot get it to show up in their list.  Am I missing something still?  

 

What level are you with the trader?  In your quest, you have it set at difficulty_tier of 3 which means given at the Tier 3 quests.  If you are only level 1 with the trader right now, then just change the tier from 3 to 1 and then refresh.  I 'believe' that is what controls where the trader gives out the quest, but I only did it once before as an experiment and that was some time ago.

Link to comment
Share on other sites

7 hours ago, Taien said:

@khzmusik Thank you so much for your help.  May I ask one more question after this one?  The question is this:  

Is there a way to remove an item from the player's inventory once it has been acquired?  The quest makes the player find some mythril, but the player can use any mythril they have already mined to finish the quest by holding it in their inventory.  Or maybe there's a better way to track mining the ore than having it in your inventory.  I do have terrain blocks in the world that are made of the ore...is there a way to track breaks of a specific type of block instead of checking for 100 mythril in the inventory?  (See the OP above for the current objectives)

 

I'm pretty sure doing what you want would require custom C# code.

 

I don't think it is possible to remove the items from the player's inventory after they have fetched them. There is a "Fetch" objective (which is unused in vanilla quests) that seems like it will remove the fetched items from the player's backpack - but not if the quest objective succeeds, only if it fails or is cancelled. I never messed around with it, so I don't know for sure that's how it works, or even if it works since it's not used.

 

Also, the fetch objectives trigger when an item is added to (or removed from) the player inventory or toolbelt. How it got there is not even considered.

 

There is another objective type, "BlockPickup", which is similar to "BlockPlace" and "BlockUpgrade". In essence it works like a "fetch" objective, except the object must be a block rather than an item, and it must be picked up (using the "E" key, i.e. not mined). But this objective is also not used in vanilla quests, so I don't know for sure how/if it works. It's also not all that useful since only certain blocks can be picked up (those with a "CanPickup" value of "true" - look in blocks.xml).

 

What you really want is some kind of "BlockDestroy" objective, and/or one that removes the items from the player's backpack or toolbelt when finished. You could do that but you'd need to write a Harmony patch and add a new C# class (a subclass of BaseObjective which adds one of its methods as a delegate to QuestEventManager.Current.BlockDestroy). That's a lot harder than writing XML (like months of learning harder), so I don't know if it's worth it.

Edited by khzmusik (see edit history)
Link to comment
Share on other sites

9 minutes ago, khzmusik said:

 

I'm pretty sure doing what you want would require custom C# code.

 

I don't think it is possible to remove the items from the player's inventory after they have fetched them. There is a "Fetch" objective (which is unused in vanilla quests) that seems like it will remove the fetched items from the player's backpack - but not if the quest objective succeeds, only if it fails or is cancelled. I never messed around with it, so I don't know for sure that's how it works, or even if it works since it's not used.

 

Also, the fetch objectives trigger when an item is added to (or removed from) the player inventory or toolbelt. How it got there is not even considered.

 

There is another objective type, "BlockPickup", which is similar to "BlockPlace" and "BlockUpgrade". In essence it works like a "fetch" objective, except the object must be a block rather than an item, and it must be picked up (using the "E" key, i.e. not mined). But this objective is also not used in vanilla quests, so I don't know for sure how/if it works. It's also not all that useful since only certain blocks can be picked up (those with a "CanPickup" value of "true" - look in blocks.xml).

 

What you really want is some kind of "BlockHarvest" objective, and/or one that removes the items from the player's backpack or toolbelt when finished. You could do that but you'd need to write a Harmony patch and add a new C# class (a subclass of BaseObjective). That's a lot harder than writing XML (like months of learning harder), so I don't know if it's worth it.

Is there a tutorial you'd recommend on how to get started with Harmony?  I'm an experienced C# coder and also have experience with Unity.  I'd be willing to code something to do this but I'm still a bit baffled as to how the modding api works.  I've been following some advice from another user about using dnSpy to look at the game's source code but I just started with that so I'm still pretty green to this whole thing (I've never modded before, only coded my own games from scratch).  If there were more documentation on modAPI and how to do things I'd be a bit farther along but there seems to be a big lack of documentation on 7 days modding :(  Mostly it seems people directly transfer knowledge through forum posts or other means. :p 

Anyway, I'm rambling, but it shouldn't be out of my wheelhouse to make a BlockHarvest objective type.  I just need to get more familiar with this stuff.

6 hours ago, BFT2020 said:

 

What level are you with the trader?  In your quest, you have it set at difficulty_tier of 3 which means given at the Tier 3 quests.  If you are only level 1 with the trader right now, then just change the tier from 3 to 1 and then refresh.  I 'believe' that is what controls where the trader gives out the quest, but I only did it once before as an experiment and that was some time ago.

 

I made sure I was on the proper tier.  The quest refuses to show up.  From what I'm reading on the forums, there are a lot of reasons why this might happen and it's very finicky.  I'd appreciate any suggestions as to why the quest wouldn't be showing up.  I'll repost the current state of the code in the OP above.

Link to comment
Share on other sites

Just now, Taien said:

Is there a tutorial you'd recommend on how to get started with Harmony?  I'm an experienced C# coder and also have experience with Unity.  I'd be willing to code something to do this but I'm still a bit baffled as to how the modding api works.  I've been following some advice from another user about using dnSpy to look at the game's source code but I just started with that so I'm still pretty green to this whole thing (I've never modded before, only coded my own games from scratch).  If there were more documentation on modAPI and how to do things I'd be a bit farther along but there seems to be a big lack of documentation on 7 days modding :(  Mostly it seems people directly transfer knowledge through forum posts or other means. :p 

Anyway, I'm rambling, but it shouldn't be out of my wheelhouse to make a BlockHarvest objective type.  I just need to get more familiar with this stuff.

 

...I was just coming here to mention that it's already been done.

 

Of course, it was SphereII who did it (he's pretty much the reigning C# guru around here). If you use his 0-SCore mod, it includes an objective called "ObjectiveBlockDestroySDX" (so you would reference it in the XML as "BlockDestroySDX, SCore").

 

I don't know why I never check SCore before telling people what C# code they'd have to write. He's usually done it already. :)

 

You can get SCore here:
https://github.com/SphereII/SphereII.Mods/tree/master/0-SCore

 

And, if you want to learn how to do C# coding specifically for this game, SphereII also has a sample project to import into Visual Studio to get you started:

https://github.com/SphereII/SphereII.Mods/tree/master/SampleProject

 

I've never seen any documentation on IModApi but it's pretty trivial to use. Nearly everyone makes a file like this, pretty much verbatim:
https://github.com/SphereII/SphereII.Mods/blob/master/SampleProject/Harmony/Init.cs

 

As long as the game sees that in your .dll it will load it into the game, so you don't even really need to use Harmony other than that if all you need is additional classes.

 

But if you do want to use Harmony, here's the documentation:

https://harmony.pardeike.net/articles/intro.html

 

The reason to use dnSpy is so that you can look through the code, to know which classes to either patch or extend. Any C# decompiler will work (like dotPeek), but dnSpy works really well if you want to browse the full code of a .dll at once.

 

If you want to set up Unity, Xyth is the guy for that. He has a basic project and tutorial here:
https://community.7daystodie.com/topic/17477-a20-consolidated-guide-to-modding-with-unity/

 

(It's what I use for my NPC Packs.)

 

It's a lot of information - but if you've already written a Unity game, then you should be able to pick it up.

Link to comment
Share on other sites

Huge, massive thanks for this.  This is a really good pile of links to bookmark.  And yeah, I've got my work cut out for me.  lol.  I'll try to resist my tendency to give up prematurely on this stuff when I get frustrated. :p 

Now if only I could get this quest to appear in the list (I must have refreshed the trader 100 times).  No more error, but no quest either.  I suppose I could just make notes to start the quests, but I REALLY wanted it to be a trader start.

Link to comment
Share on other sites

41 minutes ago, Taien said:

Now if only I could get this quest to appear in the list (I must have refreshed the trader 100 times).  No more error, but no quest either.  I suppose I could just make notes to start the quests, but I REALLY wanted it to be a trader start.

 

Did you take @BFT2020's suggestions? Make sure you're at the proper quest tier with the trader (the "difficulty_tier" value) or else it won't show up. Alternatively, make the quest a Tier 1.

 

And obviously, double-check the XML to make sure the XPath worked they way you thought it did, and look in the logs or console (F1) to see if there were any yellow warnings or red error messages.

Link to comment
Share on other sites

Figured it out, you need to have a NPC interaction as the first phase

 

I modified your code to make it Tier 1 and gather fibers, but here is what I added:

        <objective type="RandomGotoNPC" phase="1">
        </objective>
    
        <objective type="FetchKeep" id="resourceYuccaFibers" value="10" phase="2"/>

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

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

 

And added one to the phase starting with the FetchKeep objective.  SS below, don't mind the issues on the  name and description as I didn't have your localization file and was too lazy to create my own.

 

image.thumb.jpeg.5b6800b78b1aada078244b17949ce791.jpeg

 

image.thumb.jpeg.4e26f03d9792f480c839b85545a56bb3.jpeg

Link to comment
Share on other sites

Awesome, thank you so much BFT.  I would have never guessed that.  You are a god.

Note to self and others for the future:  If you are making quests that start at a TRADER, there are two important things:
-Make sure you insert your quest xml after the last quest but before any other xml or it will cause a null error
-Make sure the first objective in your quest is RandomGotoNPC as shown above by BFT

Link to comment
Share on other sites

13 hours ago, BFT2020 said:

Figured it out, you need to have a NPC interaction as the first phase

 

I modified your code to make it Tier 1 and gather fibers, but here is what I added:

        <objective type="RandomGotoNPC" phase="1">
        </objective>
    
        <objective type="FetchKeep" id="resourceYuccaFibers" value="10" phase="2"/>

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

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

 

And added one to the phase starting with the FetchKeep objective.  SS below, don't mind the issues on the  name and description as I didn't have your localization file and was too lazy to create my own.

 

 

Ok so I tested it with your code, and it worked the first time.  So I tested it again, and on the second attempt I couldn't get the first phase to work (it showed a distance of 0.0km).  After that I couldn't get it to work again.  But it does show in the list, so that's progress. :)

Link to comment
Share on other sites

Ok, I used some examples from the vanilla xml to change your phase one to this:
 

<objective type="RandomGotoNPC" phase="1">
	<property name="completion_distance" value="20"/>
	<property name="distance" value="100-200"/>
	<property name="nav_object" value="quest" />
</objective>

Now it's working every time I test it and it shows in the list.  Thank you so much for your help BFT :)

Link to comment
Share on other sites

	<insertBefore xpath="/quests/quest_list[1]">
		<quest id="tier5_find_mythril">
			<property name="name_key" value="quest_FindMythril"/>
			<property name="subtitle_key" value="quest_FindMythril_subtitle"/>
			<property name="description_key" value="quest_FindMythril_description"/>
			<property name="icon" value="ui_game_symbol_mining"/>
			<property name="repeatable" value="true"/>
			<property name="category_key" value="quest"/>
			<property name="offer_key" value="quest_FindMythril_offer"/>
			<property name="difficulty" value="Medium"/>
			<property name="difficulty_tier" value="5"/>
			<property name="statement_key" value="quest_FindMythril_statement"/>
			<property name="response_key" value="quest_FindMythril_response"/>
			<property name="login_rally_reset" value="true"/>

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

			<objective type="RandomGotoNPC" phase="1">
				<property name="completion_distance" value="20"/>
				<property name="distance" value="100-200"/>
				<property name="nav_object" value="quest" />
        	</objective>
		
			<objective type="FetchKeep" id="resourceMythrilPowder" value="1000" phase="2"/>

			<objective type="Craft" id="resourceMythril" value="50" phase="3"/>

			<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="5000"/>
			<reward type="LootItem" id="schematicsToolsT2" ischosen="true" isfixed="true" value="5"/>
			<reward type="LootItem" id="schematicsWeaponsArmorT2" ischosen="true" isfixed="true" value="5"/>
			<reward type="LootItem" id="schematicsToolsT2" ischosen="true" value="5"/>
			<reward type="LootItem" id="schematicsToolsT2" ischosen="true" value="5"/>
			<reward type="LootItem" id="schematicsWeaponsArmorT2" ischosen="true" value="5"/>
			<reward type="LootItem" id="schematicsWeaponsArmorT2" ischosen="true" value="5"/>
			<reward type="Item" id="casinoCoin" value="800"/>
		</quest>
	</insertBefore>
    <append xpath="/quests/quest_list[@id='trader_quests']">
		<quest id="tier5_find_mythril" />
	</append> 

This is what works for me.  But it's still a little buggy in online mode.  It starts from a place that isn't the trader.  I'm going to try expanding the range and see if maybe the problem is just that it can't find a location close to the trader with that short a distance.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...