[Lua] Spawn a unit without AddFreeUnit?

I've figured it out, whoward. I'll deploy my solution and return with my results. Suffice it to say that you were wrong, and I was right. HA :smug:

uGr4jcl.png


Note that this is with Alhambra in the city, and 4 is the ID of Drill I.

EDIT: Success! It worked.

xqHzcs9.jpg
TH8IxXC.png


Here is the code used.

Code:
for promotion in GameInfo.UnitPromotions() do
    iPromotion = promotion.ID

        if ( pCity:GetFreePromotionCount( iPromotion ) > 0 ) then
	    pFreeUnit:SetHasPromotion( iPromotion, true )
	end

end
 
Back
Top Bottom