[BTS] Specialist Enhancements

Supercheese

Zeppelin Commander
Joined
Aug 2, 2009
Messages
378
Location
Idaho
Specialist Enhancements


This (mini)mod adds <iHealth> and <iHappiness> tags to CIV4SpecialistInfos.xml, and naturally, allows specialists to affect a city's Health and Happiness.

This mod has essentially been done before, but I could no longer find an up-to-date mod that accomplishes the same thing.

Screenshots:

Spoiler :


Note that I was playing the Rise of Mankind mod when I took these screenshots; this does not mean this mod is restricted to RoM. It works fine in vanilla BtS, and in theory, with any mod.

It makes a world of sense to use this in conjunction with a custom Doctor (or Great Doctor) specialist that increases a city's health -- indeed, that was the main reason I wrote this mod in the first place (the happiness part is just an added bonus! :p).

This is not a standalone mod, obviously... it is meant to be used as a part of a larger mod; please feel free to do just that.

Anyways, to the download links! I have uploaded it to the database: http://forums.civfanatics.com/downloads.php?do=file&id=13434


Note: Updated to v1.1: Added AI code (as suggested by Afforess)
Please re-download & re-compile the sources to update -- the XML has not changed.


The download contains the relevant sources, the required SpecialistEnhancements_CIV4GameText.xml file, and the altered CIV4GameInfoSchema.xml and CIV4SpecialistInfos.xml files. Note that in the included SpecialistInfos, no specialists have actually been set to alter health or happiness, just the <iHealth> and <iHappiness> tags have been added.

[Of course, adding the two clearly commented "SPECIALIST ENHANCEMENTS" lines to your existing CIV4GameInfoSchema file, and adding the <iHealth> and <iHappiness> tags in the correct locations to your existing CIV4SpecialistInfos file will work just as well.]


Anyway, that's about it. I do not plan on releasing a Doctor/Great Doctor mod myself. But as I said, feel free to use this code if you desire to make one of your own.

-Supercheese
 

Attachments

  • scientist.png
    scientist.png
    11 KB · Views: 1,744
  • artist.png
    artist.png
    29 KB · Views: 1,751
  • happy.png
    happy.png
    57.9 KB · Views: 1,775
  • healthy.png
    healthy.png
    38.8 KB · Views: 1,820
But those Doctors don't actually add health, they add food. This modcomp seems much more useful, IMO. Nice work SuperCheese.

I know that, but at least its a place to start with stuff already there for you to change, is all.:p
 
I have a suggestion. I think this modcomp would be a lot more valuable if you would add AI logic in CvCityAI. As it stands now, the AI don't see the bonuses.
 
I have a suggestion. I think this modcomp would be a lot more valuable if you would add AI logic in CvCityAI. As it stands now, the AI don't see the bonuses.

Are you sure? I did not see any code from Jooyo's Improvement Health mod in CvCityAI, and when I played a game of RoM where I set artists to give +1 Happiness for test purposes, my city's Auto-Citizen-Manager seemed very aware of the happiness change, as it would max out artist specialists when the city was unhappy. Presumably, the AI's citizen-manager would also be aware of this, though I did not test it out with the AI.

However, the AI might not value buildings that give specialist slots that give the new bonuses properly, I realize. I may look into coding some AI logic, but no promises...
 
Are you sure? I did not see any code from Jooyo's Improvement Health mod in CvCityAI, and when I played a game of RoM where I set artists to give +1 Happiness for test purposes, my city's Auto-Citizen-Manager seemed very aware of the happiness change, as it would max out artist specialists when the city was unhappy. Presumably, the AI's citizen-manager would also be aware of this, though I did not test it out with the AI.

However, the AI might not value buildings that give specialist slots that give the new bonuses properly, I realize. I may look into coding some AI logic, but no promises...

I just saw no CvCityAI changes and assumed...

I suppose that the way the logic was coded could allow for this. I guess it just means I'll have to create an empty specialist except for happy changes and see if the AI uses it.
 
I guess it just means I'll have to create an empty specialist except for happy changes and see if the AI uses it.

Yes, that would be a better test.

EDIT: In retrospect, the auto-citizen-manager likely was valuing the artist specialist for their culture values, rather than their happiness values...

Looking at the code in AI_specialistValue, it does appear to be rather lacking in evaluating health/happiness values for specialists. I have written some code that likely fixes this, but now I must test to see if it produces the desired results...

EDIT2: Wrote some code, seems to work, first post updated!
 
I downloaded this and tried to install it, but for some reason it doesn't show up. I copied the Asset files into their respective areas and put the Source files in the CvGameCoreDLL file.

Any help would be appreciated! :)
 
@ FiSkirata: you just overwrote the original files?!

Did you merge and compile the source files?

If you don't know what I'm talking about, go to this tutorial by Asaf: A simple guide to compiling the DLL.
 
@ FiSkirata: you just overwrote the original files?!

Did you merge and compile the source files?

If you don't know what I'm talking about, go to this tutorial by Asaf: A simple guide to compiling the DLL.
I copied the DLL folder (the originals) and put it in my mod, putting the new DLL files into that.

I used the tutorial and that seems to have helped (as far as how they look in the pedia). I still need to test them in game though.

Thanks for the help!
 
Okay, now the Doctor works on the city screen, but for some reason it has disabled the spy. It's icon still appears but I cannot add or subtract from it and it also won't show any information when I scroll over it. I'm assuming I need to change something in Python, but what do I need to do to fix this?
 
Top Bottom