Modder's Documentation

Ok, so, I'm still having a problem with these building-destruction events. I've updated the conditional check to:

Code:
    if (city.getNumRealBuilding(iBuilding) > 0 and gc.getBuildingInfo(iBuilding).getProductionCost() > 0 and not isLimitedWonderClass(gc.getBuildingInfo(iBuilding).getBuildingClassType()) and not gc.getTeam(player.getTeam()).isObsoleteBuilding(gc.getBuildingInfo(iBuilding).getBuildingClassType())):

In the particular example that I spotted the problem, the building affected is a Termite Mound, and I already have the Cooking tech, but the building is still being destroyed. I've verified via debugging that isObsoleteBuilding is indeed returning FALSE, even though the building is definitely obsolete.

Am I just misunderstanding what this function does? Or what am I doing wrong here?
 
Ok, so, I'm still having a problem with these building-destruction events. I've updated the conditional check to:

Code:
    if (city.getNumRealBuilding(iBuilding) > 0 and gc.getBuildingInfo(iBuilding).getProductionCost() > 0 and not isLimitedWonderClass(gc.getBuildingInfo(iBuilding).getBuildingClassType()) and not gc.getTeam(player.getTeam()).isObsoleteBuilding(gc.getBuildingInfo(iBuilding).getBuildingClassType())):

In the particular example that I spotted the problem, the building affected is a Termite Mound, and I already have the Cooking tech, but the building is still being destroyed. I've verified via debugging that isObsoleteBuilding is indeed returning FALSE, even though the building is definitely obsolete.

Am I just misunderstanding what this function does? Or what am I doing wrong here?
Should you be calling to the BuildingClassType or the BuildingType?
 
Looking at Class covers UBs so that is what you would look at in vanilla BtS. Otherwise you would need to know that there were UBs and check each one.
Right I get that. But the obsolete tag he's calling for specifically I think would require the Civilization Building check for that BuildingClass so as to derive the Building Type, which is a legal entry, rather than the incorrect reference directly to a building class, which the obsolete call may not ask for. I'd have to check the code to be sure but it strikes me as unlikely that
gc.getTeam(player.getTeam()).isObsoleteBuilding(xxxxxxx) is asking for a BuildingClass because the function is named .isObsoleteBuilding rather than .isObsoleteBuildingClass. This would mean that since we're checking the direct building TYPE in other areas of this filter call, I think we can safely get around the need to check Building Classes at all but rather go directly to Building Type.

In theory.
 
Right I get that. But the obsolete tag he's calling for specifically I think would require the Civilization Building check for that BuildingClass so as to derive the Building Type, which is a legal entry, rather than the incorrect reference directly to a building class, which the obsolete call may not ask for. I'd have to check the code to be sure but it strikes me as unlikely that
gc.getTeam(player.getTeam()).isObsoleteBuilding(xxxxxxx) is asking for a BuildingClass because the function is named .isObsoleteBuilding rather than .isObsoleteBuildingClass. This would mean that since we're checking the direct building TYPE in other areas of this filter call, I think we can safely get around the need to check Building Classes at all but rather go directly to Building Type.

In theory.

You are completely correct. I guess I was just totally overthinking it when I wrote that line of code. I made the change you suggested, and it works perfectly now.

Thanks, TBird!
 
A quick question, the guides I've been following all recommend using Visual Studio Express 2010 but looking around in Caveman2Cosmos\Sources there seems to be a possibility of using VS2017. Which one is recommended for C2C?
 
A quick question, the guides I've been following all recommend using Visual Studio Express 2010 but looking around in Caveman2Cosmos\Sources there seems to be a possibility of using VS2017. Which one is recommended for C2C?

Doesn't matter i use the free VS2017 community edition.

But for C2C you need the updated compiler from
  1. Download the Vc7.7z from https://1drv.ms/u/s!Ak5ogpmpfWwqgjuhLQiUojbzRjGZ
  2. Extract it to C:
  3. The Visual Studio 2003 SP1 C++ Compiler, Headers......... are now in C:\Vc7
  4. In the MakefilePaths in C2C's sources directory change the TOOLKIT to
    Code:
    TOOLKIT=C:\Vc7
 
I'm trying to debug @strategyonly crash as a way to practice using VS and the debugger.

Got as far as this and I don't know how to proceed beyond this (see attachment). What am I supposed to do now?
 

Attachments

  • Debugging help.png
    Debugging help.png
    168.6 KB · Views: 203
I'm trying to debug @strategyonly crash as a way to practice using VS and the debugger.

Got as far as this and I don't know how to proceed beyond this (see attachment). What am I supposed to do now?

You can see in the callstack that the crash happens in the ntdll.dll.

So there's nothing you as a programmer can do because those crashes are mostly caused by corrupt or missing art files
 
I found a copy of the utility to check Civ Art on my hard drive and added it to the first post. If anyone knows where this comes from please post a link so I can include it in the first post instead. Let us give credit where it is due.
 
Now that I'm getting setup to program on the new computer (cross my fingers that this will work) I have found that I was incorrect about unversioning a file and what that will mean to a fresh checkout. Therefore, an example 'MakefilePaths' must be obtainable somehow. So... for those who would program, here it is!
 

Attachments

For the record, if you update to using VS2017 and can't access intellisense capabilities (hoverover info about functions and automatic suggested functions to fill in after '->' or '.') this first piece of advice proved to make a breakthrough. You'll probably still be plagued with intellisense errors you can't do much about but they no longer get in the way of the functioning of these VERY critical features.

https://stackoverflow.com/questions/9753887/error-cannot-open-source-file
 
DH has asked me to provide the base art templates I work with here. Whisperr has some stuff coming as well but this is what's on my system. It's best with these to use Macromedia Fireworks to open the png files so you can manipulate the shapes as vectors and copy/paste over the settings on those shapes to new shapes. IF you don't have that capacity (which you can pick up for free with just a little searching for Fireworks these days, which has been purchased by Adobe so they could sit on it and stop it from being further developed) I did include some templates without symbols in them, though you'll need to find a way to get the right color background in most cases from the textures provided on the more standard graphic download package we have around here somewhere.

This also includes the alpha channels for these alternative promotion backgrounds. Those are easily applied with DXT.bmp (another free program) but it does make the image fuzzy to do that for pic based images like tech buttons and buildings, so it's better to do those through the photoshop file systems you'll see in Whisperr's files.
 

Attachments

I'm finally working on a new update. I see that some building costs in the pepper2000 module have been changed. Are there new cost guidelines? I'm still going by the ones here from April 2017.

https://forums.civfanatics.com/threads/modders-documentation.441325/page-10
I think that one was outdated, updated ones were few posts below.

Use this one instead:
https://forums.civfanatics.com/threads/modders-documentation.441325/page-10#post-14723083
National Wonders are 2x
Group wonders are 4x
Great Wonders are 6x
Projects are 8x
Guidelines were updated in December 2017.

Except projects were renormalized, as their global wasn't set as 100.

I'm checking now if you didn't revert my fixes.
Regular building cost at certain X grid is 6155 not 6165.
And looks like somehow I missed few things here and there.
 
Last edited:
Back
Top Bottom