• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Hybrid Learn By Use (Action Skills) - XML modlet

Discovered the reason why it bugs. If you destroy a block on the VERY first hit of the action skill, it will bug. (It wants to add XP from both and it doesn't like it)
I removed the bonus XP on destroy and no more bug :)
Hi Frantic Dan,

Thanks, thats much appreciated. Have added a line to deal with that use case now.

Was going to mention that the thought behind a max level of 50 was that for some Perks the range increments

of  'effect over the number of levels' dont scale well up to 100.

<passive_effect name="EntityDamage" operation="perc_add" value="0.01,0.25" level="1,50" />

e.g. the value="0.01,0.25" above, increases by 0.005 every level - it would be 0.0025 for 100 levels.

The value 0.005 was the threshold for the level cap at 50 as I'm not sure about rounding or truncating errors at 4 decimal places. I think the code only uses 3 decimal places but am not sure.

It can be thought of as being Instead of 50 levels, its actually 100 levels but we are only counting every 2nd level. It then uses the config settings to determine how long it takes to get max level.

cheers

 
Last edited by a moderator:
Found another potential issue with the mod ...

Trap kills (blades, darts, etc.) increase the action skill for whatever weapon you happen to be holding at the time.

The fix is to change the requirement `HoldingItemHasTags` to `ItemHasTags`. Just thought I'd give you the heads-up :)

 
Found another potential issue with the mod ...

Trap kills (blades, darts, etc.) increase the action skill for whatever weapon you happen to be holding at the time.

The fix is to change the requirement `HoldingItemHasTags` to `ItemHasTags`. Just thought I'd give you the heads-up :)
Thank you for noticing this - I've now fixed it and after a bit of regression testing uploaded the change :)

There are so many little details - hopefully it wont all change again in A22.

cheers

 
New version 1.0.6 released. 

A balancing update with an additional config option.

Any chance of getting the Athletics LBD skill back to mix with the modern Cardio perk?
Same with Medical skill and Physician perk. And Pain Resist skill with Pain Tolerance perk.

EDIT again: Here's of a list of other action skills I've thought of that would add feeling of progression:
 

  • Athletics
  • Medical
  • Pain resist
  • Heat resist
  • Cold resist
  • Butchering
  • Bartering
  • Looting


Following up on this Frantic Dan. After working through the code for a while, the remaining Perks that are not covered by Learn By Use (LBU) generally fall  into one of the following 3 categories. (in general we are working with code that was abandoned some way through in favour of the current Perk model)

- The Perk action doesnt have a trigger to indicate when the action is taking place. The code cant increase any level xp without a situational trigger.

- The Perk action has a trigger but it never fires - e.g. buying and selling.

- The Perk action has a trigger and it fires but its value is small enough that it would affect the balance if it was used in Learn By Use.

   e.g. Cardio: The Perk tree increases cardio to a max of 30%. Splitting this between the LBU and the Cardio Perk would mean investing 3 Perk Points only gets a total of 15% increase in the Cardio Perk. So there wouldn't be much incentive to invest any points in the Cardio Perk tree, which may change the balance a bit too much.

Am open to comments on balance and any feedback on how to add more of the Perks to Learn By Use. Outside of one or two I'm still playing with, I dont know if I should add any more at this time.

Cheers

 
- The Perk action has a trigger and it fires but its value is small enough that it would affect the balance if it was used in Learn By Use.

   e.g. Cardio: The Perk tree increases cardio to a max of 30%. Splitting this between the LBU and the Cardio Perk would mean investing 3 Perk Points only gets a total of 15% increase in the Cardio Perk. So there wouldn't be much incentive to invest any points in the Cardio Perk tree, which may change the balance a bit too much.

Am open to comments on balance and any feedback on how to add more of the Perks to Learn By Use. Outside of one or two I'm still playing with, I dont know if I should add any more at this time.

Cheers
I personally think 5% for the first level in cardio is fine, since it is unlocked already, so only 1 point investment. Level 2 could be 7% and level 3 8% for a total of 20%, and LBU is the remaining 10%

 
I personally think 5% for the first level in cardio is fine, since it is unlocked already, so only 1 point investment. Level 2 could be 7% and level 3 8% for a total of 20%, and LBU is the remaining 10%


Thats not a bad idea (splitting it 10/20) - I dont usually use that Perk so will play around with it. Am working on a short side story/challenge for the Survival No Trader mod at the moment but it shouldnt take much to add it if it fits. Appreciate the feedback.

cheers

 
The Hybrid Learn by Use (Action Skills) mod works in single player but not in multiplayer.
Hi Onlineritter,

Are you able to be a little more specific? Are there any errors in the log file? I was also wondering if there is no progression regardless of use or something else that not working

Any feedback you could provide would be appreciated.

Cheers

 
The Hybrid Learn by Use (Action Skills) mod works in single player but not in multiplayer.


Dropped a 1.0.5 update that puts in a fix for this but am not able to fully test.

It looks like the OnSelfEnteredGame trigger in progression.xml (that sets the config vars) does not get called in multiplayer within the context of an Attribute.

Moved all config variable initialisation from progression.xml to buffs.xml.

Cheers

 
Last edited by a moderator:
Nice mod!

Please be aware that 7d2d on linux is case sensitive. So lower case config folder and localization will not be read. Should be "Config" and "Config/Localization.txt".

 
KoolaLobita said:
Nice mod!

Please be aware that 7d2d on linux is case sensitive. So lower case config folder and localization will not be read. Should be "Config" and "Config/Localization.txt".
I should have know that, thanks for the heads up. Will correct it this evening and drop an update.

Cheers

 
Hey, I like your idea very much. I was building an unreleased perk mod myself and was wondering if you have taken a look at how Khaine does the Looting Perk in Darkness Falls for example.

I cant really replicate what the perk does with your additions and explanations. My aim was to make some specific looting perks, like just buffing the looting of individual loot sources like trash. I already was successfull adding normal perks that achieve this, but I thought some learning perks would fit better after all.

Cheers!

PS: Thanks for the very detailed documentation on your code, that really helped a lot. Im not that new to modding, but the xml files are quite different to stuff I'm used to from other games.

 
Hey, I like your idea very much. I was building an unreleased perk mod myself and was wondering if you have taken a look at how Khaine does the Looting Perk in Darkness Falls for example.

I cant really replicate what the perk does with your additions and explanations. My aim was to make some specific looting perks, like just buffing the looting of individual loot sources like trash. I already was successfull adding normal perks that achieve this, but I thought some learning perks would fit better after all.

Cheers!

PS: Thanks for the very detailed documentation on your code, that really helped a lot. Im not that new to modding, but the xml files are quite different to stuff I'm used to from other games.
Hi Flogi,

Apologies for not getting back to you sooner.

I dont see an action skill in DF for looting but I may have missed it. (the last DF I played was A20) Based on what you said though I found something in the code that I need to test. In the DF xml code in buffs.xml - the buff buffLevelUpTracking is tracking level-ups and has the following code:

<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="$xpFromLootThisLevel" operation="set" value="@_xpFromLoot"/>




The code above is the same in the 7DTD codebase - which means the _xpFromLoot variable is not a DF specific variable. Am wondering if this variable can be used to measure change over time and then used for progression along a loot path.

At the bottom of buffs.xml (and also in XML.xml file) there is documentation on the xml code syntax etc. It shows 2 events for looting

onSelfItemLooted, //Hook Up
onSelfLootContainer


I wasnt able to use either of these, they are not hooked into the framework and dont fire. (or at least I couldn't get them to)

e.g.  <triggered_effect trigger="onSelfItemLooted" action="ModifyCVar" cvar="lootXPCounter" operation="add" value="6"/> <!--doesnt work-->

The above is only an issue if you want to measure what the player is doing to level the perk up. To just apply a looting perk (without have to monitor a players looting frequency) you could use something like the following:

<passive_effect name="LootStage" operation="perc_add" value=".1" tags="some_tag"/>
<passive_effect name="ScavengingTime" operation="perc_subtract" value=".1" tags="some_tag"/>


Where <some_tag> is a tag you add to loot containers that you want the effect to apply to. Either reset the 'tags' property if it already exists for that object:

<set xpath ="/blocks/block[@name='cntToilet01']/property[@name='Tags']/@value">some_tag,existingTag1,existingTag2</set>


or add the 'Tags' property if it doesnt already exist:

<insertAfter xpath ="/blocks/block[@name='cntToilet01']/property[@name='LootList']">
<property name="Tags" value="some_tag"/>
</insertAfter>


The above adds the Tags property after the 'LootList' property of the toilet.

Not sure if any of the above if helpful to you, I may have misunderstood what you were asking. Thanks for the compliment on the code, its commented so that people can pull it apart, reuse it, see examples of the syntax etc. - glad its of help. If you check out the Survival No Trader mod there are a lot more in-depth examples there with similar comments.

Cheers

 
Last edited by a moderator:
Hey Joe, thanks for your answer.

It seems like DF is gaining the experience from applying buffs and also using SCore Mechanics along the way to implement the loot progress. I was not able yet to copy the behaviour and did not understand it fully yet, but if you want to check it out the relevant buffs in DF are:

buffScavengingSkillLvl

buffScavengingDisassembleSkillXPTick

buffScavengingServerHack

Those are also tied to the MinEventActionModifySkillSDX (you can find that in SCore/Scripts/Mini Events). Maybe I also missed something else, cause even by copying the buffs and getting it to work roughly it does not work properly (it always adds a level to my perk despite the xp not being reached yet, quite strange).

Thanks for your tips with the containers, already tried that and its working like a charm.

I can also confirm that the loot actions dont work, figured that out as well.

 
Hey Joe, thanks for your answer.

It seems like DF is gaining the experience from applying buffs and also using SCore Mechanics along the way to implement the loot progress. I was not able yet to copy the behaviour and did not understand it fully yet, but if you want to check it out the relevant buffs in DF are:

buffScavengingSkillLvl

buffScavengingDisassembleSkillXPTick

buffScavengingServerHack

Those are also tied to the MinEventActionModifySkillSDX (you can find that in SCore/Scripts/Mini Events). Maybe I also missed something else, cause even by copying the buffs and getting it to work roughly it does not work properly (it always adds a level to my perk despite the xp not being reached yet, quite strange).

Thanks for your tips with the containers, already tried that and its working like a charm.

I can also confirm that the loot actions dont work, figured that out as well.
The SCore lib is this mod - forum link here. You probably need to download that mod to use any of the SCore interface.

I dont use it at the moment as the current Learn By Use implementation is xml only. I will probably move in that direction when the Bandits gets introduced (specifically for the Survival No Trader storyline) and fully use it then.

I do think I can squeeze looting in using the '_xpFromLoot' variable I mentioned before (also cardio using Frantic Dan's suggestion from a few posts back.) so there still room to grow for Learn By Use.

cheers

 
Hey Joe, demo expert seems bugged (for me at least). Leveled up like crazy and maxed out while fighting horde night

 

<perk name="lbu_DemolitionsExpert" max_level="100" parent="lbu_IntellectSkills" base_skill_point_cost="0" name_key="lbu_DemolitionsExpertName" desc_key="lbu_DemolitionsExpertDesc" long_desc_key="lbu_DemolitionsExpertDesc" icon="ui_game_symbol_explosion">
            <!--initialise if first time-->
            <effect_group>
                <requirement name="ItemHasTags" tags="perkDemolitionsExpert"/>
                <requirement name="CVarCompare" cvar="lbu_Demolition_XPIncrement" operation="LT" value="@lbu_DefaultInitialIncrement"/>
                    <triggered_effect trigger="onSelfExplosionDamagedOther" action="ModifyCVar" cvar="lbu_Demolition_XPIncrement" operation="set" value="@lbu_DefaultInitialIncrement"/>
            </effect_group>
            <!--BCK verify ProgressionLevel, backup var should always be equal to ProgessionLevel-->
            <effect_group>
                <requirement name="!HasBuff" buff="buffVerifyLBU_ProgressLevels"/>                                
                <requirement name="ProgressionLevel" progression_name="lbu_Demolition" operation="NotEquals" value="@lbu_Demolition_Lvl"/> 
                    <triggered_effect trigger="onSelfDamagedOther" action="AddBuff" buff="buffVerifyLBU_ProgressLevels"/>    
            </effect_group>
            <!--apply current effect as per level-->
            <effect_group>
                <requirement name="ItemHasTags" tags="perkDemolitionsExpert"/>
                <passive_effect name="DismemberChance" operation="base_add" level="1,100" value=".002,.2" tags="perkDemolitionsExpert"/>
                <passive_effect name="BlockDamage" operation="perc_add" level="1,100" value="0.005,.5" tags="perkDemolitionsExpert"/>
                <passive_effect name="DamageModifier" operation="perc_add" value=".003,0.3" level="1,100" tags="entity"/>
                <passive_effect name="DamageModifier" operation="perc_add" value=".0045,0.45" level="1,100" tags="head"/>
                <passive_effect name="DamageModifier" operation="perc_add" value=".003,0.3" level="1,100" tags="Glass,Stone,Cloth,Concrete,Boulder,Metal,Wood,Earth,Snow,Plants,Leaves"/>
                <passive_effect name="ExplosionRadius" operation="perc_add" level=".005,.5" value="1,100" tags="perkDemolitionsExpert"/>
            </effect_group>
            <!--apply any level xp gain for damage or kill triggers-->
            <effect_group>
                <requirement name="ItemHasTags" tags="perkDemolitionsExpert"/>
                <requirement name="ProgressionLevel" progression_name="lbu_DemolitionsExpert" operation="LT" value="100"/>
                <triggered_effect trigger="onSelfExplosionDamagedOther" action="ModifyCVar" cvar="lbu_DemolitionsExpert_XP" operation="add" value="5">
                    <requirement name="StatCompareCurrent" target="other" stat="health" operation="GT" value="0"/>
                </triggered_effect>
                <triggered_effect trigger="onSelfKilledOther" action="ModifyCVar" cvar="lbu_DemolitionsExpert_XP" operation="add" value="10"/>
            </effect_group>
            <!--Increase ProgressLevel if xp greater than value for next level-->
            <effect_group>
                <requirement name="ItemHasTags" tags="perkDemolitionsExpert"/>
                <requirement name="CVarCompare" cvar="lbu_DemolitionsExpert_XP" operation="GTE" value="@lbu_DemolitionsExpert_XPIncrement"/>
                <requirement name="ProgressionLevel" progression_name="lbu_DemolitionsExpert" operation="LT" value="100"/>
                <triggered_effect trigger="onSelfExplosionDamagedOther" action="ModifyCVar" cvar="lbu_DemolitionsExpert_XPIncrement" operation="multiply" value="@lbu_DefaultIncrementIncrease">
                    <!--taper off level xp increase at level 40 (xxx_XPIncrement about 2400). xxx_XPIncrement will grow to 4700  without the cap-->
                    <requirement name="ProgressionLevel" progression_name="lbu_DemolitionsExpert" operation="LTE" value="@lbu_DefaultLevelCap"/>
                </triggered_effect>
                <triggered_effect trigger="onSelfExplosionDamagedOther" action="ModifyCVar" cvar="lbu_DemolitionsExpert_XP" operation="set" value="0"/>
                <triggered_effect trigger="onSelfExplosionDamagedOther" action="AddProgressionLevel" progression_name="lbu_DemolitionsExpert" level="1"/>
                <!--Upadate BCK var in line with ProgressionLevel progress-->
                <triggered_effect trigger="onSelfExplosionDamagedOther" action="ModifyCVar" cvar="lbu_Demolition_Lvl" operation="add" value="1"/> 
                <triggered_effect trigger="onSelfExplosionDamagedOther" action="ShowToolbeltMessage" message="[4FC3F7]Demolitions Expert Skill Increased![-]"/>
                <!--if max level then give free Skill Point-->
                <triggered_effect trigger="onSelfExplosionDamagedOther" action="CallGameEvent" event="lbu_action_give_points">
                    <requirement name="ProgressionLevel" progression_name="lbu_DemolitionsExpert" operation="EQ" value="100"/>
                </triggered_effect>
            </effect_group>
        </perk>

 
Hey Joe, demo expert seems bugged (for me at least). Leveled up like crazy and maxed out while fighting horde night
 


Demo is a tricky one. It covers a number of different weapons (fire, grenades,timed charges). If the physical grenade misses a target the explosion doesnt seem to trigger the hit event even if it kills a zombie. If the grenade hits a zombie then it seems to trigger a hit for every zombie that the explosion effects. This can mean that one grenade in a group of 30 zombies can trigger the xp increase 30 times for that one grenade. I would be interested to know what Demo weapons you were using, do you have a rough guess as to how many you used?

I notice that you removed the line

<triggered_effect trigger="onSelfExplosionMissEntity" action="ModifyCVar" cvar="lbu_Demolition_XP" operation="add" value="11"/>




The onSelfExplosionMissEntity trigger is used to cater for Timed Charges. Timed Charges dont have an 'other' to damage or kill, but they will call the onSelfExplosionMissEntity trigger. This also means that if you throw a grenade and it misses a zombie and so does the resulting explosion, you would still get xp (11) - I think thats ok as its a tiny amount for the leveling up and grenades are expensive so its not expected that this is abused.

It has been tricky testing the Demo code, its one Perk thats hard to balance between daily use and hordenight.

Will adjust the current xp levels, thanks for the heads up.

Cheers

 
I was using explosive arrows with a bow, nothing else.

There's no timed charges in my mod so no need for onSelfExplosionMissEntity ? Or manby having it helps stop the bug from triggering?
(This feels similar to miner 69er bugging if you got xp from both hit and destroy in the very first hit)

Each hit/kill instantly leveled up the skill, I went from level 0 to level 100 within about a 15 arrows

https://clips.twitch.tv/SecretiveLittlePizzaSMOrc-r-lM93WSMJpjXqzQ

 
Back
Top