Removeable City Center Buildings

I think you missunderstood me, I already have all the symbols, I need help to implement them ^^'
Aah.. Ok! So you've already made them as DDS files? All the Buildings Icons (Vanilla, RnF and GS + The DLCs)?
 
It works now!

The problem was PrereqBuilding, this doesn't seem to exist but RequiredBuilding does!
You are absolutely correct, the column is RequiredBuilding. My bad for not spotting that.
 
Aah.. Ok! So you've already made them as DDS files?)?

Ok sorry my bad, I was not aware that they are required to be DDS files and that GIMP does not support these filetypes ^^'

All the Buildings Icons (Vanilla, RnF and GS + The DLCs)?

Yes, but only in PNG
Remove_Tsikhe.png Remove_Ancient_Walls.png Remove_Sewer.png Remove_Water_Mill.png Remove_Granary.png Remove_Flood_Barrier.png Remove_Palgum.png Remove_Monument.png Remove_Medieval_Walls.png Remove_Renaissance_Walls.png
 
Ok sorry my bad, I was not aware that they are required to be DDS files and that GIMP does not support these filetypes ^^'
As Laurana Kanan replied, You can indeed use GIMP to import/export DDS files. Just use the Plugin.

You can have a look on this thread, for more informations about the DDS sizes and how you can implement them into the Game. (Projects don't have to have FOW Icons, just make the normal Icons)
And you'd better create all the Icons in one "picture" rather than individually. They have to have the same order as the Game's. Otherwise the Icon code that you've already made would be impractical. (if you haven't done that, it would be better if you work upon the Game's Icons file directely, just placing the Red Slash on the Buildings)

If I may suggest you something, It would be nice if you make the Buildings behind the Red Slash have somekind washed out colors, as if they are going to be faded away (removed). A simple detail, but it would make the Icons look more appropriate IMO.
If you have any questions, feel free to ask me :).
 
Last edited:
When Exporting (not saving) the Pictures as DDS in GIMP, choose these options:
  1. Compression: None
  2. Format: RGBA8
  3. Save: Selected Layer
  4. Mipmaps: Generate Mipmaps
 
Sorry for the late answer, I fixed another problem with unique city center buildings like Tamar's walls.
Thanks for these tips, did some adjustments, I'm now using an xml file for the icons, but it seems that I'm still doing something wrong ^^'
It is probably the dds file but I can't upload it here.
This is the xml:

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameInfo>
    <IconTextureAtlases>
        <Row Name="ICON_ATLAS_REMOVABLE_PROJECTS" IconSize="30"   IconsPerRow="8" IconsPerColumn="8" Filename="RemovableCityCenterBuildings30.dds"/>
        <Row Name="ICON_ATLAS_REMOVABLE_PROJECTS" IconSize="32"   IconsPerRow="8" IconsPerColumn="8" Filename="RemovableCityCenterBuildings32.dds"/>
        <Row Name="ICON_ATLAS_REMOVABLE_PROJECTS" IconSize="38"   IconsPerRow="8" IconsPerColumn="8" Filename="RemovableCityCenterBuildings38.dds"/>
        <Row Name="ICON_ATLAS_REMOVABLE_PROJECTS" IconSize="50"   IconsPerRow="8" IconsPerColumn="8" Filename="RemovableCityCenterBuildings50.dds"/>
        <Row Name="ICON_ATLAS_REMOVABLE_PROJECTS" IconSize="70"   IconsPerRow="8" IconsPerColumn="8" Filename="RemovableCityCenterBuildings70.dds"/>
        <Row Name="ICON_ATLAS_REMOVABLE_PROJECTS" IconSize="80"   IconsPerRow="8" IconsPerColumn="8" Filename="RemovableCityCenterBuildings80.dds"/>
        <Row Name="ICON_ATLAS_REMOVABLE_PROJECTS" IconSize="256"  IconsPerRow="8" IconsPerColumn="8" Filename="RemovableCityCenterBuildings256.dds"/>
    </IconTextureAtlases>
      
    <IconDefinitions>
        <Row Name="ICON_PROJECT_REMOVE_BUILDING_MONUMENT" Atlas="ICON_ATLAS_REMOVABLE_PROJECTS" Index="1"/>  
        <Row Name="ICON_PROJECT_REMOVE_BUILDING_GRANARY" Atlas="ICON_ATLAS_REMOVABLE_PROJECTS" Index="2"/>
        <Row Name="ICON_PROJECT_REMOVE_BUILDING_WALLS" Atlas="ICON_ATLAS_REMOVABLE_PROJECTS" Index="3"/>
        <Row Name="ICON_PROJECT_REMOVE_BUILDING_WATER_MILL" Atlas="ICON_ATLAS_REMOVABLE_PROJECTS" Index="4"/>
        <Row Name="ICON_PROJECT_REMOVE_BUILDING_CASTLE" Atlas="ICON_ATLAS_REMOVABLE_PROJECTS" Index="5"/>
        <Row Name="ICON_PROJECT_REMOVE_BUILDING_STAR_FORT" Atlas="ICON_ATLAS_REMOVABLE_PROJECTS" Index="6"/>
        <Row Name="ICON_PROJECT_REMOVE_BUILDING_SEWER" Atlas="ICON_ATLAS_REMOVABLE_PROJECTS" Index="7"/>
        <Row Name="ICON_PROJECT_REMOVE_BUILDING_TSIKHE" Atlas="ICON_ATLAS_REMOVABLE_PROJECTS" Index="8"/>
        <Row Name="ICON_PROJECT_REMOVE_BUILDING_FLOOD_BARRIER" Atlas="ICON_ATLAS_REMOVABLE_PROJECTS" Index="9"/>
        <Row Name="ICON_PROJECT_REMOVE_BUILDING_PALGUM" Atlas="ICON_ATLAS_REMOVABLE_PROJECTS" Index="10"/>
    </IconDefinitions>
</GameInfo>

Is there an error? If not, is there something specific I can check at the dds files?

btw GIMP now natively supports dds in the newer versions, I just had to update :)
 
What do you mean with something wrong? Do you get Database Errors? Do some Icons show up and some not? or it doesn't seem to work at all?

I couldn't find any errors in the Icons Tables. How are the Icons loaded (in Modinfo)?

Tipp: in IconDefinitions, if you want to choose the first Icon from a List (like for Monuments), set "0" as Index.
 
And could you upload the Icons Picture (just the PNG)
 
Tipp: in IconDefinitions, if you want to choose the first Icon from a List (like for Monuments), set "0" as Index.

This and another adjustement did the trick! Thanks!

But I have to rework them a bit again, the red diagonal line is not inside the circle.
 
Cool side effect of this mod; If you don't like that flood barriers are covering basically all coasts in the late game, you can simply remove them after the sea level rose, the coast tiles stay unflooded :)
 
The mod works good so far! There are only two things which are bugging me:

1. The removal projects are always present, even If you don't have the building yet. They are at least greyed out and can't be activated if you don't have the building, but is there a way to remove them and make them appear after you built the respective building?

2. The different walls are handled as separate buildings, so you can remove Ancient walls even if you already have Renaissance walls. I doesn't have a negative impact on the game if you do that, but it would be better if the 'Remove Renaissance Walls' project would automatically remove also the two previous walls, and also would be the only 'wall removal project' that is displayed. Same then with Medieval walls. Is there a way to do that?

But these two things are really just minor issues, if there is no easy way to get rid of them, I could release it in it's current state :)
 
These are the files of the current version in txt, hope this helps to answer my questions :)
 

Attachments

1 - Doesn't "RequiredBuilding" work? You can try this, but it would only make the Projects visible if you have the Prereqs of the Buildings, not if you have built them already:
Code:
INSERT INTO Projects (
    ProjectType,
    Name,
    ShortName,
    Description,
    Cost,
    CostProgressionModel,
    CostProgressionParam1,
    PrereqTech,
    PrereqCivic,
    RequiredBuilding)
SELECT    
    'PROJECT_REMOVE_'||BuildingType,
    CASE WHEN instr(Name, 'LOC_') = 0 THEN 'Remove '||Name ELSE 'LOC_PROJECT_REMOVE'||substr(Name, 4) END,
    CASE WHEN instr(Name, 'LOC_') = 0 THEN 'Remove '||Name ELSE 'LOC_PROJECT_REMOVE'||substr(Name, 4) END,
    'Removes this building.',
    20,
    'COST_PROGRESSION_GAME_PROGRESS',
    50,
    PrereqTech,
    PrereqCivic,
    BuildingType
FROM Buildings WHERE PrereqDistrict = 'DISTRICT_CITY_CENTER' AND Capital = 0 AND InternalOnly = 0;

2 - Not possible with Database coding, But with Lua.
 
The game tends to want to show things you might at some time be able to do in the ProductionPanel and its lua file that controls what gets displayed. Just as certain wonders will show as greyed out in a city list of possible things that might be buildable at some point but which aren't at the moment. The only way to "fix" this is to add a custom version of ProductionPanel.lua as part of the mod, but then the mod will inherently be incompatible with a whole group of other User Interface mods, some of which are quite poopular, because of the way the game works on a Highlander Rule1 basis. You're better off living with the fact the game will show your projects as possible but not yet selectable (ie, greyed out).

The game's database uses a similar rule, but the database is more friendly. Only the portions of the database re-jiggured by later-loading mods will interfer with mods that loaded earlier.

1"In the end there can be only one!"
Only one version (the last "survivor" loaded into the game by whichever mods loads its version last) of any UI file and certain other files (like DDS artwork files) can ever exist within the game's file system.​
 
Last edited:
1 - Doesn't "RequiredBuilding" work? You can try this, but it would only make the Projects visible if you have the Prereqs of the Buildings, not if you have built them already:
Adding the PrereqTech and PrereqCivic to the Project based on that of the building ought to certainly cut down on the clutter of unavailable projects that will show in the city Production Panel since that will make the game not see them as even possible to choose at least until the Building itself is unlocked.
 
@Zegangani I thought about this workaround with Tech/Civics too, and based on @LeeS 's answer I guess this is the best way to do it.
I'll implement that right away.
Concerning my second question, I think I'll just leave it that way and mention it in the workshop description. It doesn't cause any problems so far, but I'll test it further just to be sure.
Btw is it ok when I mention you guys in 'Special Thanks'? :)
 
Now the removal project shows up in the tech tree ^^'
rccb-sc04.png


I think I'll just leave it how it was before. Not perfect but it works.
 
The game tends to want to show things you might at some time be able to do in the ProductionPanel and its lua file that controls what gets displayed. Just as certain wonders will show as greyed out in a city list of possible things that might be buildable at some point but which aren't at the moment. The only way to "fix" this is to add a custom version of ProductionPanel.lua as part of the mod, but then the mod will inherently be incompatible with a whole group of other User Interface mods, some of which are quite poopular, because of the way the game works on a Highlander Rule1 basis. You're better off living with the fact the game will show your projects as possible but not yet selectable (ie, greyed out).
Remember the Mod you and Gedemon helped me with some Time ago, that disables Units from being able to be built if there are not enough of a second strategic resource (not maintenance resource)? I've got it to work without touching the ProductionPanel.lua. and it's a GameplayScript, so it affects also the AI. I still haven't finished it (the Concept/Design) but it works. You can have a look on this Thread, but it's not the finale code. So It should be possible to re-use it for Projects (using: pCity:GetBuildings():HasBuilding()...etc).

Btw is it ok when I mention you guys in 'Special Thanks'?
For me, you don't have to.
Great that the icons are working perfectly now! Have you thought about my suggestion of the Project Icons with faded colors? just a suggestion :D.
 
Back
Top Bottom