Jump to content

Mod Appending Help


Recommended Posts

I have been messing and modifying things for my own server, and I am drawing a blank on how to alter/append something.

I am attempting to alter the following in the 7d2d buffs.xml

This is the current code inside the 7d2d buffs.xml I just want to alter the value of 5 to 15. I can do this on the server's files itself but I would like to know the modding/correct way to do it from that perspective. If you're looking for the buff itself it is on line 1103

		<effect_group>
			<requirement name="PlayerLevel" operation="LTE" value="5"/>
				<passive_effect name="ExpDeficitPerDeathPercentage" operation="base_set" value="0"/>
				<passive_effect name="ExpDeficitMaxPercentage" operation="base_set" value="0"/>
		</effect_group>

		<effect_group>
			<triggered_effect trigger="onSelfBuffUpdate" action="RemoveBuff" buff="buffNewbieCoat">
				<requirement name="PlayerLevel" operation="GT" value="5"/>
			</triggered_effect>

 

Link to comment
Share on other sites

The nodes in an xml file are set up in a hierarchy.  You can see that <requirement> is inside <effect_group>, which is inside the <buff> tag, which is inside <buffs>.  When you're writing xpath, you separate them with slashes.  You also have to identify which buff you want to target, and which effect_group, since there are more than one.  You also need to remember to do this to both requirement lines:

xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[1]/requirement"

xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[2]/triggered_effect/requirement"

 

Since there is only one requirement line in each effect_group, you don't need to identify it by name.  Now, since you want to set the value of the requirement to 15, you're going to want to do that to BOTH requirement lines so the buff is removed correctly.  Most people would use a set:
<set xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[1]/requirement/@value>15</set>
<set xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[2]/triggered_effect/requirement/@value>15</set>

 

I like to use setattribute sometimes; these lines do the same thing as the previous two:
<setattribute xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[1]/requirement" name="value">15</setattribute>
<setattribute xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[2]/triggered_effect/requirement" name="value">15</setattribute>

 

Hope that helps :)

As another example, let's say you wanted to change only the second requirement's operation to "GTE" (which is how 7 days says Greater Than or Equal to).  You could do it like this:
<set xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[2]/triggered_effect/requirement/@operation>GTE</set>

 

or like this:

<setattribute xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[2]/triggered_effect/requirement" name="operation">GTE</setattribute>

Link to comment
Share on other sites

On 7/9/2023 at 2:02 AM, Taien said:

The nodes in an xml file are set up in a hierarchy.  You can see that <requirement> is inside <effect_group>, which is inside the <buff> tag, which is inside <buffs>.  When you're writing xpath, you separate them with slashes.  You also have to identify which buff you want to target, and which effect_group, since there are more than one.  You also need to remember to do this to both requirement lines:

xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[1]/requirement"

xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[2]/triggered_effect/requirement"

 

Since there is only one requirement line in each effect_group, you don't need to identify it by name.  Now, since you want to set the value of the requirement to 15, you're going to want to do that to BOTH requirement lines so the buff is removed correctly.  Most people would use a set:
<set xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[1]/requirement/@value>15</set>
<set xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[2]/triggered_effect/requirement/@value>15</set>

 

I like to use setattribute sometimes; these lines do the same thing as the previous two:
<setattribute xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[1]/requirement" name="value">15</setattribute>
<setattribute xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[2]/triggered_effect/requirement" name="value">15</setattribute>

 

Hope that helps :)

As another example, let's say you wanted to change only the second requirement's operation to "GTE" (which is how 7 days says Greater Than or Equal to).  You could do it like this:
<set xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[2]/triggered_effect/requirement/@operation>GTE</set>

 

or like this:

<setattribute xpath="/buffs/buff[@name='buffNewbieCoat']/effect_group[2]/triggered_effect/requirement" name="operation">GTE</setattribute>

 

Yeah that explained exactly what I needed and what I was looking for!

I have a couple of similar questions now though, when it comes to setting the skill point costs of things how do I go about doing that? I am attempting to mess with the

 

base_skill_point_cost="1" cost_multiplier_per_level="1" max_level_ratio_to_parent="5"

 

but I am unable to figure out the way it is calculated, or at least the pattern to it? I set the Base Skill Points and Cost Multiplier to the above to 1 and 2.5 but for the 4 levels it produces 2, 6, 15, 39 for the costs.

Edit: I think I figured this one out, I don't like it but I know how it works now doing some math. Is there a way just to set the cost per level of the skill/attribute instead of doing a weird calculation thing or no?

2. I don't understand what max_level_ratio_to_parent implies or does?

3. I added it under a "new" attribute for my server, how do I fix/adjust the descriptions of things? I can't see where I can type them in for them to appear like other Attribute and trees

 

Example of the Attribute description key and stuff that idk how works

<effect_description level="1" desc_key="SkillRank1Desc" long_desc_key="SkillRank1infoDesc"/>

Example of the Perk desc_key

<level_requirements level="1"><requirement name="ProgressionLevel" progression_name="attEvil" operation="GTE" value="1" desc_key="reqEvilLevel01"/></level_requirements>

 

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

1.  The multiplier takes the base cost and multiplies by the multiplier for each level, and then truncates the decimal (removes it).  So the reason you got 2, 6, 15, 39 was because 1 * 2.5 = 2.5 (truncated to 2), 2.5 * 2.5 = 6.25 (truncated to 6), 6.25 * 2.5 = 15.625 (truncated to 15) etc.  So you can only fiddle with the base cost and the multiplier to make the cost increase (or decrease, really) as you level the skill.
2.  Not sure on that one, but I'd guess that it limits how many points you can have in the skill based on the parent attribute or something.

3. Descriptions of things go into your Localization.txt file.  Look at the default 7 days Localization to understand the format.  I tend to skip other languages because I'm lazy, so most of my Localization lines look kind of like this:
 

experienceBookSmall,items,Book,,,"Newbie's Journal",N/A,,,,,,,,,,,,,
experienceBookSmallDesc,items,Book,,,"This journal contains the experiences of a survivor of the wasteland...until they met their end, at least.  Perhaps you can learn a thing or two.",N/A,,,,,,,,,,,,,

 

So basically, you name your desc_key something unique to your skill.  Let's say your perk is called Planking (lol).  I would set desc_key="perkPlankingRank1Name" (because the desc_key is actually used for the name of the rank of the Attribute or skill) and long_desc_key="perkPlankingRank1Desc" (because this is where the actual description that shows up when you mouse over it goes).  Here's an example of the localization of the base Attribute for all extra skills on my server, called attExtra behind the scenes and "Continued Advancement" ingame:

attextra,progression,Attribute,,,Continued Advancement,N/A,,,,,,,,,,,,,
attExtraDesc,progression,Attribute,,,"You feel that there is more to learn, and this is the record of your continued journey towards godliness.",N/A,,,,,,,,,,,,,
attExtraName,progression,Attribute,,,Continued Advancement,N/A,,,,,,,,,,,,,
attExtraRank01Name,progression,Attribute,,,Merely Mortal,N/A,,,,,,,,,,,,,
attExtraRank02Name,progression,Attribute,,,Something More,N/A,,,,,,,,,,,,,
attExtraRank03Name,progression,Attribute,,,Enlightened,N/A,,,,,,,,,,,,,
attExtraRank04Name,progression,Attribute,,,Ascended,N/A,,,,,,,,,,,,,
attExtraRank05Name,progression,Attribute,,,Superhuman,N/A,,,,,,,,,,,,,
attExtraRank06Name,progression,Attribute,,,Heroic,N/A,,,,,,,,,,,,,
attExtraRank07Name,progression,Attribute,,,Mythical,N/A,,,,,,,,,,,,,
attExtraRank08Name,progression,Attribute,,,Angelic,N/A,,,,,,,,,,,,,
attExtraRank09Name,progression,Attribute,,,Invincible,N/A,,,,,,,,,,,,,
attExtraRank10Name,progression,Attribute,,,Godlike,N/A,,,,,,,,,,,,,
attExtraRank01Desc,progression,Attribute,,,"You are simply a mortal. You are just beginning the quest to enlightenment.\n\nLootstage +2, Max Health +25, Harvest Count and Mobility +10%",N/A,,,,,,,,,,,,,
attExtraRank02Desc,progression,Attribute,,,"You have become something more. What have you become, you ask? Who can say?\n\nLootstage +4, Max Health +50, Harvest Count and Mobility +20%",N/A,,,,,,,,,,,,,
attExtraRank03Desc,progression,Attribute,,,"You are starting to realize that there is more to existence than meets the eye.\n\nLootstage +6, Max Health +75, Harvest Count and Mobility +30%",N/A,,,,,,,,,,,,,
attExtraRank04Desc,progression,Attribute,,,"You see the air, hear the colors.\n\nLootstage +8, Max Health +100, Harvest Count and Mobility +40%",N/A,,,,,,,,,,,,,
attExtraRank05Desc,progression,Attribute,,,"You can bend reality in small ways.\n\nLootstage +10, Max Health +125, Harvest Count and Mobility +50%",N/A,,,,,,,,,,,,,
attExtraRank06Desc,progression,Attribute,,,"You are pretty sure you can feel the vibration of gravity. Heroes tremble when hearing your name.\n\nLootstage +12, Max Health +150, Harvest Count and Mobility +60%",N/A,,,,,,,,,,,,,
attExtraRank07Desc,progression,Attribute,,,"You feel that with just a little more effort, you could affect the orbit of the planet. Your strength and intellect are mythical.\n\nLootstage +14, Max Health +175, Harvest Count and Mobility +70%",N/A,,,,,,,,,,,,,
attExtraRank08Desc,progression,Attribute,,,"Certain that you have been sent with a purpose to right the universe, you have become stronger than any mortal.\n\nLootstage +16, Max Health +200, Harvest Count and Mobility +80%",N/A,,,,,,,,,,,,,
attExtraRank09Desc,progression,Attribute,,,"You have complete control over space. Now there is only the matter of time...\n\nLootstage +18, Max Health +225, Harvest Count and Mobility +90%",N/A,,,,,,,,,,,,,
attExtraRank10Desc,progression,Attribute,,,"You are the universe. Time and space are but thoughts you pondered briefly.\n\nLootstage +20, Max Health +250, Harvest Count and Mobility +100%",N/A,,,,,,,,,,,,,

Notice that the name of the very base of the attribute, attextra, is all lowercase.  This is a rule for some reason - if you don't use all small letters for the name of the base attribute, it won't show up correctly.  Also notice that there are quotes around the English localization on some lines.  This is because some special characters can't be used unless they're in quotes.  So theoretically you could enclose every entry in quotes, but it's only really necessary if you have special characters like a comma.  Since all my rank descriptions have commas, they're all in quotes.

Link to comment
Share on other sites

Thank you so much! When using a Localization.txt file, does this now make the mod Client-side required as well? I was trying to avoid that if possible but I understand if it isn't possible because of the specific changes needing to be made.

But yeah this explains pretty much everything I needed for now, I may have some questions later but thats all I had need for at this moment XD

Thank you again!

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...