Sid Meier's Civilization V

Sid Meier's Civilization V

SMAN's The Ancient World at War
kensw Feb 8, 2023 @ 7:37pm
Not receiving any Prod or gold from docks on my fish etc.
I tested this with just this one mod activated still nothing from docks
< >
Showing 1-2 of 2 comments
S-Man  [developer] Feb 11, 2023 @ 6:17am 
Will look into this. It may take a bespoke LUA script to get working as intended - which is only bonuses for anything is from Fish at Fishing, everything else once Boat Building is discovered. It looks like it may not be possible using database adjustments alone.

Appreciate the report.
S-Man  [developer] Feb 11, 2023 @ 7:09am 
The "help" text key shows this:

"Adds +1 Food and Production, and +1 Gold on Crab, Fish, Pearls, and Whale Resources."

The text is in error, as no gold is added to Fish. But I'm wondering if perhaps Coral should be on this list?

Just reviewed the code and ran through a couple of text games and it looks like everything is working properly (with no gold for Fish). So I think Docks are working fine.

As to building on non-Fish resources, my intention is that a Civ can only build on Fish until the discovery of Boat Building, and then the other sea resources would be exploitable.

There is an LUA method called Plot:CanBuild which can be used for this.

Basically, any time a Worker tries to build anything/anywhere, it generates a Game Event which calls the bespoke function.

The function would check if the desired build is for "Fishing Boats"

And if so, it would then look at the plot where the build is intended for and check if it non-Fish resoruce (aka Coral, Crab, Pearls, or Whales).

If it is, then it would check if the Civ has discovered Boat Building. If they have not, then the function returns a FALSE value and the game engine will prevent the Worker from actually building the Fishing Boats improvement on the plot.

If the civ has discovered Boat Building it returns TRUE and the build is allowed.

*******************************

It sounds like a lot of extra processing, but Civ5 performs dozens/hundreds of these kinds of tests for every player for every turn. A few extra CPU cycles won't impact play in any perceivable sense.

If I actually put it in, I'd probably add a couple of ancillary functions that every time a civ goes into a new ERA, it would check to see if all civs have discovered boat building. And if so, it would remove the Can Build check entirely (along with code that would remove the check at Era progress).

I'll put this logic into the next hotfix. Just wanted to get the last one out instantly yesterday as it was such a game-immersion breaking problem.

*******************************

FWIW, it is possible to perform this feat using only DB changes. It would involve creating a duplicate Fishing Boat unit that can only be built on Fish resources. It would obsolete at Boat Building and be upgradeable to the normal Fishing Boat unit.

This approach is simple, low impact on performance, but it adds complexity on the player for a very short-lived problem. So the LUA solution rings better to me.

OTOH, if I can't get the LUA to work, there'll probably be a new unit coming into the mod...

;)
Last edited by S-Man; Feb 11, 2023 @ 7:12am
< >
Showing 1-2 of 2 comments
Per page: 1530 50