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

Removing xp

Thanks Prisma but the xp pop up is actually not a problem. With no xp being earned there is no pop up.

 
It can certainly be used as base dll to patch with sdx. As long as there is no sdx patchscript doing the same as my edit. That would make my dll obsolete anyways. But i just made this for vanilla players who dont want the popup, so there is no worry about sdx compatibility from my side.

Cheers

 
Yeh the new mod launcher compiles on the go, so the downside is scripts will be visible to all, but the upside is sdx will be seamless to the end user and you can mix sdx mods.

And bottom line is scripts are visible to anyone who REALLY wants to look at them anyway, so...

Sdx is definitely the way to go imo. Hell I may even learn coding. :)

 
Yeh the new mod launcher compiles on the go, so the downside is scripts will be visible to all, but the upside is sdx will be seamless to the end user and you can mix sdx mods.
And bottom line is scripts are visible to anyone who REALLY wants to look at them anyway, so...

Sdx is definitely the way to go imo. Hell I may even learn coding. :)
Naaah. I dont do clientside mods really. This patch was made over morning coffee cause i saw some threads and posts that were indicating there was a demand for it. I do serverside patching with harmony and this lil patch will probab be the only clientside patch ill ever make. Ill stick to harmony and let the sdx stuff to those that want to do clientside mods :)

Cheers

 
I want to attempt creating a modlet to change the quest rewards from giving experience to giving skill points. I want to change this:

Code:
<quest id="tier1_clear">
	<snip>
	<reward type="Exp" value="5000" />
	<snip>
</quest>
into this:

Code:
<quest id="tier1_clear">
	<snip>
	<reward type="SkillPoints" value="1" />
	<snip>
</quest>
My question is whether there is a way through xpath to change "Exp" into "Skillpoints" and set the new amount in one step or do I first have to append the new line I want and remove the old line as two steps? What would be the best xpath function to use in this case?

Also, will I be able to change all quests or will I have to write a pathway for tier1 quests, tier2 quests, tier3 quests, etc separately?

I have already gone in and changed the actual quests.xml as shown above and know that it works and that it is awesome-- but I'd like to try it as a modlet and I'm hoping what I want to do isn't going to be too difficult of a challenge for my first time.

Here is my first stab at it. Any correction or better way tips would be appreciated.

Code:
<set xpath="/quests/quest/reward[@type='exp']/@type">Skillpoints</set>   
   <set xpath="/quests/quest/reward[@type='skillPoints'][@value='*']/@value">1</set>
-----------update-------------------

I got some help from dancapo with my syntax. I had the right idea but just didn't quite have it written out correctly. Hopefully I will come to learn this as I go. Here is the correct code.

Code:
<set xpath="/quests/quest/reward[@type='Exp']/@type">SkillPoints</set>
<set xpath="/quests/quest/reward[@type='SkillPoints']/@value">1</set>
As you can see overthought it and assumed that I had to first identify what the original value was before setting it to a new value and I was using the asterisk as a wild card for variable amounts of xp rewards from the various quests. But all that needed to be done was to specify what the new value should be for that reward type. I was so close and yet so far.... But now I feel ready to try my hand at a few other adjustments.

 
Last edited by a moderator:
My current project is trying to shorten the starter quest down to five tasks

Craft and Place Bedroll

Craft stoneaxe

Craft Club

Craft Bow and Arrows

Craft (but not place) wood frames

Last night I worked for a frustrating amount of time trying to get the quest to skip from stoneaxe to club so it would bypass the clothes making and wearing quests. I got the xpath line the way I thought it should be but it didn't work. So I tried several variations and then finally posted the one I thought was best on discord and asked for some critique and went to bed feeling like I wasn't understanding any of this at all.

Today I went on discord and saw my answer: I failed to capitalize one word.

All I could feel was relief that I at least DID understand the logic of the xpath and it was just a careless syntax error. whew! But it was a good lesson in checking for those small details instead of just assuming that I'm completely off base.

I also learned the importance of not doing too much at once. Make one change and check to see if it works then add another step otherwise finding the mistake is too hard. Maybe when I get better at it I'll be able to do things in larger chunks but for now its gotta be line check line check line check line check...

I am having a really hard time with the remove xpath. I want to remove the need to place and upgrade the wood frames. Has anyone removed lines from the xml using xpath that could share how remove works exactly? I tried doing it like append but just doing remove instead and it didn't work.

 
Last edited by a moderator:
I'd just "skip" it by editing the quest before it to point to the one after it, but...

<remove xpath="/blocks/block[@name=cntCar03SedanDamage0]/drop[@name=resourceLeather]" />

...so for mine I'm going deep into the blocks, but for yours, you could just point to the quest. I don't have the quest.xml handy but it would look something like:

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

 
Last edited by a moderator:
Think of each item in the "path" path/path2/path3/path4 as a "node", i.e.

<block>

</block>

...so by selecting something to DO with that "node", it does it to the ENTIRE node. So this remove will delete the ENTIRE node that has the node "quest" with a name that matches "questname".

 
Okay thanks. I’ll give it a try. It’s like you said before—I’m generally understanding the logic but the syntax is killing me and it’s usually just one minor thing.

I also tend to want to be too specific. I was thinking I had to list the exact lines I wanted removed rather than just pointing to the node that contains those lines.

 
Last edited by a moderator:
I by no means have this crap memorized, so I'm constantly trial and erroring it. :)

Thankfully I've enough mods made that I can copy paste what I need from one to the other... I may not remember the syntax, but I can still remember what mod I did something similar in. :) .

 
Very good night! Everything I tried worked great. I better understand the remove xpath line now that I'm thinking in nodes as Guppy suggested.

I take it that xpath can't change the localization xmls because nothing looked like a node to me.... So I just changed my localization_quests file directly so that my new starter quest path pleasingly says 1/5, 2/5, 3/5, 4/5, and 5/5.

I am super proud of my new starter quest. It works exactly as I hoped it would. I think I over designed it because I orginally thought that if I changed all the names that that would be enough to have it go from 1-5 instead of skipping around up to 8. But it was good practice setting attributes to new attributes and removing others and appending lines and as I said it all went great.

At the end of the five quest chain you have 5 skillpoints (1 for each part) and the trader quest starts up just as it should. For those interested here is my xpath code (yes it is very over produced I'm sure). Just remember that if you want the messaging on screen to match as you go through the five tasks you have to change it in localization_quests as well.

Code:
<configs>
<!-- <This changes all quests in the game to give a skillpoint instead of experience /> -->
<set xpath="/quests/quest/reward[@type='Exp']/@type">SkillPoints</set>
<set xpath="/quests/quest/reward[@type='SkillPoints']/@value">1</set>

<!-- <This deletes the original quests 3, 4, and 8 /> -->	
<remove xpath="/quests/quest[@id='quest_BasicSurvival3']"/>
<remove xpath="/quests/quest[@id='quest_BasicSurvival4']"/>
<remove xpath="/quests/quest[@id='quest_BasicSurvival8']"/>

<!-- <This changes the remaining quests to become the new 3, 4, and 5 (or so I thought)  /> -->	
<set xpath="/quests/quest[@id='quest_BasicSurvival5']/@id">quest_BasicSurvival3</set>
<set xpath="/quests/quest[@id='quest_BasicSurvival6']/@id">quest_BasicSurvival4</set>
<set xpath="/quests/quest[@id='quest_BasicSurvival7']/@id">quest_BasicSurvival5</set>

<!-- <This repoints each quest to the next new quest in the altered chain /> -->	
<set xpath="/quests/quest[@id='quest_BasicSurvival3']/reward[@type='Quest']/@id">quest_BasicSurvival4</set>
<set xpath="/quests/quest[@id='quest_BasicSurvival4']/reward[@type='Quest']/@id">quest_BasicSurvival5</set>

<!-- <This alters quest five by removing the tasks of placing and upgrading the blocks and moves the final rewards and beginning of the trader quest to the new quest 5 /> -->	
<remove xpath="/quests/quest[@id='quest_BasicSurvival5']/objective[@type='BlockPlace']"/>
<remove xpath="/quests/quest[@id='quest_BasicSurvival5']/objective[@type='BlockUpgrade']"/>
<remove xpath="/quests/quest[@id='quest_BasicSurvival5']/reward[@type='Quest']"/>	
<append xpath="/quests/quest[@id='quest_BasicSurvival5']">
	<reward type="Quest" id="quest_whiteRiverCitizen1">
		<property name="chainquest" value="false" />
	</reward>
	<reward type="SkillPoints" value="1" chainreward="true" />
</append>

</configs>
 
That's good to know. But am I right in assuming you have to just provide the modded file for others to replace rather than being able to use xpath?

 
Correct. The only way to get around replacing the whole localization file is patching through sdx. Personally I think making localization xpath compatible should be one of the top priorities.

 
I wouldn't say top, but certainly one of the top modding priorities. Finishing buffs, localization, and pushing models/poi's/icons.

- - - Updated - - -

That's good to know. But am I right in assuming you have to just provide the modded file for others to replace rather than being able to use xpath?
Yeh so when you make your git folder you can set up the folder structure there, and just have your localization file (complete WITH the vanilla one, as in already appended, thus not just the changes) in the folder structure. So when someone downloads it, the file structure is like:

/data/configs/localization.txt

/mods/modname/stuff

...they unzip it into the game folder, and it'll ask you to overwrite the localization.txt, the mods go into the right folder, boom. Done and distributed.

(I'm going from memory so the structure may be off, but you get the idea)

 
Back
Top