Anyways, made my custom unit upgradeable. Gave it enhancements, and they work like a charm apart from the blasted icon.
Functionality, descriptions, removal -all else works. Whatever I do cannot get the icons to work.
A friend of mine helped make the icons for it, but...nope.
Info:
They are of proper size and format, they are in ...textures\ui\common\game\aeon-enhancements where they need to be, there are 4 versions (for up, down...)
code in my unit's bp:
- Code: Select all
Enhancements = {
Slots = {
Back = {
name = '<LOC _Back>',
x = -2,
y = -5,
},
LCH = {
name = '<LOC _LCH>',
x = 50,
y = -10,
},
RCH = {
name = '<LOC _RCH>',
x = -12,
y = -10,
},
},
GuardianProtocol = {
BuildCostEnergy = 12000,
BuildCostMass = 720,
BuildTime = 500,
BuildableCategoryAdds = 'BUILTBYALPHAA1',
Icon = 'turret',
Name = 'Guardian protocol I',
NewBuildRate = 20,
NewHealth = 2000,
NewRegenRate = 20,
Slot = 'RCH',
},
GuardianProtocolRemove = {
BuildCostEnergy = 1,
BuildCostMass = 1,
BuildTime = 0.1,
Icon = 'turret',
Name = 'Remove Guardian protocol I',
Prerequisite = 'GuardianProtocol',
RemoveEnhancements = {
'GuardianProtocol',
'GuardianProtocolRemove',
},
Slot = 'RCH',
},
},
.script:
- Code: Select all
Code: Select all
CreateEnhancement = function(self, enh, removal)
AAirUnit.CreateEnhancement(self, enh)
local bp = self:GetBlueprint().Enhancements[enh]
if not bp then return end
local bp = self:GetBlueprint().Enhancements[enh]
--T2 Engineering
if enh =='GuardianProtocol' then
local cat = ParseEntityCategory(bp.BuildableCategoryAdds)
self:RemoveBuildRestriction(cat)
--self:updateBuildRestrictions()
--self:AddBuildRestriction( categories.AEON * (categories.BUILTBYTIER2ENGINEER + categories.BUILTBYTIER3ENGINEER - categories.SBROT1EXPD) )
--if not Buffs['AeonACUT2BuildRate'] then
BuffBlueprint {
Name = 'AeonACUT2BuildRate',
DisplayName = 'ALPHAT2BuildRate',
BuffType = 'ACUBUILDRATE',
Stacks = 'REPLACE',
Duration = -1,
Affects = {
BuildRate = {
Add = bp.NewBuildRate - self:GetBlueprint().Economy.BuildRate,
Mult = 1,
},
MaxHealth = {
Add = bp.NewHealth,
Mult = 1.0,
},
Regen = {
Add = bp.NewRegenRate,
Mult = 1.0,
},
},
}
-- end
Buff.ApplyBuff(self, 'AeonACUT2BuildRate')
elseif enh =='GuardianProtocolRemove' then
local bp = self:GetBlueprint().Economy.BuildRate
if not bp then return end
self:RestoreBuildRestrictions()
self:AddBuildRestriction( categories.AEON * (categories.BUILTBYALPHAA1 + categories.BUILTBYTIER1ENGINEER + categories.BUILTBYTIER2ENGINEER + categories.BUILTBYTIER3ENGINEER - categories.uab1105 - categories.uab1106) )
if Buff.HasBuff( self, 'AeonACUT2BuildRate' ) then
Buff.RemoveBuff( self, 'AeonACUT2BuildRate' )
end
end
end,
even got a blasted description for it, and it works...but not the icon, the icon is this muddy olive-yellow square and nothing else :/
What am I missing? What am I doing wrong? Going crazy over here...such simple things derail me ufff....