Actually we can send the message for every player. AI will get the message although he wont use it.
Announcement
Collapse
No announcement yet.
Clerics, Corporate branch and so on...
Collapse
X
-
Had another go at it last night and got it almost done.
When playtesting I discovered a problem with our loop workarounds. I'd get a DoYouWantToConvert message for a city which I had conquered every turn. My suspicion is, that because of the asynchronous execution of the events the following happens: In the BeginTurn handler, the ConvertCity event is called for each city with the global variables set to prevent the message and that part of the code appearing. So for each city an event will be added to the 'waiting to be executed list' Then the first city goes through this event and those global variables are set back to their default value, resulting in a execution of the message code for the next city that has a different religion. Am I thinking right here??
After changing all convert handling code to the convertcityunit event things work now and we can even get rid of those global variables!
Furthermore I started writing on a readme, here's what I've got so far:
README to the Religion Code by Pedrunn and mapfi
Basic Idea:
The game already provides religion as a gameplay option. So far this was only available for theocratic governments. This mod makes it available to every rulership. Furthermore it introduces the concept of a changeable state/leader religion. The religion’s names are those of the founding civilizations.
Features:
-You’re starting religion will be your own, easily noticeable when you found your first city because the blue cross will appear next to the name on the next turn. Every fifth turn a religion info message will appear. It tells you: your current state religion, the current religion level (percentage of world pop converted to your state religion) and the effects religion has on cities, those being amounts of money paid by/to you by your/foreign cities with different/your state religion and happiness effects on each city depending on the success of the city’s religion. Be advised that in the beginning you need to grow as quickly as the AI’s in order not to have to put up with a severe happiness penalty for quite a while.
-With the discovery of religion (often already given at start) you’ll be able to build priests. Their abilities are those of the known cleric, converting cities, selling indulgences and soothsaying. Converting another city if successful has a chance of converting the AI to your state religion. While you won’t get any money from that player anymore the religion level of your civ will rise resulting in greater happiness. If another player successfully converts some of your cities the citizens will ask you to convert to this new religion. Positive aspects are that you won’t be paying anything to that civ anymore and your happiness will rise in those cities, the drawback is that you’ll have to reform the not yet converted cities which can be rather costly. With the discovery and the installment of a theocratic government you’ll be able to produce clerics, which have higher success rates when converting.
-Reformation by combat units: On ordering a reformation you’ll be giving the following options: Don’t do it after all, convert to your state religion or convert to your civ’s original religion. The last one will also revert your state religion back to your civ’s original religion. Reformation costs now depend on the religion level of the city’s religion you’re trying to convert and the number of combat units that can help you with the reformation in that city.
-Settler religion: Settlers, being of the pop of a city, naturally have the religion of that city and will stick to it even when that city is converted while they’re looking for a new settling spot. The newly founded city will then have the settler’s religion.
-Assimilation: By killing another player every city on the planet that was converted to this civ’s original religion will be converted to your current state religion.
-Diplomacy: Player’s with the same state religion will like you more, while the other’s will like you less.
Exact numbers and formulas: costs/succes rates/happiness ...
Comment
-
Gret stuff mapfi. I had some steps backs in my mod since my AI strategies.txt was somehow causing more often crashs.
But i am really anxious to see this new code
The Read me looks cool too"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Comment
-
Mapfi + Pedrunn,
Wow! nice stuff guys! I'm not here as often at the momment - but this kinda thing is great to bump into!
The readme looks great - any chance of a selection over how often you get the religion message(5/10/20 turns kinda thing)? If not then never mind - just what popped into my head on reading it. Religion is going to be big i think'The very basis of the liberal idea – the belief of individual freedom is what causes the chaos' - William Kristol, son of the founder of neo-conservitivism, talking about neo-con ideology and its agenda for you.info here. prove me wrong.
Bush's Republican=Neo-con for all intent and purpose. be afraid.
Comment
-
The readme looks great - any chance of a selection over how often you get the religion message(5/10/20 turns kinda thing)?
We are very glad you liked it. After all it was a 2 month work"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Comment
-
Originally posted by Pedrunn
Gret stuff mapfi. I had some steps backs in my mod since my AI strategies.txt was somehow causing more often crashs.
-MartinCiv2 military advisor: "No complaints, Sir!"
Comment
-
Originally posted by child of Thor
The readme looks great - any chance of a selection over how often you get the religion message(5/10/20 turns kinda thing)?
Comment
-
I can have buttons in regular message boxes too, can't I?
I was thinking i was going to add this but I guess you will give it a try
strategies causing crashs that is something new to me, at least as long as you don't remove parts of the STRATEGY_DEFAULT.
My slic changes strategies (maybe this but i havnet done nothing different from the existing handlers);
Some goal elements i deleted and added;
or the changes in the defense strategies (less likely to be the cause).
I will try to find some time to figure this out."Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Comment
-
Originally posted by Pedrunn
My slic changes strategies (maybe this but i havnet done nothing different from the existing handlers);
Originally posted by Pedrunn
Some goal elements i deleted and added;
Originally posted by Pedrunn
or the changes in the defense strategies (less likely to be the cause).
-MartinCiv2 military advisor: "No complaints, Sir!"
Comment
-
Readme continued
as requested you can now choose to have the religion info msg pop up every 5,10,20 turns and you can also change to have it only appear in the msg tab and not on the screen
success rates
priest, success 0.4, death 0.5
cleric, success 0.8, death 0.25
sell indulgences
you'll get the nr of pop in the city times 1/2/1/.5, depending if the city owner has researched default/theology/age of reason/mass media
if the city's religion is your state religion you'll get twice that amount
tenth
if a city of yours has got a different religion than your state religion it'll pay a tenth to all other players who have that religion as state religion
the paid amount is equal to the nr of pop of the city times 3/5/3/1, depending if the city owner has researched default/theology/age of reason/mass media if there's only one other player with that state religion, for each additional player the city will pay an additional half of this amount, the so paid amount is equally divided between the other players.
reformation
NewReformCost = percentage of world pop converted to the religion of the city times number of players times city pop times 5 divided by the number of units in the city
changing your state religion
when another player converts one of your cities you'll get a message to convert to that player's religion if more than 10 percent of your pop have converted to it already
when you're state religion is not your original one anymore and you try to reform one of your cities with another player's religion you'll get an option to resurrect your original religion
happiness bonus/malus
the so called happymod of a city is on a scale of 0 to 100, it is calculated in the following way:
As default the value of (percentage of world pop converted to the city's religion times number of players) is 100.
If this value is above 100 then the happymod is equal to (this value minus 100) divided by (the number of players minus 1)
if this value is below 100 than the happymod is 100 minus this value.
So the default value of the happymod is 0, and converting the whole world is equally grave as having no city converted to one's state religion
if HappyMod < 12.5 0 happiness
HappyMod < 27.5 +/- 1 happiness
HappyMod < 42.5 +/- 2 happiness
HappyMod < 57.5 +/- 3 happiness
HappyMod < 72.5 +/- 4 happiness
HappyMod < 87.5 +/- 5 happiness
HappyMod >= 87.5 +/- 6 happiness
reforming a city give's it -2 happiness for one turn
denying the request for a change of the state religion also give's the city -2 happiness for one turn
Comment
-
Have fun. I PMed Peter today because I had a few ideas why the LogRegardEvent might not want to work. So maybe we can solve that one easily enough.
You'll notice that I got completely rid of those loop preventers and set all handlers to convertcityunit. It works fine. It's just vital that whenever the code calls convertcity the change is actually stored in the array first.
The assimilation and changing messages work as well, though I had an AI change right back after I had him changed to my religion - I tried to adjust the values, so I shouldn't happen too often. (It can always change it's mind just after one turn, can't it...)
If you start testing keep in mind that 10% of your pop have to be converted before you're prompted about changing your state religion - fell over this one myself when playtesting but I want to keep it in - otherwise we'll have even more messageboxes appearing.
Comment
-
Originally posted by mapfi
Anything you wish, I'll try. There is a slight problem with the hardcoded size of the alertbox so I can't combine the button with the religion info message. So it's either going to be a pop up every 50 turns or so where you'll select, or a button included in the alertboxes for reformation and conversion or whenever you produce a cleric (and then not anymore for the next 50 turns if another cleric is produced). What do you think?'The very basis of the liberal idea – the belief of individual freedom is what causes the chaos' - William Kristol, son of the founder of neo-conservitivism, talking about neo-con ideology and its agenda for you.info here. prove me wrong.
Bush's Republican=Neo-con for all intent and purpose. be afraid.
Comment
-
I did not have time to look as deep as i wanted but i see your changes are concetrated in the 'ConvertorTakesTheMoneyPerTurn'
handler wich i cant barely recognize .
and i see a lot of new global variable wich i will love to dicover what they do.
I also noticed that you havent changed the reformation setting essency soi take my settings did work oppose what you have said in another thread.
And just hit me that we need to have a note in the read me not to have the slic reloaded in the game.
Have to go now.
Will look it at night (I hope)!"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Comment
Comment