Open gwennog opened 2 years ago
CreatesFeature works but RemoveWhenComplete not.
I use this to remove improvement and features appear instantly
function BuildMarsh(playerID, x, y, improvementID) if(improvementID == GameInfoTypes.IMPROVEMENT_MARSH) or (improvementID == GameInfoTypes.IMPROVEMENT_PLANT_FOREST) then local pPlot = Map.GetPlot( x, y ) pPlot:SetImprovementType(-1) end end GameEvents.BuildFinished.Add(BuildMarsh)
The whole thing
if (eOldImprovement != eNewValue || bPillageStateChanged)
{
if (MOD_EVENTS_TILE_IMPROVEMENTS)
{
GAMEEVENTINVOKE_HOOK(GAMEEVENT_TileImprovementChanged, getX(), getY(), getOwner(), eOldImprovement, eNewValue, IsImprovementPillaged());
}
if (MOD_IMPROVEMENTS_EXTENSIONS && eNewValue != NO_IMPROVEMENT)
{
// this should be called last
if (GC.getImprovementInfo(eNewValue)->IsRemovesSelf())
{
setImprovementType(NO_IMPROVEMENT);
}
}
}
I don't see how this would not work.
1. Mod version, and DirectX version if reporting a graphical issue (X.Y.Z, e.g. 2.0.3, DX 10 & 11): V2.0.3
2. Mod list (if using Vox Populi only, leave blank):
3. Error description:
CreatesFeature and RemoveWhenComplete don't work despite the activation of IMPROVEMENTS_EXTENSIONS (I have not tested the others Columns)
4. Steps to reproduce (optional):
Supporting information: Please note that you can attach .zip files by dragging-and-dropping them. If possible, zip up all supporting data and post that way.
Log files (always attach your Logs folder, located at My Documents/My Games/Sid Meier's Civilization 5. For instructions, go to the repository's main page, under "To enable logging for bug reports"):
Save game (always attach a save that was made a turn before the error; located at My Documents/My Games/Sid Meier's Civilization 5/ModdedSaves; you can change autosave frequency in the game's Options menu):
CvMiniDump.dmp file (attach if experiencing a game crash. Located at Program Files/Steam/steamapps/common/Sid Meier's Civilization V):
Screenshots (optional):