About stats recompute order, I can say one thing for sure, condition tick comes always after the recompute process. It means you can read the stats values in this function and trust the result 100%. That also means that you can't modify thoses values there, as it will be executed too late (but to be sure, you should also see if it always comes before or after normal timers hooks, combat damage calculation and frame rendering with onDrawGui). I think I have a very good example with the "might" condition. This really simplified and made my code cleaner and less buggy:
Code: Select all
defineCondition
{ name = "might",
uiName = "Might",
description = "Doubles strength, dexterity, vitality and willpower.",
icon = 0,
iconAtlas = path.."textures/gui/conditions/might.tga",
beneficial = true,
harmful = false,
tickInterval = 0,
onStart = function(self, champion)
local ordinal = champion:getOrdinal()
for att,tab in pairs(spells_functions.script.might) do tab[ordinal] = champion:getCurrentStat(att) end
end,
onStop = function(self, champion)
local ordinal = champion:getOrdinal()
for att,tab in pairs(spells_functions.script.might) do tab[ordinal] = 0 end
end,
onRecomputeStats = function(self, champion)
local ordinal = champion:getOrdinal()
for att,tab in pairs(spells_functions.script.might) do champion:addStatModifier(att, tab[ordinal]) end
end,
onTick = function(self, champion)
local ordinal = champion:getOrdinal()
for att,tab in pairs(spells_functions.script.might) do tab[ordinal] = champion:getCurrentStat(att) - tab[ordinal] end
end,
}
You can see the onTick is used to read values and store them until the next frame. The previous value is substracted to get only the value without the previous contribution of might. When it's time for the next frame, all stat modifiers are cleared and all recomputes are redone, and during that process, at any time, might gives the value stored from the previous frame. So you could say, might is always one frame late when a stat changes. It is still better than my previous 1 second refresh interval and when trying to give bonuses to champions that also depend on other present bonuses, I think it is logically the best thing you can do. Again because, unless I'm proven wrong, when all recomputes are done, it is too late to add another modifier.
For the non-party camera sounds mute, I can only say that it is exactly the same effect you get when you disable all champions... I guess it is somehow the same problem.