adaneslavo / More-Unique-Components-for-VP

Adds 3rd and 4th unique component to each civilization.
1 stars 6 forks source link

Latfidium does not create figs plantation on completion #199

Closed jayeye2011 closed 1 year ago

jayeye2011 commented 1 year ago

Current v86 (fifth iteration), Rome latfidium improvement upon completion is supposed to generate a fig plantation tile adjacent to the latfidium improvement according to the tool tip, but it does not. See screenshots below

t34

t35

adaneslavo commented 1 year ago

@pineappledan?

jayeye2011 commented 1 year ago

I believe the issue is in Latifundium.lua at line 50: local iChosenPlot = math.random(#tPossibleSpots - 1, "") + 1 Comparing it to a version where figs were created correctly line 50 was: local iChosenPlot = Game.Rand(#tPossibleSpots - 1, "") + 1

jayeye2011 commented 1 year ago

If math.random is the problem, then you might want to check where you used it in other lua files Search "math.random" (6 hits in 4 files of 65 searched) C:\Users\john_i\Documents\My Games\Sid Meier's Civilization 5\MODS(over) More Unique Components for VP (v 86.5) vp3.7.7\Shoshone\BuffaloPound\BuffaloPound.lua (2 hits) Line 61: pChosenPlot = pSpotsTable[ math.random(#pSpotsTable) ] Line 131: pChosenPlot = pSpotsTable[ math.random(#pSpotsTable) ] C:\Users\john_i\Documents\My Games\Sid Meier's Civilization 5\MODS(over) More Unique Components for VP (v 86.5) vp3.7.7\Portugal\Cacadores\Cacadores.lua (1 hit) Line 57: pUnit:SetHasPromotion(tAvailablePromotions[ math.random(1, #tAvailablePromotions) ], true) C:\Users\john_i\Documents\My Games\Sid Meier's Civilization 5\MODS(over) More Unique Components for VP (v 86.5) vp3.7.7\Egypt\Nilometer\Nilometer.lua (2 hits) Line 77: local pChosenPlot = table.remove(tPossibleSpots, math.random(#tPossibleSpots)) -- don't use again Line 187: local pChosenPlot = table.remove(tPossibleSpots, math.random(#tPossibleSpots)) -- don't use again C:\Users\john_i\Documents\My Games\Sid Meier's Civilization 5\MODS(over) More Unique Components for VP (v 86.5) vp3.7.7\Aztecs\Eagle\Eagle.lua (1 hit) Line 16: if math.random(4, "Eagle capture roll") == 1 then

pineappledan commented 1 year ago

This math.random switch thing has been the bane of my existence. I will have this resolved with the next version.