StatsThroughSkills II

Ok so here loved the idea of this mod but it felt like it had a ‘few’ minor problems… so here looked around for ways here could possible change the flaws and the results are
http://puu.sh/kuqu6.zip (edit, minor oversight fixed)

Changing it form editing your base stats to 4 invisible status effects to remove removing the ability to steal base points, for skills,
The problem i see now with it is it now will always have your stats highlighted in green…

Any flaws here might of missed? (side form now leaving in unused functions form the original one

With this method though, couldn’t you technically put all your starting points into stats instead of skills, and use books to boost them to much higher than with version 1?
Put two into nightvision and light step, then raid a mansion library at night with a bindle or something, then run away and plant yourself next to the shelter, go outside every once in awhile to forage for food and water.

Ie: Start with like 14-16 str, end up with 20+ from reading various strength themed books. Just need to get heavy 100% coverage armour and tiger style, maybe a little dext, punch zombie hulks to death.

Eh, with the old version you already had the potential to end up with something like 25+ stats, more if you add bionics and mutations. Allowing you to keep your starting high stats would compound that problem even further.

That a problem i been meaning to solve…have a few ideas but…

well it really was just a test

And have reached up to 48 on most stats with the original mutations bionics and drugs…

Instead of having breakpoints at skills 3/6/9, you could sum the total skills for x stat, then divide it at the very end.
Then you could have a higher divisor without making it harder.
For example, with 2 swimming and 2 bashing, you’d have 4 points of strength bonus, then divide it by some number (say, 4) to get 1 str bonus. As opposed to current version, in which you can have 2 in every skill and still don’t get even 1 point of boost.

The hack with effects sounds more exploitable than just allowing to decrease stats below 8.
Instead of effects, you could store the stats as global variables on the Lua side and then decrease the resulting stats if player lowered ones at start.
The most proper solution would involve allowing a mod to disable changing stats in the sources, though.

Mhmm…totally all skills up to one value was planned but then to use that value.

/4 doesn’t feel right. neither would any / values

idealy would rather have it use every 4, 8 , 16… but heres not sure how to do that without a ton of if()s

keeping the ability to change base stats is intended with this one. but i don’t want the mod like been able to give +20 if you manage to survive a year. or find every skill book n read them… you get better but wont become godlike

It definitely needs to have a cap, getting up to +21 to either stat just from having raided a library or two is a bit ridiculous.

In my current playthrough I’m using the original mod, and I went around this by simply adding an if block that checks if a stat bonus is higher than 11 (so +3 from original) and reduces it to 11 and then proceeds to check feat bonuses.

However, lately I’ve been thinking that it would be better to have a bit higher cap, but one that is much harder to reach. So I thought to give it a progression where the first stat increase needs 3 skill-ups of one skill, then the second needs 6 skill-ups, the third needs 9, and so on, where to get +6 you’d need 63 total skill ups (that is all 7 skills relevant to the stat to be at least level 9). At the moment I’ve only done this by adding those many ifs you talked about and it works, with one problem: the function you use to add the stats to the player seems to be adding always 1 stat less than the variable stat_bonus that is given to it. I’ve gone around it by adding stat_bonus+1 in the function call, but I am curious to know why it does this.

I also have 2 more questions:

  1. is it possible to make the main function be called at character startup so that we don’t need to wait for midnight in order to have the stat bonuses?
  2. It seems a bit dumb that strength is increased by reading books, so ideally we’d want to have a mod that increases stats not by skills, but rather by actions taken by player. Is this doable with the current modding options that we have?

[quote=“Zombies-R-Us, post:7, topic:10627”]It definitely needs to have a cap, getting up to +21 to either stat just from having raided a library or two is a bit ridiculous.

In my current playthrough I’m using the original mod, and I went around this by simply adding an if block that checks if a stat bonus is higher than 11 (so +3 from original) and reduces it to 11 and then proceeds to check feat bonuses.

However, lately I’ve been thinking that it would be better to have a bit higher cap, but one that is much harder to reach. So I thought to give it a progression where the first stat increase needs 3 skill-ups of one skill, then the second needs 6 skill-ups, the third needs 9, and so on, where to get +6 you’d need 63 total skill ups (that is all 7 skills relevant to the stat to be at least level 9). At the moment I’ve only done this by adding those many ifs you talked about and it works, with one problem: the function you use to add the stats to the player seems to be adding always 1 stat less than the variable stat_bonus that is given to it. I’ve gone around it by adding stat_bonus+1 in the function call, but I am curious to know why it does this.

I also have 2 more questions:

  1. is it possible to make the main function be called at character startup so that we don’t need to wait for midnight in order to have the stat bonuses?
  2. It seems a bit dumb that strength is increased by reading books, so ideally we’d want to have a mod that increases stats not by skills, but rather by actions taken by player. Is this doable with the current modding options that we have?[/quote]
    Would you consider releasing the code of the edits you have made so far? Would like to expand on it and also may be able to see where the -1 error is coming from.

Of course man here you go

[spoiler]

[code]local MOD = {}

mods[“StatsThoughSkills”] = MOD

function MOD.on_day_passed()
str_bonus = 0
dex_bonus = 0
int_bonus = 0
per_bonus = 0

--Str based skills
str_bonus = calc_bonus(str_bonus,"carpentry")
str_bonus = calc_bonus(str_bonus,"mechanics")
str_bonus = calc_bonus(str_bonus,"swimming")
str_bonus = calc_bonus(str_bonus,"bashing")
str_bonus = calc_bonus(str_bonus,"cutting")
str_bonus = calc_bonus(str_bonus,"melee")
str_bonus = calc_bonus(str_bonus,"throw")
if (str_bonus >= 21) then
	str_bonus = 6
elseif (str_bonus >= 15) then
	str_bonus = 5
elseif (str_bonus >= 10) then
	str_bonus = 4
elseif (str_bonus >=6) then
	str_bonus = 3
elseif (str_bonus >=3) then
	str_bonus = 2
elseif (str_bonus >=1) then
	str_bonus = 1
else
	str_bonus = 0
end

--Dex based skills
dex_bonus = calc_bonus(dex_bonus,"driving")
dex_bonus = calc_bonus(dex_bonus,"survival")
dex_bonus = calc_bonus(dex_bonus,"tailor")
dex_bonus = calc_bonus(dex_bonus,"traps")
dex_bonus = calc_bonus(dex_bonus,"dodge")
dex_bonus = calc_bonus(dex_bonus,"stabbing")
dex_bonus = calc_bonus(dex_bonus,"unarmed")
if (dex_bonus >= 21) then
	dex_bonus = 6
elseif (dex_bonus >= 15) then
	dex_bonus = 5
elseif (dex_bonus >= 10) then
	dex_bonus = 4
elseif (dex_bonus >=6) then
	dex_bonus = 3
elseif (dex_bonus >=3) then
	dex_bonus = 2
elseif (dex_bonus >=1) then
	dex_bonus = 1
else
	dex_bonus = 0
end

--Int based skills
int_bonus = calc_bonus(int_bonus,"barter")
int_bonus = calc_bonus(int_bonus,"computer")
int_bonus = calc_bonus(int_bonus,"cooking")
int_bonus = calc_bonus(int_bonus,"electronics")
int_bonus = calc_bonus(int_bonus,"fabrication")
int_bonus = calc_bonus(int_bonus,"firstaid")
int_bonus = calc_bonus(int_bonus,"speech")
if (int_bonus >= 21) then
	int_bonus = 6
elseif (int_bonus >= 15) then
	int_bonus = 5
elseif (int_bonus >= 10) then
	int_bonus = 4
elseif (int_bonus >=6) then
	int_bonus = 3
elseif (int_bonus >=3) then
	int_bonus = 2
elseif (int_bonus >=1) then
	int_bonus = 1
else
	int_bonus = 0
end

--Per based skills
per_bonus = calc_bonus(per_bonus,"archery")
per_bonus = calc_bonus(per_bonus,"gun")
per_bonus = calc_bonus(per_bonus,"launcher")
per_bonus = calc_bonus(per_bonus,"pistol")
per_bonus = calc_bonus(per_bonus,"rifle")
per_bonus = calc_bonus(per_bonus,"shotgun")
per_bonus = calc_bonus(per_bonus,"smg")
if (per_bonus >= 21) then
	per_bonus = 6
elseif (per_bonus >= 15) then
	per_bonus = 5
elseif (per_bonus >= 10) then
	per_bonus = 4
elseif (per_bonus >=6) then
	per_bonus = 3
elseif (per_bonus >=3) then
	per_bonus = 2
elseif (per_bonus >=1) then
	per_bonus = 1
else
	per_bonus = 0
end

player:remove_effect("exp_str")
player:add_effect("exp_str", 1, "num_bp", true, str_bonus+1)
print_results(str_bonus,"Str",player.str_max)
player:remove_effect("exp_dex")
player:add_effect("exp_dex", 1, "num_bp", true, dex_bonus+1)
print_results(dex_bonus,"Dex",player.dex_max)
player:remove_effect("exp_int")
player:add_effect("exp_int", 1, "num_bp", true, int_bonus+1)
print_results(int_bonus,"Int",player.int_max)
player:remove_effect("exp_per")
player:add_effect("exp_per", 1, "num_bp", true, per_bonus+1)
print_results(per_bonus,"Per",player.per_max)

end

function calc_bonus(stat_bonus,skill)
skill_level = player:get_skill_level(skill_id(skill))
if (skill_level / 3 < 3) then
stat_bonus = stat_bonus + skill_level / 3
else
stat_bonus = stat_bonus + 3
end
return math.floor(stat_bonus)
end

function print_results(stat_bonus,stat,player_stat)
game.add_msg("Raising “…stat…” by "…tostring(stat_bonus))
end
[/code][/spoiler]

I don’t like the code repeating like that but I also don’t know lua syntax so I didn’t know how to make it nicer. Anyway if you make something nice of it let us know :slight_smile:

PS. Thanks Xfin for this edit it works much better than the original mod.

If you want to know the reason why you needed to add one to the end, is because due to using the scale part of the effects only starts when the intensity is over 1 as i don’t use the base_mods part of it

Still i think my ending plan for this one is a massively down scaled version of the original so your char does get better if you put
work in it… might even have some skill relate to more then 1 stat due to the fact it going to take far more points…

Main problem i really see is the game has a overall extremity major effect on each stat point
the leap form 8 str to 12 is huge… akin to like… 15 to 105 in other games

Hi there,

you know what’s bothering me about that mod?

I might end up (as I don’t know which stats are affected by which skill) with

  1. Points spend on stats during character creation that are obviously wasted.
  2. Waking up after one day to be suddenly to weak to even smash a fridge (to get rubber hose to get fuel to drive around)

That was making me not use the mod anymore after last time.

[quote=“Sternenfisch, post:11, topic:10627”]Hi there,

you know what’s bothering me about that mod?

I might end up (as I don’t know which stats are affected by which skill) with

  1. Points spend on stats during character creation that are obviously wasted.
  2. Waking up after one day to be suddenly to weak to even smash a fridge (to get rubber hose to get fuel to drive around)

That was making me not use the mod anymore after last time.[/quote]

And that’s why skill rust is EVIL.

why not make stat increases require a certain amount of actions. like perception increases require spaces explored, intel requires you read books even the moral books, dex requires you move through difficult terrain or sewing, and str requires you to punch things with katanas and the like.

and make all these in a passive pool which each stat requires you to consume a certain amount from the pool.

What I did for my game is change it to sum the skill points for each attribute, then use a square root of that for the attribute bonus. It means no breakpoints, slightly faster first point, but the rate of improvement falls off rapidly.

I like that idea as real life works this way. If your out of shape it’s (relatively) easy to get stronger but a full time athlete is going to see much slower growth. It is also self limiting which removes the need to argue about what the cap should be.

I’ve been using zombie’s version ever since he posted it and it works perfectly as is, IMO.

That was pretty much what I was going for, yeah. If anyone is interested, download this and replace your existing data/mods/StatsThroughSkills/main.lua with it.

The balance isn’t particularly well-tested. The way it is right now, if you have 9 ranks in all 7 Str skills, you end up with a Str of 15 instead of the 29 of the original, which seemed okay to me, but it’s easy enough to open it in Notepad or whatever and change the exponent from 0.5 (which is square root) to something a bit higher or lower depending on your tastes.

It’s not based on the one in the OP of this thread, so it does recalculate the base stats, but merging the two should be fairly trivial if anyone wants that.

That was pretty much what I was going for, yeah. If anyone is interested, download this and replace your existing data/mods/StatsThroughSkills/main.lua with it.

The balance isn’t particularly well-tested. The way it is right now, if you have 9 ranks in all 7 Str skills, you end up with a Str of 15 instead of the 29 of the original, which seemed okay to me, but it’s easy enough to open it in Notepad or whatever and change the exponent from 0.5 (which is square root) to something a bit higher or lower depending on your tastes.

It’s not based on the one in the OP of this thread, so it does recalculate the base stats, but merging the two should be fairly trivial if anyone wants that.[/quote]
Nice work, like it… thanks

I think everybody in this thread had some great ideas, so I made a mish-mash of everybody’s ideas.

I took the idea from xfin where stat points added at character creation wouldn’t be wasted (or exploited by removing them).

Then I added maey’s idea of summing the total skill then taking the square-root to figure the bonus stats. I thought that was a bit too easy to get the first couple points (at 1 and 4 skill) so I changed those to 2 and 5 points, then the rest at 9, 16, 25, etc. All skills at 10 will get you 8 bonus points.

Then I added my own flair by only counting skills if they had at least two points. So if you have 3+2+1, it’ll only count as 5 total, but if you have 2+2+2, it’ll count as 6 total. I also cleaned up the code a bit and restored the “updating stats” messages.

I considered adding some logic in to make it harder to get bonus stats if you add a bunch at character creation, and easier if you remove some. I haven’t figured out a good equation though, so I figured I’d leave it and test it like it is.

I can add a download link to my changes if anybody is interested.

[quote=“plaidman, post:19, topic:10627”]I think everybody in this thread had some great ideas, so I made a mish-mash of everybody’s ideas.

I took the idea from xfin where stat points added at character creation wouldn’t be wasted (or exploited by removing them).

Then I added maey’s idea of summing the total skill then taking the square-root to figure the bonus stats. I thought that was a bit too easy to get the first couple points (at 1 and 4 skill) so I changed those to 2 and 5 points, then the rest at 9, 16, 25, etc. All skills at 10 will get you 8 bonus points.

Then I added my own flair by only counting skills if they had at least two points. So if you have 3+2+1, it’ll only count as 5 total, but if you have 2+2+2, it’ll count as 6 total. I also cleaned up the code a bit and restored the “updating stats” messages.

I considered adding some logic in to make it harder to get bonus stats if you add a bunch at character creation, and easier if you remove some. I haven’t figured out a good equation though, so I figured I’d leave it and test it like it is.

I can add a download link to my changes if anybody is interested.[/quote]

A download link would be nice, I am nowhere skill enough to do something like this.