Jump to content

xpath help


Recommended Posts

If I wanted to replace all of the starting quest with my own what is the best method with xpath to do that. Do I have to remove each old quest first and then append all my new quest. A little lost on this part. I have been reading but most of my work removes huge chunks of stuff and replaces way more than a line or two here and there.

Link to comment
Share on other sites

If at all edit the first quest and give your 2nd quest as reward.

No need to delete the others, simply never give them the player.

 

No idea if you can edit what quest you start with

 

Im sorry I'll be a little more specific. I want to use all of the quest but just change almost every value in each quest, just wondering if there is a way to just delete the old ones and insert all my new ones with the same names rather than xpath tons and tons of lines

Link to comment
Share on other sites

Still the same answer

If inside the bedroll quest the only thing you change is the rewarding quest you can implement all following quests as edited copys

and let the vanilla quests untuched

 

Sorry I still must not get it. I want this first quest and the following 7 quest to stay exactly the same, names and all just different objectives and requirements. On a short scale like this

<quest id="quest_BasicSurvival1">
	<property name="group_name_key" value="quest_BasicSurvival" />
	<property name="name_key" value="quest_BasicSurvival1" />
	<property name="subtitle_key" value="quest_BasicSurvival1_subtitle" />
	<property name="description_key" value="quest_BasicSurvival1_description" />
	<property name="icon" value="ui_game_symbol_map_bed" />
	<property name="category_key" value="quest" />
	<property name="difficulty" value="veryeasy"/>
	<property name="offer_key" value="quest_BasicSurvival_offer" />
	<property name="shareable" value="false" />

	<action type="ShowTip" value="tutorialTipQuest04" />
	<objective type="BlockPlace" id="woodFrameBlock" value="3" />
	<reward type="Quest" id="quest_BasicSurvival2" />
   </quest>

 

Now,I'll only be changing the objective types and requirements for all 7 quest but some of them have a lot of them. I thought there would be an easy way to bypass the games first 7 quest and call mine in with the exact same names? Hope that makes sense. And please can you show me in xpath code how you do it. I'm sorry I am not understanding this at all.

Link to comment
Share on other sites

I am not sure what you are asking but a couple examples might help.

 

You could remove an existing quest and replace it with you own by doing the following.

 

First, create your own empty file called quests.xml located in your Mods/yourmodname folder. Then put this code in it:

 

<configs>

<remove xpath="/quests/quest[@id='quest_BasicSurvival2']"/>
<append xpath="/quests">

<quest id="quest_BasicSurvival2">
	<property name="group_name_key" value="quest_BasicSurvival" />
	<property name="name_key" value="quest_BasicSurvival2" />
	<property name="subtitle" value="Craft two a Stone Axes" />
	<property name="subtitle_key" value="quest_BasicSurvival2_subtitle" />
	<property name="description_key" value="quest_BasicSurvival2_description" />
	<property name="icon" value="ui_game_symbol_hammer" />
	<property name="category_key" value="quest" />
	<property name="offer_key" value="quest_BasicSurvival_offer" />
	<property name="shareable" value="false" />

	<objective type="FetchKeep" id="resourceYuccaFibers" value="4" phase="1" />
	<objective type="FetchKeep" id="resourceWood" value="4" phase="1" />
	<objective type="FetchKeep" id="resourceRockSmall" value="8" phase="1" />

	<objective type="Craft">
		<property name="phase" value="2" />
		<property name="item" value="meleeToolStoneAxe" />
		<property name="count" value="2" />
	</objective>

	<reward type="Exp" value="100" />
	<reward type="Quest" id="quest_BasicSurvival3" />

   </quest>
</append>
</configs>

 

Now for the second quest in the chain the player would have to create two stone axes instead of one.

 

Another way you can change a quest is to just overwrite one or more of the settings directly (without removing the block entirely).

 

For example, in the same quests.xml in your mod's folder you could just say:

 

<set xpath="/quests/quest[@id='quest_BasicSurvival8']/reward[@type='SkillPoints']/@value">8</set>

 

And then the final quest would give 8 skill points instead of 4.

 

Hope that helps!

Link to comment
Share on other sites

Thank you for that, it helps a lot. What I'm trying to do now is from and old post I found where they were trying to recall the first quest but allowing it to change tutorialTipQuest01 pop ups text to cheat it and be able to keep using the pop up text. Any way you can help me make that work. In the end I want to be able to go through many different quest but from the looks of this code if it can work I should be able to keep referencing back to tutorialTipQuest01 and having it actually show tutorialTipQuest09 or any other one. Here is what I found if you wouldn't mind taking a look. Originally posted by sphereii.

<configs>
<config name="quests">
	<!-- Removes the existing quest -->
	<remove xpath="/quests/quest[@id='quest_BasicSurvival1']" />

	<!-- Re-adds it with your changes -->
	<insertBefore xpath="/quests/quest[@id='quest_BasicSurvival2]" >
		<quest id="quest_BasicSurvival1" group_name_key="Oh my...." name_key="Oh, this isnt looking good. o.0 Not one bit." subtitle_key="Lets get started" description_key="Lets get started with your lessons!" icon="ui_game_symbol_book" category_key="quest">
			<action type="ShowTip" value="tutorialTipQuest01" />
			<action type="ShowTip" value="tutorialTipQuest02" />
			<objective type="FetchKeep" id="keystoneBlock" value="1" />
			<reward type="Item" id="pufferCoatGreen" value="200" />
			<reward type="Item" id="flannelShirtRed" value="100" />
			<reward type="Item" id="overalls" value="100" />
			<reward type="Item" id="gunHuntingRifle" value="100" />
			<reward type="Item" id="762mmBullet" value="25" />
			<reward type="Item" id="Cookies" value="2" />
			<reward type="Item" id="snowShovel" value="100" />
			<reward type="Quest" id="quest_BasicSurvival2" />
		</quest>
	</insertBefore>
</config>
</configs>

 

It was in response to me asking pretty much the same question way back then and I still don't understand how to apply it all. I have been messing with it and trying to do what he has on the screen but I get errors everytime. I don't think I understand how to write the xpath stuff well enough yet.

Link to comment
Share on other sites

There was also this that I don't know how to add into my own stuff

<configs>
<config name="quests">
	<!-- Updates the second action, that has tutorialTipQuest02 as a value, and changes that value to tutorialTipQuest03 -->
	<!-- Read it like:  Under Quests, in a quest that has an ID of 'quest_BasicSurvival1', under the action that has the value -->
	<!-- attribute of 'tutorialTipQuest02', change that value to 'tutorialTipQuest03' -->
	<set xpath="/quests/quest[@id='quest_BasicSurvival1']/action[@value='tutorialTipQuest02']/@value">tutorialTipQuest03</set>

	<!-- Updates the number of cookies -->
	<set xpath="/quests/quest[@id='quest_BasicSurvival1']/reward[@id='Cookies']/@value">5</set>

	<!-- Inserts a new rewrd item called CandyCanes, after the reward item that matches the snowshovel -->
	<insertAfter xpath="/quests/quest[@id='quest_BasicSurvival1']/reward[@value='snowShovel']" >
		<reward type="Item" id="candyCanes" value="100" />
	</insertAfter>
</config>
</configs>

Link to comment
Share on other sites

There was also this that I don't know how to add into my own stuff

<configs>
<config name="quests">
	<!-- Updates the second action, that has tutorialTipQuest02 as a value, and changes that value to tutorialTipQuest03 -->
	<!-- Read it like:  Under Quests, in a quest that has an ID of 'quest_BasicSurvival1', under the action that has the value -->
	<!-- attribute of 'tutorialTipQuest02', change that value to 'tutorialTipQuest03' -->
	<set xpath="/quests/quest[@id='quest_BasicSurvival1']/action[@value='tutorialTipQuest02']/@value">tutorialTipQuest03</set>

	<!-- Updates the number of cookies -->
	<set xpath="/quests/quest[@id='quest_BasicSurvival1']/reward[@id='Cookies']/@value">5</set>

	<!-- Inserts a new rewrd item called CandyCanes, after the reward item that matches the snowshovel -->
	<insertAfter xpath="/quests/quest[@id='quest_BasicSurvival1']/reward[@value='snowShovel']" >
		<reward type="Item" id="candyCanes" value="100" />
	</insertAfter>
</config>
</configs>

 

You'll want to remove the <config name="quests"> and </config> in that XML for the game to parse it.

 

To add entirely new snippets of, you can do this:

 

Mods/Sorrowthief/Config/quests.xml:

<configs>

[indent]
<!-- Updates the second action, that has tutorialTipQuest02 as a value, and changes that value to tutorialTipQuest03 -->
<!-- Read it like:  Under Quests, in a quest that has an ID of 'quest_BasicSurvival1', under the action that has the value -->
<!-- attribute of 'tutorialTipQuest02', change that value to 'tutorialTipQuest03' -->
<set xpath="/quests/quest[@id='quest_BasicSurvival1']/action[@value='tutorialTipQuest02']/@value">tutorialTipQuest03</set>

<!-- Updates the number of cookies -->
<set xpath="/quests/quest[@id='quest_BasicSurvival1']/reward[@id='Cookies']/@value">5</set>

<!-- Inserts a new rewrd item called CandyCanes, after the reward item that matches the snowshovel -->
<insertAfter xpath="/quests/quest[@id='quest_BasicSurvival1']/reward[@value='snowShovel']" >
[indent]<reward type="Item" id="candyCanes" value="100" />
[/indent]

</insertAfter>

<!-- Add in entire new quest blocks -->
<append xpath="/quests">
   <quest name="mynewquest" >
           <!-- all your quest information -->
    </quest>
   <quest name="mynewquest2" >
           <!-- all your quest information -->
    </quest>
</append>
[/indent]


<!-- Adding in new quest lines to the trader list so (s)he'll give them out -->

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

</append>
[/indent]
</configs>

 

You can also use this to remove existing ones:

 

<remove xpath="/quests/quest[@name='theoldstartingquest']" />

Link to comment
Share on other sites

Thank you so much for taking the time to assist me. I think I am beginning to understand better and I am still watching the videos and reading the tutorials as much as I can in hopes that I don't have to bother you all so much. This first part in the one code you posted is the part that I thought would really help me do what I wanted. Am I reading this right?

 

<set xpath="/quests/quest[@id='quest_BasicSurvival1']/action[@value='tutorialTipQuest02']/@value">tutorialTipQuest03</set>

 

So say I had a new quest named quest_SearchForSurvivors01 could I do this with that code assuming I gave the quest Search for survivors the same 'tutorialTipQuest02' as the first quest

 

<set xpath="/quests/quest[@id='quest_SearchForSurvivors01']/action[@value='tutorialTipQuest02']/@value">tutorialTipQuest03</set>

 

 

Does that mean that I can have the First quest play the regular 'tutorialTipQuest02' and then when I get to the quest in the game quest_SearchForSurvivors01 that it will replace 'tutorialTipQuest02' with 'tutorialTipQuest03' and I can do this as many times as I want and I will not get those dll journal errors in the console? That is my main goal, to be able to keep having that popup screen happen without any errors. Please tell me I'm close to right on interpreting this correctly lol?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...