Trying to add a new fishing boat using Civ's own assets

DoppioConPanda

Chieftain
Joined
Feb 22, 2019
Messages
6
Location
Canada Lite™
I've tried not to post her for a while because my previous posts were solved by things as simple as reading back through my code. This, on the other hand, is a concept I'm wholly unfamiliar with and my searches have been fruitless.

So far, this is the code I have, and it does function as intended so far (haven't decided on yield yet) but because there is no resource being used, ART_DEF_IMPROVEMENT_FISHING_BOATS results in an empty, albeit improved, tile.
Spoiler :
Code:
INSERT INTO Improvements (Type, Description, Civilopedia, ArtDefineTag, Water, NoTwoAdjacent, PillageGold, DestroyedWhenPillaged, PortraitIndex, IconAtlas)
  VALUES ('IMPROVEMENT_DEEP_SEA_FISHERS',
          'TXT_KEY_IMPROVEMENT_FISHING_BOATS',
          'TXT_KEY_CIV5_IMPROVEMENTS_FISHINGBOATS_TEXT',
          'ART_DEF_IMPROVEMENT_FISHING_BOATS',
          1,
          1,
          10,
          1,
          23,
          'TERRAIN_ATLAS');

INSERT INTO Builds (Type, PrereqTech, ImprovementType, Description, Help, Kill, Water, EntityEvent, HotKey, OrderPriority, HotKeyPriority, IconIndex, IconAtlas)
  VALUES ('BUILD_DEEP_SEA_FISHERS',
          'TECH_PLASTIC',
          'IMPROVEMENT_DEEP_SEA_FISHERS',
          'TXT_KEY_BUILD_FISHING_BOATS',
          'TXT_KEY_BUILD_CONSUMED_HELP',
          1,
          1,
          'ENTITY_EVENT_BUILD',
          'KB_F',
          98,
          1,
          35,
          'UNIT_ACTION_ATLAS');


INSERT INTO Improvement_ValidTerrains (ImprovementType, TerrainType)
    VALUES ('IMPROVEMENT_DEEP_SEA_FISHERS', 'TERRAIN_OCEAN');

No error, no problem per se, just, no visuals. I just want it to use the Fish (as in the bonus resource) tile improvement animation. The best idea I have so far is to make a Lua script that places fish on the tile while the improvement exists and removes it when the tile is pillaged. But uh, I don't really know lua all that well. Is there a smarter way to do this?
 
Last edited:
This might seem really obvious, and I'm not even sure it applies if you're not using custom art assets...

but have you checked reloadlandmarksystem in modbuddy?
 
The issue is that the fishing boat art defs is sub-setted and tied directly to the resource-type. We can see this in the Crabs added to fishing boat improvements by, uh, G&K I think, by looking at the xml art definitions of the expansion. However, I've never been able to find where the art definitions for the Vanilla version of the game's improvements are tucked away.
 
Interesting. Thanks for the heads up, Lee. I was able to find some art define tags after a horsehockyload more googling, but none that were useful.

Does a script with logic to place/remove a resource sound like a good Lua Hello World? Is there possibly a more efficient manner to do this? Guess I'll start googling that haha.

Edit: I see you've already influenced a beginners' Lua thread. Nice!
 
Last edited:
Given the limitations in the art-def issues there may not be any way around the issue other than an lua script that does as you've mentioned. Troubles may occur, though, if the improvement is set to alter the base yields of the resource used to cure the graphical issues. Generally, when a resource is placed on an improved tile via lua in order to get the correct YieldChange effects it is necessary to first remove the improvement, then place the resource, then re-place the improvement. If the improvement is not adding anything to the fish on its tile, however, there ought not to be a problem or a need to delete_improvement / place_resource / replace_improvement, as I recall.
 
Top Bottom