diplo penalty from civic?

davidlallen

Deity
Joined
Apr 28, 2008
Messages
4,743
Location
California
In Dune Wars, I want to add some civics which cause a strong reaction in other civs. I cannot find any good hooks to do this. There is the "favorite civic" for a leaderhead, which gives a positive reaction bonus over time. But when a civ has a civic, I want some of the other AI civs to have a positive reaction, and some to have a negative reaction. The idea in this mod is that you are either in favor of terraforming the planet from a desert to a green planet, or against. Civs which are in favor, hate civs which are against, and vice-versa.

How can I get both negative and positive reactions to civics?

For religion, there are positive and negative reaction values in the leaderhead file. So I guess what I want is something like a "HatedCivic" and associated reaction values. Is there another way to do this, or an existing mod which does this?

I also thought about the system which enforces unhappiness once Emancipation is discovered, among any civs which do not follow Emancipation. This seems to be created with the iCivicPercentAnger tag, since that is the only civic using it. But this would have to be bidirectional unhappiness so that it affects both the "pro" and "con" factions. Does anybody know of a way to make this more general, or an existing mod which does this?
 
You could be interested in this mod.

All civics now have flavors, meaning leaders will choose civics according to their personality. Added new "opressive" and "freedom" flavors to improve this effect. Also, all leaders now have a "hated civic". You get a relations penalty if you are running it and the leader is less likely to chose it.
 
Thanks for the pointer. There are like 50 new features in that mod, we will see if it can be split out separately.
 
Some discussion at this link. DarkCiv appears to have exactly what I wanted, mixed in with many other changes. I have cut out the five needed sdk source files, CvInfo.*, CvPlayerAI.* and CvTextMgr.cpp and attached a zipfile to this post. Now I am starting to feel bad that I have never chosen to learn how to compile the SDK. Search for "HatedCivic" and you will find all the places to change marked with a comment.

It works a little differently than favorite civic. The favorite civic bonus builds up a little over time until it reaches a maximum. The hated civic penalty immediately appears at full value. There is a place in CvPlayerAI which seems to make the AI "less likely" to switch to the hated civic. It scales the weight by 2/3. Probably, we could change this to make the weight zero, to prevent a civ from switching to its hated civic.
 

Attachments

  • hated-civic.zip
    249.7 KB · Views: 65
We have done this, and it is working. Thanks to koma13 for compiling. You also need the changed schema file, which is attached here. You may wish to carefully merge the HatedCivic and iHatedCivicAttitudeChange lines into your schema file, since there are other changes here as well which you probably do not want. You will also need to define the text string, TXT_KEY_MISC_ATTITUDE_HATED_CIVIC like this:

%D1: "You have chosen a civic which I hate!"

There was a little confusion on how to find the relevant changes in the sdk sources attached in the previous post. The changed areas are marked with comments including "a1021". Some of those change areas refer to objects matching "HatedCivic". So you should search for "HatedCivic" in the sdk files; for each occurrence, pick up the entire change region marked by "a1021" comments. Koma13 was able to do this and compile the resulting files using BTS 3.19 for Dune Wars, which also includes RevDCM and WOC lite.
 
i promise to use better comments in the next darkciv version... :p "a1021" is just my other nickname. but i am glad you could work it out.
anyway, for the hated civics i actually only copied the code for favorite civics and changed it a little bit.
 
Top Bottom