Jump to content

[Solved] Problem working with buffstatuscheck01.


Taien

Recommended Posts

Hello again fellows.  I am attempting to extend the maximum level at which you can gain HP from leveling.  My server allows a max level of 1000, but after 200 your HP and stamina stay locked.  I've found the relevant section of buffstatuscheck01:
 

<!-- Player HP / stamina per level -->
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="$PlayerLevelBonus" operation="set" value="@$LastPlayerLevel"/>
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="$PlayerLevelBonus" operation="add" value="-1">
	<requirement name="PlayerLevel" operation="LT" value="2"/>
</triggered_effect>
<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="$PlayerLevelBonus" operation="set" value="100">
	<requirement name="PlayerLevel" operation="GT" value="100"/>
</triggered_effect>

 

I'm attempting to adjust that last section because from my understanding it just takes your level and adds that to your base health of 100 each time you level up.  But I am having trouble selecting that line.  Here's the xml I'm attempting to use to path to that line:

 

<!--Adjust HP/stamina gaining to increase beyond 200-->
<setattribute xpath="/buffs/buff[@name='buffStatusCheck01']/effect_group/triggered_effect[cvar='$PlayerLevelBonus' and value='100']/requirement[@name='PlayerLevel']" name="value">900</setattribute>
<setattribute xpath="/buffs/buff[@name='buffStatusCheck01']/effect_group/triggered_effect[cvar='$PlayerLevelBonus' and value='100']" name="value">900</setattribute>

 

As you can see I'm trying to cap it at 1000 instead of 200.  Why?  Don't ask.  :p  But my patches are failing to apply to these lines.  Is there a better way to xpath to these lines?  Is the problem that the cvar I'm using as a selector has a dollar sign in it?

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

You want set instead of setattribute.  Setattribute is trying to add a new attribute to the line when you just want to change the value.  So what is happening is the game is trying to create the line based on your coding:

 

            <triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="$PlayerLevelBonus" operation="set" value="100" value='900'>

 

so your first line should be 

 

<set xpath="/buffs/buff[@name='buffStatusCheck01']/effect_group/triggered_effect[@cvar='@PlayerLevelBonus' and @value='100']/@value">900</set>

 

You also should note that you need the @ on both the cvar and value (inside the triggered_effect portion of your code).

 

Link to comment
Share on other sites

On 1/24/2023 at 12:57 PM, BFT2020 said:

You want set instead of setattribute.  Setattribute is trying to add a new attribute to the line when you just want to change the value.  So what is happening is the game is trying to create the line based on your coding:

 

            <triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="$PlayerLevelBonus" operation="set" value="100" value='900'>

 

so your first line should be 

 

<set xpath="/buffs/buff[@name='buffStatusCheck01']/effect_group/triggered_effect[@cvar='@PlayerLevelBonus' and @value='100']/@value">900</set>

 

You also should note that you need the @ on both the cvar and value (inside the triggered_effect portion of your code).

 

Ok well that second part is probably the problem - I used the dollar sign instead of @ because I didn't know which symbol I needed for variables...this is my first time having to find them with xpath 😛  I'll test that and let you know.

As for the first part....I can tell you that you're wrong about what setattribute does.  Setattribute lets you change any attribute in the line, and I've used it in many other places to change things other than the value. It will create the attribute if it doesn't exist, but if it does exist, it sets the existing attribute to the value you assign.  For example, I used it in traders.xml to do this:
 

	<setattribute xpath="/traders/trader_info[@open_time='6:05']" name="reset_interval">1</setattribute>
    <setattribute xpath="/traders/trader_info[@open_time='6:05']" name="open_time">4:05</setattribute>
    <setattribute xpath="/traders/trader_info[@max_items_swapped='20']" name="max_items_swapped">50</setattribute>
    <setattribute xpath="/traders/trader_info[@max_inventory='70']" name="max_inventory">100</setattribute>

 

That just makes the traders open at 4:05 instead of 6:05 and increases the amount of items they can carry.  Anyway, I'll test changing the variable to @PlayerLevelBonus in my xml and see if that works.  Will let you know.  Thanks :D

 

WOW I cannot believe that was the problem.  I forgot the @s before the search parameters.  I cannot believe I did that.  Noob mistake.  Here's the correct code that made it work as intended:

 

	<setattribute xpath="/buffs/buff[@name='buffStatusCheck01']/effect_group/triggered_effect[@cvar='$PlayerLevelBonus' and @value='100']/requirement[@name='PlayerLevel']" name="value">900</setattribute>
	<setattribute xpath="/buffs/buff[@name='buffStatusCheck01']/effect_group/triggered_effect[@cvar='$PlayerLevelBonus' and @value='100']" name="value">900</setattribute>

 

Link to comment
Share on other sites

  • Taien changed the title to [Solved] Problem working with buffstatuscheck01.

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