pokiehl
Deity
- Joined
- Mar 5, 2017
- Messages
- 2,701
I have a mod that adds two options past Abundant for more resource generation. Here is the part of the code from the modified ResourceGenerator.LUA:
With the summer patch, they added new tables: Resource_SeaLuxuries and Resource_SeaStrategic. This obviously changed ResourceGenerator.lua, so I brought that into my mod and inserted the code as above. What's happening, though, is that with the two new options I made ('plentiful' and 'truly abundant'), sea luxuries are not generating. I'm getting plenty of fish and crab, but never any whales or pearls.
My first guess is that the sea luxuries are not affected by the self.resources thing. That seems to make sense, since the new tables specify amounts based on map size. But that seems to be a really inelegant way of doing things since map size isn't tied to resource amount for anything else...That would mean there is no way of tying increased sea luxury generation to a resource setting like Abundant or Plentiful or whatever. Or maybe there is something else in the LUA that affects it? I can't tell at all.
My second guess is that the sea luxuries are being 'crowded out' by the fish and crabs, so they aren't being placed. Again, if that's the case, I have no idea to fix it.
Basically I'm completely lost. I know almost nothing about lua editing. Can anyone help at all?
Code:
-- Get resource value setting input by user.
if self.resources == 1 then
self.resources = -5;
elseif self.resources == 3 then
self.resources = 5;
elseif self.resources == 4 then
self.resources = TerrainBuilder.GetRandomNumber(13, "Random Resources - Lua") - 6;
-- p0kiehl's Plentiful Resources Option
elseif self.resources == 30 then
self.resources = 30 ;
-- p0kiehl's Truly Abundant Resources Option
elseif self.resources == 45 then
self.resources = 45;
With the summer patch, they added new tables: Resource_SeaLuxuries and Resource_SeaStrategic. This obviously changed ResourceGenerator.lua, so I brought that into my mod and inserted the code as above. What's happening, though, is that with the two new options I made ('plentiful' and 'truly abundant'), sea luxuries are not generating. I'm getting plenty of fish and crab, but never any whales or pearls.
My first guess is that the sea luxuries are not affected by the self.resources thing. That seems to make sense, since the new tables specify amounts based on map size. But that seems to be a really inelegant way of doing things since map size isn't tied to resource amount for anything else...That would mean there is no way of tying increased sea luxury generation to a resource setting like Abundant or Plentiful or whatever. Or maybe there is something else in the LUA that affects it? I can't tell at all.
My second guess is that the sea luxuries are being 'crowded out' by the fish and crabs, so they aren't being placed. Again, if that's the case, I have no idea to fix it.
Basically I'm completely lost. I know almost nothing about lua editing. Can anyone help at all?