Jump to content
Sign in to follow this  
mr.devolver

Advanced xpath help needed

Recommended Posts

Hello!

 

I was trying to create a small modlet patch to change some settings in Xyth's NPCs. The idea was to have one modlet patch that would make some changes without changing the original files, so that the changes are applied even if the Xyth's NPCs mod itself gets an update.

 

I started with some first changes for testing which must go to entityclasses.xml file, so entityclasses.xml of my mod looks like this:

<configs>

<set xpath="/entity_classes/entity_class[starts-with(@name, 'NPC')]/effect_group[@name='Base Effects']/passive_effect[@name='HealthMax']/@value">800</set>

<set xpath="/entity_classes/entity_class[starts-with(@name, 'NPC')]/effect_group[@name='Base Effects']/passive_effect[@name='HealthChangeOT']/@value">10</set>

</configs>

 

Unfortunately, this doesn't work and I have no idea why. In the game, I receive no errors related to this mod, just two warnings telling me that my settings did not apply. I tried to solve this with couple of minor changes, but no matter what I tried, it always failed to apply in game.

 

What the heck am I doing wrong?

EP3Od9O.jpg

Share this post


Link to post
Share on other sites

Those are valid xpath. Which modlet are you adding them? Are they adding before the NPC pack loads?

Share this post


Link to post
Share on other sites

Same as Sphereii, Id guess your xpath is happening before the NPC mod xpath. Also, be careful as there are 2 lines that might be changed with your xpath line:

<passive_effect name="HealthMax" operation="base_set" value="200"/>

<passive_effect name="HealthMax" operation="perc_set" value="1"/>

Share this post


Link to post
Share on other sites

Thanks guys, so how can I set the load order to make sure my patch is loaded after the mod itself?

 

And Xyth, thanks for reminding me of that other value, I guess that would give me some more headache once the patch gets applied. What does that other value HealthMax with operation "perc_set" does anyway?

Share this post


Link to post
Share on other sites

Modlets load in alphabetical order so if you prefix the Modlet Z it will load after the xyth NPC mod.

Share this post


Link to post
Share on other sites

I will hopefully be back and active soon, have some real life stuff I have to bring to a close and deal with at present .

 

Regards

Ragsy !!

Share this post


Link to post
Share on other sites

If people plan on modifying the NPC mod I should probably prefix it with 1- to indicate it builds on the 0- creature pack. Then folks wont have these issues in the future.

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...