MoonSlime Posted August 16, 2021 Share Posted August 16, 2021 I'm porting Better Literacy over to 41.53's new perk system. I have everything almost working. However despite marking it as a passive skill, it is not showing up in the passive section. VERSION = 1, perk Reading { parent = Passiv, translation = Reading, passive = true, xp1 = 1000, xp2 = 2000, xp3 = 4000, xp4 = 6000, xp5 = 12000, xp6 = 20000, xp7 = 40000, xp8 = 60000, xp9 = 80000, xp10 = 100000, } The skill is showing up as a level 0 skill no matter what I do, instead of a level 5 with 125% exp boost. Link to comment Share on other sites More sharing options...
MoonSlime Posted August 17, 2021 Author Share Posted August 17, 2021 So I solved the issue, but it's a bug that the developers need to fix. function CharacterCreationProfession:drawXpBoostMap(y, item, alt) function CharacterCreationProfession:drawXpBoostMap(y, item, alt) local dy = (self.itemheight - self.fontHgt) / 2 self:drawText(item.text, 16, y + dy, 0, 1, 0, 1, UIFont.Small); local percentage = "+ 75%"; -- self:drawTexture(CharacterCreationProfession.instance.greenBlits, self.width - 80, (y) + 12, 1, 1, 1, 1); if item.item.level == 2 then percentage = "+ 100%"; -- self:drawTexture(CharacterCreationProfession.instance.greenBlits, self.width - 76, (y) + 12, 1, 1, 1, 1); elseif item.item.level >= 3 then percentage = "+ 125%"; -- self:drawTexture(CharacterCreationProfession.instance.greenBlits, self.width - 76, (y) + 12, 1, 1, 1, 1); -- self:drawTexture(CharacterCreationProfession.instance.greenBlits, self.width - 72, (y) + 12, 1, 1, 1, 1); end local textWid = getTextManager():MeasureStringX(UIFont.Small, item.text) local greenBlitsX = self.width - (68 + 10 * 4) local yy = y if 16 + textWid > greenBlitsX - 4 then yy = y + self.fontHgt end for i = 1,item.item.level do self:drawTexture(CharacterCreationProfession.instance.greenBlits, self.width - (68 + 10 * 4) + (i * 4), (yy) + dy + 4, 1, 1, 1, 1); end if item.item.perk ~= Perks.Fitness and item.item.perk ~= Perks.Strength then self:drawTextRight(percentage, self.width - 16, yy + dy, 0, 1, 0, 1, UIFont.Small); end yy = yy + self.itemheight; self:drawRectBorder(0, (y), self:getWidth(), yy - y - 1, 0.5, self.borderColor.r, self.borderColor.g, self.borderColor.b); return yy; end and function CharacterCreationProfession:checkXPBoost() function CharacterCreationProfession:checkXPBoost() self.listboxXpBoost:clear() local levels = {} if self.listboxTraitSelected and self.listboxTraitSelected.items then for i,v in pairs(self.listboxTraitSelected.items) do if v.item:getXPBoostMap() then local table = transformIntoKahluaTable(v.item:getXPBoostMap()) for perk,level in pairs(table) do levels[perk] = (levels[perk] or 0) + level:intValue() end end end end if self.profession and self.profession:getXPBoostMap() then local table = transformIntoKahluaTable(self.profession:getXPBoostMap()) for perk,level in pairs(table) do levels[perk] = (levels[perk] or 0) + level:intValue() end end levels[Perks.Fitness] = (levels[Perks.Fitness] or 0) + 5 levels[Perks.Strength] = (levels[Perks.Strength] or 0) + 5 for perk,level in pairs(levels) do if level < 0 then level = 0 end if level > 10 then level = 10 end self.listboxXpBoost:addItem(PerkFactory.getPerkName(perk), { perk = perk, level = level }) end self.listboxXpBoost:sort() end In the CharacterCreationProfession.lua has it hardcoded for Strength and Fitness to show up, and not any perk marked as a passive perk. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now