Page 1 of 1
Addon Idea/Coding Question: Talents require stat hardpoints
Posted: Wed Feb 17, 2016 10:23 am
by sajberhippien
I personally would enjoy the game a fair bit more if juggling dozens of stat-boosting pieces of equipment wasn't encouraged as much. Due to this, I tried and failed to make an addon that makes the stat requirements of talents be based on the "base" stat instead of the "current" stat, so that the main way to access them is through investing points.
It seems like it should be a fairly simple process in ActorTalents.Lua, but I know nearly nothing of LUA and very little about scripting in eneral, so my attempts failed.
If anyone has time and wish to make such an addon it'd be greatly appreciated, at least by me!
EDIT: Alteratively, if anyone can tell me how to call on the base stat instead of the increased stat in ActorTalents I guess I should be able to do it on my own. Ive tried using getStat(s, no_inc) and various other variants of getStat, but it won't work and to me it seems getStat scaling will always return the scaling value (looking at ActorStats, isnt the used forumla basically stat*scale/stat? That returns scale, every time.
Sorry for spelling so badly, bf had to take my laptop (only comp with internet atm) to the college so im stuck with this phone and a whole day of attempting to learn LUA offline, lol.
Thanks for any help!
EDIT2: Fixed spelling.
Re: Addon Idea/Coding Question: Talents require stat hardpoi
Posted: Wed Feb 17, 2016 4:54 pm
by astralInferno
This would actually be a pretty massive nerf. I wouldn't recommend doing it without also lowering talent requirements or raising stat gains.
Re: Addon Idea/Coding Question: Talents require stat hardpoi
Posted: Wed Feb 17, 2016 5:55 pm
by sajberhippien
astralInferno wrote:This would actually be a pretty massive nerf. I wouldn't recommend doing it without also lowering talent requirements or raising stat gains.
Yes, making the game harder is definately an effect, one that I don't mind though; I'd rather play normal (or even easy) with that than nightmare without, so to speak. It's also why I suggested it as an addon, rather than posting in the "idea" subforum; I'm not saying it should be implemented in the base game, but just that I'd enjoy it as an addon.
That said, yes, if I understand how to work the code (been at it on and off throughout the day, but so far to no success; I can make talents and races and stuff, but I still have no idea how to call on the base stat rather than the modified one) I intended to also somewhat lower talent requirements and/or put in alternate stat requirements.
Re: Addon Idea/Coding Question: Talents require stat hardpoi
Posted: Thu Feb 18, 2016 12:24 am
by HousePet
I don't see an issue with an addon making the game harder.
I can't easily dig in the code at the moment, but I'll do it tonight if I remember and you haven't worked it out then.
Re: Addon Idea/Coding Question: Talents require stat hardpoi
Posted: Thu Feb 18, 2016 7:18 am
by sajberhippien
Thanks, that would be greatly appreciated!

Re: Addon Idea/Coding Question: Talents require stat hardpoi
Posted: Thu Feb 18, 2016 8:00 am
by HousePet
You want actor:getStat(s, nil, false, true), or actor.stats[s] (but this is naughty).
Re: Addon Idea/Coding Question: Talents require stat hardpoi
Posted: Thu Feb 18, 2016 10:32 am
by sajberhippien
Thanks a lot for the help, but unfortunately I still don't get it to work; the self:getStat(s, nil, false, true) causes
this error, while using "local rawstat = self.stats[s]" and then calling for that in the calculation causes
this error instead. Am I using the commands wrong?
Code: Select all
if rawget(t, "require") then
local req = t.require
local rawstat = self.stats[s]
if type(req) == "function" then req = req(self, t) end
local tlev = self:getTalentLevelRaw(t) + (offset or 1)
-- Obviously this requires the ActorStats interface
if req.stat then
for s, v in pairs(req.stat) do
v = util.getval(v, tlev)
if self.rawstat(s) < v then return nil, "not enough stat" end
end
end
Here's the code from ActorTalents; I've tried defining local rawstat with either self.stats[s] or self:getStat(s, nil, false, true) and those above are the errors I get.
Re: Addon Idea/Coding Question: Talents require stat hardpoi
Posted: Thu Feb 18, 2016 11:22 am
by HousePet
Undo what you have done as its silly and wrong.
Change this line:
if self:getStat(s) < v then return nil, "not enough stat" end
to:
if self:getStat(s, nil, false, true) < v then return nil, "not enough stat" end
Re: Addon Idea/Coding Question: Talents require stat hardpoi
Posted: Thu Feb 18, 2016 11:33 am
by sajberhippien
Huh, thanks! That worked! Thought I had tried exactly that before, but apparently not. Thanks!
