what do numbers in talent code mean?

Have a really dumb question? Ask it here to get help from the experts (or those with too much time on their hands)

Moderator: Moderator

Post Reply
Message
Author
xnd
Archmage
Posts: 307
Joined: Sat Mar 21, 2015 7:33 pm

what do numbers in talent code mean?

#1 Post by xnd »

from counterattack code:

getDamage = function(self, t) return self:combatTalentWeaponDamage(t, 0.5, 0.9) + getStrikingStyle(self, dam) end,
counterchance = function(self, t) return self:combatLimit(self:getTalentLevel(t) * (5 + self:getCun(5, true)), 100, 0, 0, 50, 50) end, --Limit < 100%
getCounterAttacks = function(self, t) return self:combatStatScale("cun", 1, 2.24) end,


(though I've seen it say it goes over 100% despite what that says).

So, what do the numbers mean, one after another? If I want to change percent chance?


return ([[When you avoid a melee blow from an adjacent foe, you have a %d%% chance to get a free, automatic attack against the attacker for %d%% damage, up to %0.1f times per turn.

What is %d%% mean and how do I change it?

For example, if character starts with chance to counterattack and then gets a second better chance at higher level, I would put a second talent in that would have to have better chances that would go into effect in addition to the original talent.

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: what do numbers in talent code mean?

#2 Post by HousePet »

Those numbers are all scaling factors. Check the comment above each of their function definitions for what does what.

%d%% means replace this with a base 10 integer and add a % sign after it. To change it, you just change the argument in the format() function that corresponds with it.
My feedback meter decays into coding. Give me feedback and I make mods.

xnd
Archmage
Posts: 307
Joined: Sat Mar 21, 2015 7:33 pm

Re: what do numbers in talent code mean?

#3 Post by xnd »

but they dont have comments above them???


again:



getAnomalyDuration = function(self, t)
local dam = self:combatScale(getParadoxSpellpower(self, t), 4, 10, 12, 100, 0.75)
return math.ceil(rng.avg(dam / 2, dam, 3))
end


getAnomalyRange = function(self, t)
local range = math.floor(self:combatLimit(getParadoxSpellpower(self, t), 80, 20, 20, 40, 100))
return range
end


i just dont see comments telling me what any such numbers mean. they dont even follow a pattern i can recognize.

Trea
Higher
Posts: 65
Joined: Sun Dec 21, 2014 9:31 am

Re: what do numbers in talent code mean?

#4 Post by Trea »

Read through http://te4.org/wiki/Scaling for information on how scaling for talents work
Creator of Half-Orcs [Forum] And Xorn [Forum]

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: what do numbers in talent code mean?

#5 Post by HousePet »

There are comments above the function definitions in the combat.lua file.
My feedback meter decays into coding. Give me feedback and I make mods.

Post Reply