Jump to content

Xpath data not updating


Crater Creator

Recommended Posts

I'm probably missing something here. I'm trying to get xpath mods working, and it seems like I can get the game to patch in the changes once, and then never again.

 

For my test, I'm using JaxTeller718_CoalInCampfireRecipe. This is a simple modlet that adds coal to the campfire recipe. I put this modlet in my Steam/SteamApps/common/7 Days to Die/7 Days to Die.app/Data/Mods (I'm on a Mac).

 

The first time I launched the game after Steam downloaded the latest update (b238), it applied the modlet: the campfire recipe was modified. But now, after that, it seems to ignore any further changes I make to the file. My test:

  • Quit the game entirely.
  • Change the amount of coal in the modlet's recipes.xml file.
  • Save this file in the text editor.
  • Verify in the OS that the right file was updated by checking the mod date.
  • Relaunch the game.
  • Create a new world.

 

The campfire recipe is still set to the modlet's original value, instead of the new value specified. All I did was change a number, so it can't be a syntax error. The console showed no errors.

 

I'm very puzzled, because in Alpha 16 I didn't even need to quit the game: the config was reloaded every time you continue a game. Do I need to manually force the game to re-generate the config files?

Link to comment
Share on other sites

I did have to guess about the filepath. However, if the filepath were wrong, the game never would have loaded the modlet, and the campfire recipe would be the same as in vanilla. Instead, the campfire recipe seems 'locked' in to what it was on first launch after downloading the latest build.

 

You put the mods folder Into the game folder so steam/common/7daystodie. Where the 7daystodie.exe is located

Link to comment
Share on other sites

I'm probably missing something here. I'm trying to get xpath mods working, and it seems like I can get the game to patch in the changes once, and then never again.

 

For my test, I'm using JaxTeller718_CoalInCampfireRecipe. This is a simple modlet that adds coal to the campfire recipe. I put this modlet in my Steam/SteamApps/common/7 Days to Die/7 Days to Die.app/Data/Mods (I'm on a Mac).

 

The first time I launched the game after Steam downloaded the latest update (b238), it applied the modlet: the campfire recipe was modified. But now, after that, it seems to ignore any further changes I make to the file. My test:

  • Quit the game entirely.
  • Change the amount of coal in the modlet's recipes.xml file.
  • Save this file in the text editor.
  • Verify in the OS that the right file was updated by checking the mod date.
  • Relaunch the game.
  • Create a new world.

 

The campfire recipe is still set to the modlet's original value, instead of the new value specified. All I did was change a number, so it can't be a syntax error. The console showed no errors.

 

I'm very puzzled, because in Alpha 16 I didn't even need to quit the game: the config was reloaded every time you continue a game. Do I need to manually force the game to re-generate the config files?

 

You have to restart the game for it to take effect I believe. The config files is just edited with the modlet info in memory, the actual files themselves arent modified on your pc. If thats what you meant. You could upload your tweaked modlet here, and I can have a look at it and try it in a world just to make sure its not something off with xml file.

Link to comment
Share on other sites

Don't know why. In my experience if you add a new folder/file within a folder within mods, or change localization.txt, you have to restart the whole game. But if you are just changing an xpath XML that already existed when the game started, all I have to do is exit to the main menu and re-enter a save for any changes to apply. This is what I usually do while testing as it's a lot faster to load a game after the first time.

 

Edit: ^ What Guppy said. Is it possible you have two mods affecting the same recipe?

Link to comment
Share on other sites

So this looks to be a multi-part issue.

 

First, I was editing a file in the wrong location. stallionsden is correct: the Mods folder goes in steam/common/7 Days to Die, the same folder as the executable, including on Mac. Thanks for the help.

 

Secondly, I must be making a logical error. I cleared out my modlet in progress and added my change directly to the one "CoalInTheCampfire" modlet since that one loads. That's now the only mod in the folder. I can change the numbers for the campfire recipe and see the change reflected in game, but the bedroll recipe I want to change stays stubbornly unchanged.

 

<configs>
[color="#FF8C00"]<set xpath="/recipes/recipe[@name='bedroll']/ingredient">
	<ingredient name="resourceCloth" count="5"/>
	<ingredient name="resourceCropCottonPlant" count="10"/>
</set>[/color]

<insertAfter xpath="/recipes/recipe[@name='campfire']/ingredient[@name='resourceRockSmall']">
	<ingredient name="resourceCoal" count="321"/>
</insertAfter>

</configs>

 

I'm new to the xpath syntax, so it's not entirely surprisingly I've made an error. My understanding is the code in orange above should search through all the "recipe" entries within "recipes", look for one whose name is "bedroll", and replace all the "ingredient" tags for that entry (no matter what or how many there are, since no specific match is specified) with the two "ingredient" lines within the <set> tag. Or in layman's terms, replace whatever ingredients are there with 5 cloth fragments and 10 cotton.

Link to comment
Share on other sites

Not quite. <set> is mainly used for changing attributes ie name=, count=, not for adding/changing entire lines. There are two ways to go about what you want.

 

<set xpath="/recipes/recipe[@name='bedroll']/ingredient/@name">resourceCloth</set>
<set xpath="/recipes/recipe[@name='bedroll']/ingredient/@count">5</set>
<append xpath="/recipes/recipe[@name='bedroll']">
 <ingredient name="resourceCropCottonPlant" count="10"/>
</append>

 

The "set"s would change any ingredients within the recipe, all name attributes to "resourceCloth" and all count attributes to "5". This isn't what you'd want anyway. You could use ingredient[1] for the first name+count for cloth, ingredient[2] for the second name+count for cotton, etc. However, since there is only one ingredient in the default bed roll, you would need to append the second ingredient because you have no second ingredient to change. What may be an easier way is to just remove the default ingredients and simply append the entire new recipe you want.

 

<remove xpath="/recipes/recipe[@name='bedroll']/ingredient"/>
<append xpath="/recipes/recipe[@name='bedroll']">
 <ingredient name="resourceCloth" count="5"/>
 <ingredient name="resourceCropCottonPlant" count="10"/>
</append>

 

I think you need an individual "remove" for each ingredient you're removing, so just duplicate the line for as many ingredients as are in the default recipe. It wouldn't simply remove any ingredient like I expected when I did it with no specifier, only the first.

Link to comment
Share on other sites

What's the preferred method for modding text files, like Localization - Quest.txt? Since this isn't xml, xpath doesn't work, and it seems I can't just put it in Mods/[name of mod]/Config. Is my only choice to split the mod, so users have to install files in two different places (Mods folder for xpath files, Data/Config folder for Localization - Quest.txt)?

Link to comment
Share on other sites

What's the preferred method for modding text files, like Localization - Quest.txt? Since this isn't xml, xpath doesn't work, and it seems I can't just put it in Mods/[name of mod]/Config. Is my only choice to split the mod, so users have to install files in two different places (Mods folder for xpath files, Data/Config folder for Localization - Quest.txt)?

 

There is no way YET to append the Localization files that I have ever seen, this is something a few have been asking for, however the main reason I believe is that its not an XML file but a TXT file and it doesn't quite work that way. SDX can help with that but at the end of the day the file needs to be pushed manually to a client to install. Unlike modlets and what not that can be pushed by the server.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...