I'd also love to know for sure. When I tried it there didn't seem to be any issues thoughI wasn't able to find an answer anywhere, does anybody know if this mod is compatible with the Community Patch?
I found a bug in lua code from BarbarianEraScript.lua.
When addind the terrorist promotion, you remove the terrorist promotion right after that, instaed of removing the rebel promotions.
function Leugi_BarbPromoChange(eraID)
--print ("eraID: " .. eraID)
--print ("Starting Promos")
local pPlayer = Players[63]
--print ("added bplayer")
for bUnit in pPlayer:Units() do
--print ("checking units of bPlayer")
if eraID == 2 then
if (bUnit:GetHasPromotion(BrigandPromo)==false or bUnit:GetHasPromotion(UnFriendlyPromo)==true) then
bUnit:SetHasPromotion(BrigandPromo,true);
bUnit:SetHasPromotion(UnFriendlyPromo,false);
--print ("Brigand Promotions")
end
elseif eraID == 3 then
if (bUnit:GetHasPromotion(PiratePromo)==false or bUnit:GetHasPromotion(BrigandPromo)==true) then
--print ("Pirate Promotions")
bUnit:SetHasPromotion(PiratePromo,true);
bUnit:SetHasPromotion(BrigandPromo,false);
end
elseif eraID == 4 or eraID == 5 then
if (bUnit:GetHasPromotion(RebelPromo)==false or bUnit:GetHasPromotion(BrigandPromo)==true or bUnit:GetHasPromotion(PiratePromo)==true) then
--print ("Rebel Promotions")
bUnit:SetHasPromotion(RebelPromo,true);
bUnit:SetHasPromotion(BrigandPromo,false);
bUnit:SetHasPromotion(PiratePromo,false);
end
elseif eraID [COLOR="Red"]>=[/COLOR] 6 then
if (bUnit:GetHasPromotion(TerroristPromo)==false or bUnit:GetHasPromotion(BrigandPromo)==true or bUnit:GetHasPromotion(PiratePromo)==true or bUnit:GetHasPromotion(RebelPromo)==true) then
--print ("Terrorist Promotions")
bUnit:SetHasPromotion(TerroristPromo,true);
bUnit:SetHasPromotion(BrigandPromo,false);
bUnit:SetHasPromotion(PiratePromo,false);
bUnit:SetHasPromotion(RebelPromo,false);
end
end
end
end
Hi Serp
would that be related to this error I'm getting
BarbarianEraScripts.lua:101: attempt to call method 'GetHasPromotion' (a nil value)
if so How Do I Fix It, Im guessing it has something to do with this piece of code within the lua
Code:function Leugi_BarbPromoChange(eraID) --print ("eraID: " .. eraID) --print ("Starting Promos") local pPlayer = Players[63] --print ("added bplayer") for bUnit in pPlayer:Units() do --print ("checking units of bPlayer") if eraID == 2 then if (bUnit:GetHasPromotion(BrigandPromo)==false or bUnit:GetHasPromotion(UnFriendlyPromo)==true) then bUnit:SetHasPromotion(BrigandPromo,true); bUnit:SetHasPromotion(UnFriendlyPromo,false); --print ("Brigand Promotions") end elseif eraID == 3 then if (bUnit:GetHasPromotion(PiratePromo)==false or bUnit:GetHasPromotion(BrigandPromo)==true) then --print ("Pirate Promotions") bUnit:SetHasPromotion(PiratePromo,true); bUnit:SetHasPromotion(BrigandPromo,false); end elseif eraID == 4 or eraID == 5 then if (bUnit:GetHasPromotion(RebelPromo)==false or bUnit:GetHasPromotion(BrigandPromo)==true or bUnit:GetHasPromotion(PiratePromo)==true) then --print ("Rebel Promotions") bUnit:SetHasPromotion(RebelPromo,true); bUnit:SetHasPromotion(BrigandPromo,false); bUnit:SetHasPromotion(PiratePromo,false); end elseif eraID [COLOR="Red"]>=[/COLOR] 6 then if (bUnit:GetHasPromotion(TerroristPromo)==false or bUnit:GetHasPromotion(BrigandPromo)==true or bUnit:GetHasPromotion(PiratePromo)==true or bUnit:GetHasPromotion(RebelPromo)==true) then --print ("Terrorist Promotions") bUnit:SetHasPromotion(TerroristPromo,true); bUnit:SetHasPromotion(BrigandPromo,false); bUnit:SetHasPromotion(PiratePromo,false); bUnit:SetHasPromotion(RebelPromo,false); end end end end
Edit: I was Having alook trying to nut it out myself and I notice this (above code highlighted red) is >= part of the code cause I can't find it anywhere in the tuts I've been looking at