Jump to content

Passive Effect apply to Power Attack via Progression.xml


Recommended Posts

Hi, Im trying to make it so that knuckle items use 20% increased Stamina Use and deal 200% Block Damage on Power Attacks.

 

I was able to pull this off in the items.xml, but I'd have to copy and paste the code for each Knuckle Item.

 

I wanted to simplify that, so I've added this code into the progression.xml, which should effect all Knuckle weapons:

<append xpath="/progression/perks/perk[@name='perkBrawler']/effect_group">
  <requirement name="ItemHasTags" tags="perkBrawler"/>
    <passive_effect name="StaminaLoss" operation="perc_add" level="1,5" value=".2,1" tags="perkBrawler, secondary"/>
    <passive_effect name="BlockDamage" operation="perc_add" level="1,5" value="2,10" tags="perkBrawler, secondary"/>
</append>

 

 

Quick note, I needed the "requirement" line because without it, all weapons would be effected by the passive_effects. (With this line I could probably remove the "perkBrawler" from the tags.)
The issue I'm running into with the code above, is with Regular Attacks, they seem to be inheriting the passive_effects. I was hoping I could add "secondary" to the tags attribute so that only Power Attacks get the passive_effects. What do i need to add/change to make the passive_effects only work with Power Attacking?

 

Just for fun I'll provide my item.xml method incase anyone wanted to critique it / add suggestion to it:

Spoiler
<append xpath="/items/item[@name='meleeWpnKnucklesT0LeatherKnuckles']/effect_group[@name='Power Attack']">
  <!-- Perk Level 1 -->
  <passive_effect name="BlockDamage" operation="perc_add" value="2" tags="secondary">
      <requirement name="ProgressionLevel" progression_name="perkBrawler" operation="Equals" value="1"/>
  </passive_effect>
  <passive_effect name="StaminaLoss" operation="perc_add" value=".2" tags="secondary">
      <requirement name="ProgressionLevel" progression_name="perkBrawler" operation="Equals" value="1"/>
  </passive_effect>

  <!-- Perk Level 2 -->
  <passive_effect name="BlockDamage" operation="perc_add" value="4" tags="secondary">
      <requirement name="ProgressionLevel" progression_name="perkBrawler" operation="Equals" value="2"/>
  </passive_effect>
  <passive_effect name="StaminaLoss" operation="perc_add" value=".4" tags="secondary">
      <requirement name="ProgressionLevel" progression_name="perkBrawler" operation="Equals" value="2"/>
  </passive_effect>

  <!-- Perk Level 3 -->
  <passive_effect name="BlockDamage" operation="perc_add" value="6" tags="secondary">
      <requirement name="ProgressionLevel" progression_name="perkBrawler" operation="Equals" value="3"/>
  </passive_effect>
  <passive_effect name="StaminaLoss" operation="perc_add" value=".6" tags="secondary">
      <requirement name="ProgressionLevel" progression_name="perkBrawler" operation="Equals" value="3"/>
  </passive_effect>

  <!-- Perk Level 4 -->
  <passive_effect name="BlockDamage" operation="perc_add" value="8" tags="secondary">
      <requirement name="ProgressionLevel" progression_name="perkBrawler" operation="Equals" value="4"/>
  </passive_effect>
  <passive_effect name="StaminaLoss" operation="perc_add" value=".8" tags="secondary">
      <requirement name="ProgressionLevel" progression_name="perkBrawler" operation="Equals" value="4"/>
  </passive_effect>

  <!-- Perk Level 5 -->
  <passive_effect name="BlockDamage" operation="perc_add" value="10" tags="secondary">
      <requirement name="ProgressionLevel" progression_name="perkBrawler" operation="Equals" value="5"/>
  </passive_effect>
  <passive_effect name="StaminaLoss" operation="perc_add" value="1" tags="secondary">
      <requirement name="ProgressionLevel" progression_name="perkBrawler" operation="Equals" value="5"/>
  </passive_effect>
</append>

 

 

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

What does the configsdump look like? That perk has more than one effect group so that might be adding it to more than one or something.

 

Could try appending your new stuff as a new effect_group instead of adding it to the current ones. Maybe something like:

 

<append xpath="/progression/perks/perk[@name='perkBrawler']">
  <effect_group>
    <requirement name="ItemHasTags" tags="perkBrawler"/>
      <passive_effect name="StaminaLoss" operation="perc_add" level="1,5" value=".2,1" tags="secondary"/>
      <passive_effect name="BlockDamage" operation="perc_add" level="1,5" value="2,10" tags="secondary"/>
  </effect_group>
</append>

 

  • Like 1
Link to comment
Share on other sites

Sorry for the late responce, I went to bed and just woke up.

  

8 hours ago, bdubyah said:

What does the configsdump look like? That perk has more than one effect group so that might be adding it to more than one or something.

 

I gotta use that more often! Very useful to see how things are finalized.
 

  

8 hours ago, bdubyah said:

Could try appending your new stuff as a new effect_group instead of adding it to the current ones. Maybe something like:

 

<append xpath="/progression/perks/perk[@name='perkBrawler']">
  <effect_group>
    <requirement name="ItemHasTags" tags="perkBrawler"/>
      <passive_effect name="StaminaLoss" operation="perc_add" level="1,5" value=".2,1" tags="secondary"/>
      <passive_effect name="BlockDamage" operation="perc_add" level="1,5" value="2,10" tags="secondary"/>
  </effect_group>
</append>

 

 

Yeah this solved the issue, now only Power Attacks gain the increase for Block Damage and Stamina Loss. I guess with my code, like you said, it was adding it to all effect groups which the first effect group seems to be default values (which i'd be adding to)

 

Thanks!

 

Also side note, there are multiple effect_groups in perkBrawler in progression.xml. If I wanted to target and insert code into the 2nd effect_group, I'd probably have to do something like:

<insertAfter xpath="/progression/perks/perk[@name='perkBrawler']/effect_group[2]/requirement[1]">
  <triggered_effect trigger="onSelfSecondaryActionRayHit" action="PlaySound" sound="stonedestroy3"/>
  <passive_effect name="StaminaLoss" operation="perc_add" level="1,5" value=".2,1" tags="secondary"/>
  <passive_effect name="BlockDamage" operation="perc_add" level="1,5" value="20,100" tags="secondary"/>
</insertAfter>

 

(Checking the ConfigDump, it seems the code above does work, view spoiler for image of the effect of the code)
(Noting that it does insert the code with undesired indentation)

Spoiler

htl4X8T.png

 

Again, thanks. Learning a lot with this session.

Link to comment
Share on other sites

I would consider using a different approach that direct node order,

effect_group[2]/requirement[1]

because AFAIK, if the node order changes, it breaks your code.

Is it not possible to expand like;

/effect_group[@a='1' and @b='2']

to gain access to the specific node?

 

edit. Just viewed the spoiler.

I see the issue, effect_group has no attributes to test and the same requirements appear in more than one place.

Hmmm, try insertbefore and target the DismenmberChance ?

 

I am figuring out this modding/patching stuff myself, and thought I would try and help out a bit.

I mention the change in approach mainly because it might break if you use another mod that does something unexpected.

Using more specific targeting rather than direct node numbering might prevent future frustration?

 

Edited by Apaseall (see edit history)
  • Like 1
Link to comment
Share on other sites

8 hours ago, Apaseall said:

I would consider using a different approach that direct node order,

effect_group[2]/requirement[1]

because AFAIK, if the node order changes, it breaks your code.

 

 

This is true. There may be several ways to fix this.

 

The first - and best, in this case - is the one bdubya suggested: make your own effect group and append it.

 

Another option is to append to the first effect_group node that has a matching requirements node as a descendant. But that would also break if, in the future, the order of those effect_group nodes changes.

 

The third option is to append the first effect_group node that has a matching requirements node as a descendant, but does not have the "HitLocation" requirement. That will work and is relatively safe from breaking - but the XPath syntax is also fairly complicated.

 

So, I think sticking with bdubya's solution is the best.

  • Like 1
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
 Share

×
×
  • Create New...