• 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

JoeSloeMoe

Active member
Hybrid Learn By Use Action Skills. Increase half of all Perk Damage, Stamina, Harvesting etc. values by using tools and weapons. Upgrade the other half of stat increases using the Perk Tree as normal.

Special thanks to FranticDan and Hells_Janitor for feedback, debugging and suggestions.

Download Current Version 1.1.4:  Repository Link: Hybrid Learn By Use (Action Skills)

Recommend starting a new game.

Currently applies to the following Perks:
Perception: DeadEye, Demolition Expert, SpearMaster, Lucky Looter, Salvage
Strength: Boomstick, PummelPete, SkullCrusher, Miner69r/Motherload.
Fortitude: Brawler, MachineGunner
Agility: Archery, Gunslinger, DeepCuts, Hidden Strike
Intellect: Electrocutioner, Robotics, Physician

Mod Functionality: (Configurable in buffs.xml)

  • Receive a bonus skill point when you max out each Perk Skill (level 50)
  • Each Point invested in the game's Perk Tree gives 20% more Learn-By-Use (lbu) skill progression xp on kills. e.g The default for the lbu_archery skill is each archery kill gives 24 lbu progression xp. With 2 points in the Archery Perk (perkArchery) the lbu_archery skill progression xp is 28.8 (40% increase) per kill.
  • The more Experience you have using a tool or weapon, the more you know how to maintain it. Each level of a Learn-By-Use skill decreases associated tool/weapon degradation rate by 1% (total 50%). Doesnt apply to the Hidden Strike or Demolition perks.
  • For the Learn By Use Physician Skill, at max level Splints & Casts will heal sprains in addition to giving a bonus skill point. (redundant if the the game's Physician Perk level >=1)



WHY ARE THERE ONLY 50 LEVELS?
The mod is using 100 levels, it only calculates and displays every second level to avoid possible rounding errors.  So there are only 50 levels displayed in the UI. For a detailed explanation, see the line "<!--NOTES on the level cap of 50--> in buffs.xml. (see also: Spinal Tap 1979 - My amp goes to 11. )

Config Options:
There are many Global Config Variables available to control the Learn-By-Use functionality and progression curve. E.g. You can control the progression speed of each individual Learn By Use Perk to suit your game. See buffs.xml, look for the line: "<!--PLAYER CONFIG VARIABLES..." for the options and further information.

Notes:

 - The best way to increase the Demolitions LBU perk is using grenades/rockets on large groups of zombies. Nade should hit a zombie, not land next to it for max level xp.

License:
The code is free to use license. It is based on the Action Skill levelling algorithm from Khaine in the Darkness Falls mod (//community.7daystodie.com/topic/4941-darkness-falls-they-mostly-come-out-at-night/). Please acknowledge Khaine's coal-face work if you reuse the code.

This modlet comes from the Survival No Trader mod:

https://community.7daystodie.com/topic/34585-survival-no-trader-v10/

Pic of the Learn By Use Interface

Hybrid_lbu1.png

Version Info:

V1.0.2 - 19th Feb 2024
V1.0.3 - 22th Feb 2024

V1.0.4 - 10th March 2024.

V1.0.5 - 7th March 2024
V1.0.6 - 7th April 2024 

V1.0.7 - 13th April 2024

V1.0.8 - 18th April 2024
V1.1.0 - 4th May 2024
V1.1.1 - 7th July 2024
V1.1.2 - 3rd Aug 2024

V1.1.3 - 1st Feb 2025

V1.1.4 - 22nd March 2025
   - Added Lucky Looter skill
   - Added Physician skill
   - Code refactoring in preparation for 7DTD V1.3 release.

 
Last edited by a moderator:
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
 
Last edited by a moderator:
I've noticed a potential bug waiting to happen ...

<!--if max level then give free Skill Point-->
<triggered_effect trigger="onSelfDamagedOther" action="CallGameEvent" event="lbu_action_give_points">
<requirement name="ProgressionLevel" progression_name="lbu_Boomstick" operation="EQ" value="50"/>
</triggered_effect>




There's no gameevents.xml included with the mod, so there's no game event to call - so the bonus points will either:

a) not be applied, or

b) throw an error when anyone reaches level 50 in action skills.

I haven't gotten to that point yet, but I just thought I'd give you a heads up :)  

 
I've noticed a potential bug waiting to happen ...

<!--if max level then give free Skill Point-->
<triggered_effect trigger="onSelfDamagedOther" action="CallGameEvent" event="lbu_action_give_points">
<requirement name="ProgressionLevel" progression_name="lbu_Boomstick" operation="EQ" value="50"/>
</triggered_effect>




There's no gameevents.xml included with the mod, so there's no game event to call - so the bonus points will either:

a) not be applied, or

b) throw an error when anyone reaches level 50 in action skills.

I haven't gotten to that point yet, but I just thought I'd give you a heads up :)  


Thanks for that, I missed it when I separated the code from the Survival No Trader mod.

I have now added the appropriate gameevents file to the repository.

File is here: https://github.com/JoeSloeMoe/LBU/blob/main/HybridLearnByUse/config/gameevents.xml

Thanks again.

cheers

 
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


There are certainly things there that could be added relatively easily. Its the testing that takes time. :)

With weapons and tools it was relatively easy to determine average use stats to approximate the levelling curve (which is basically a compound interest curve). For some things like medical or butcher, I've not given much thought to how many times I use those skills by the time I'm a higher level (eg 60). I'll play around with some of them and get a feel for usage, see what I can do.

cheers

 
Last edited by a moderator:
There are certainly things there that could be added relatively easily. Its the testing that takes time. :)

With weapons and tools it was relatively easy to determine average use stats to approximate the levelling curve (which is basically a compound interest curve). For some things like medical or butcher, I've not given much thought to how many times I use those skills by the time I'm a higher level (eg 60). I'll play around with some of them and get a feel for usage, see what I can do.

cheers
Balancing can be tricky, butchering and pain resist come to mind for balance. With butchering, you can harvest animals faster and with less hits if using power attacks. And for pain resist, getting hit from zombies and animals on Insane difficulty deals a lot more damage than on Nomad, so I think the best way to balance pain resist would be to have damage received = xp.
Same for butchering perhaps, damage done using a butchering tool to animal carcass = xp.

Athletics, Heat/cold resist are passive over time. Athletics shouldn't gain xp if on a vehicle except the bicycle of course.

 
Thanks for that, I missed it when I separated the code from the Survival No Trader mod.

I have now added the appropriate gameevents file to the repository.

File is here: https://github.com/JoeSloeMoe/LBU/blob/main/HybridLearnByUse/config/gameevents.xml

Thanks again.

cheers


Sorry, found one more bug. You missed the closing</append> on the gameevent. I fixed it for myself, but you might want to update your repo.

Oh, and the perk is called "Deep Cuts", not "Deap Cuts". Another thing I fixed for myself. Not a major thing, but it was bugging me :)  

 
Sorry, found one more bug. You missed the closing</append> on the gameevent. I fixed it for myself, but you might want to update your repo.

Oh, and the perk is called "Deep Cuts", not "Deap Cuts". Another thing I fixed for myself. Not a major thing, but it was bugging me :)  
OMG - thanks again - fixed. This is like one of those dreams where you cant run....

 
Noticed that there's no skill for Demolition expert, is this intentional? Or maybe complicated to get working?

 
Noticed that there's no skill for Demolition expert, is this intentional? Or maybe complicated to get working?
Was planning to add it in a second release. The only challenge is the number of uses of demolition charges over the course of a game. I didnt want that to hold up the release -as you've mentioned, there a few others that could be added as well. It will be added in the future.

Cheers

 
Greetings Joe,

I really like the idea, and so I've tested the mod just today and it has been working flawlessly so far!

Unfortunately I found that when I use Grandpa's Elixir, it also reset the progress of LBU, so it feels like half of my progression has been lost as well. I'm not sure if that is intended, but is there any way to prevent LBU progression from being reset?

 
Hi Adagio,

Thats very good to know, thanks! I cant stop the system from removing the progress in xml as they are also Perks, but I figure I can restore the levels by keeping track of the level total (T) and restoring if the ProgressionLevel is less than T. Something like

if( level increase) T=ProgressionLevel; 

ProgressionLevel = ProgressionLevel<T  ? T : ProgressionLevel;

....

Will update in the next version (have added Demolition Expert into the mix and am testing).

cheers

 
Greetings Joe,

I really like the idea, and so I've tested the mod just today and it has been working flawlessly so far!

Unfortunately I found that when I use Grandpa's Elixir, it also reset the progress of LBU, so it feels like half of my progression has been lost as well. I'm not sure if that is intended, but is there any way to prevent LBU progression from being reset?
Hi again Adagio,

The issue is now fixed along with a couple other changes in the latest version. It will fix any current game but unfortunately it doesn't effect the game if you already drank the Forgetin Elixer.

Cheers

 
Hi again Adagio,

The issue is now fixed along with a couple other changes in the latest version. It will fix any current game but unfortunately it doesn't effect the game if you already drank the Forgetin Elixer.

Cheers


You fixed this with just xml? I'd love to know how you did it ...

 
When increasing max level to 100, miner69r action skill occasionally bugs out and each hit with a miner69r tool levels up the action skill. I've only noticed this bug with miner69r.

 
When increasing max level to 100, miner69r action skill occasionally bugs out and each hit with a miner69r tool levels up the action skill. I've only noticed this bug with miner69r.
Hi FranticDan

What vars did you change to increase the number of levels? The number of levels is kinda hard-coded. For example:

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

For the above, the number 50 at the end for the level has to be a value, it cant be a variable:

<passive_effect name="EntityDamage" operation="perc_add" value="0.01,0.25" level="1,@SOMEVARIABLE" /> <!--doesnt work-->

So the level is written out wherever it is used. If you have changed the max level to 100 you would need to make sure that you have changed it everywhere. If the issue only happens with Miner69er, perhaps there is an error in the code for that? The error you've described indicates that the amount of xp required per level is set to 0 or never intialized with the starting xp per level [marked as a) in the list below] , so everytime the person gets xp they level up. This can happen if you didnt start a new game after making changes to the max level.

In general the following can be easily changed:

- a) starting amount of xp required per level

- b) percent increase of the xp (point a above) required per level

- c) level cap to stop increasing xp per level (e.g. stop increasing amount of xp required at level 46 so that levels 46-50 have the same amounts needed)

Max level is 50 - to change max level you will need to edit every reference to '50' in progression.xml.

Does any of the above help?

Cheers

 
You fixed this with just xml? I'd love to know how you did it ...
Hey Hells_J,

The algorithm is basically the following:

For a given LBU Perk (e.g. lbu_SkullCrusher)

- have a local level variable keep track of the progress level (e.g. lbu_SkullCrusher_Lvl)

- everytime the ProgressLevel is increased for lbu_SkullCrusher the code also increases the corresponding lbu_SkullCrusher_Lvl.

- at the start of the lbu_SkullCrusher Perk code, check that ProgressLevel(lbu_SkullCrusher) is exactly equal to lbu_SkullCrusher_Lvl

- if they are not equal call a buff to review all Perk level variables compared to the Perks'  ProgressLevel

We cant assign a variable's value to the ProgressLevel variable and we cant assign the ProgressLevel value directly to a variable either (or at least I couldn't figure out how)

So instead, the buff will iterate over all ProgressLevels and level variables:

    For each Perk: Iterate until (ProgressLevel == level variable) for all Perks

      - if ProgressLevel < level variable  ? then add one to ProgressLevel (something has reset the Perk Level eg Forgettin Elixer)

      - if ProgressLevel > level variable  ? then add one to  level variable (this allows for installing on existing games - this might only be needed for the initial release)

So now if you drink a Forgetin Elixer the buff will be engaged as soon as you use any tool/weapon covered by the LBU Perks. The buff will put the Progress Lvl back to where is was for all Perks. Its not instant though, its done over some time in the background as the code increases the progress levels by one once per buff iteration.

cheers

 
Last edited by a moderator:
Hi FranticDan

What vars did you change to increase the number of levels? The number of levels is kinda hard-coded. For example:

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

For the above, the number 50 at the end for the level has to be a value, it cant be a variable:

<passive_effect name="EntityDamage" operation="perc_add" value="0.01,0.25" level="1,@SOMEVARIABLE" /> <!--doesnt work-->

So the level is written out wherever it is used. If you have changed the max level to 100 you would need to make sure that you have changed it everywhere. If the issue only happens with Miner69er, perhaps there is an error in the code for that? The error you've described indicates that the amount of xp required per level is set to 0 or never intialized with the starting xp per level [marked as a) in the list below] , so everytime the person gets xp they level up. This can happen if you didnt start a new game after making changes to the max level.

In general the following can be easily changed:

- a) starting amount of xp required per level

- b) percent increase of the xp (point a above) required per level

- c) level cap to stop increasing xp per level (e.g. stop increasing amount of xp required at level 46 so that levels 46-50 have the same amounts needed)

Max level is 50 - to change max level you will need to edit every reference to '50' in progression.xml.

Does any of the above help?

Cheers
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 :)

 
Last edited by a moderator:
Back
Top