Thread Tools
Old August 5, 2002, 09:19   #1
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Clerics, Corporate branch and so on...
The discussion about the use of clerics, teleevangelist and corporate branch started in the strategy forum
http://apolyton.net/forums/showthrea...threadid=56953
but really has to be part of this one, since we're talking about modifying.

To adjust the money given by selling indulgences to the city size is rather easy, some slic does it:
Code:
HandleEvent(IndulgenceSaleMade) 'newsellindulgence' post{
	AddGold(unit[0].owner, (city[0].population*5));
	AddGold(city[0].owner, -(city[0].population*5));
}
Worked in my testing, so far... Just adds that amount of gold to the already generated one defined in the const.txt

Now what I'm looking for:
I'd like to replace the "5" with a factor according to the state of the city, unconverted, converted or converted to other faith like in the const.txt.
Any idea where I get the state of the city?
mapfi is offline  
Old August 5, 2002, 23:39   #2
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Re: Clerics, Corporate branch and so on...
Quote:
Originally posted by mapfi
Any idea where I get the state of the city?
I dont think we can
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old August 6, 2002, 02:44   #3
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
could I continously create the data with global arrays? But that would probably take up too much memory...

Just another slic question, in the above code - should I put the two owners into user-defined variables before I use them in the function? There's soemthing in the documentation but I'm not sure if it's still valid since I see other modmakers using it also this way.
mapfi is offline  
Old August 6, 2002, 06:38   #4
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
You can do, but you don't need to. Often it's easier for long code to put them into use-defined variables, but for something like that, what you have is fine.

I guess if you kept track of every conversion and reformation it might be possible, but the easiest way would be to have city arrays.
I don't know if we can use city arrays, or only int arrays.
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Immortal Wombat is offline  
Old August 6, 2002, 07:46   #5
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 07:33
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
Quote:
Originally posted by mapfi
Just another slic question, in the above code - should I put the two owners into user-defined variables before I use them in the function? There's soemthing in the documentation but I'm not sure if it's still valid since I see other modmakers using it also this way.
Unfortunatly sometimes you need to do it, ones I used something like this in a self defined function and the game crashed this way, in other situations you will get this way DebugSlic=Yes errors, I started to debug these, too.

But if nothing happens and it does what you wants then it is fine.

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old August 6, 2002, 11:55   #6
Hermann the Lombard
Prince
 
Local Time: 01:33
Local Date: November 1, 2010
Join Date: Jun 1999
Location: Hoboken, NJ, USA
Posts: 894
Re: Clerics, Corporate branch and so on...
Quote:
Originally posted by mapfi
Now what I'm looking for:
I'd like to replace the "5" with a factor according to the state of the city, unconverted, converted or converted to other faith like in the const.txt.
Any idea where I get the state of the city?
I like your approach. If we can't get the state of the city, maybe make the const.txt value more important and the city size less important, perhaps zero for Other, five for Unconverted, and ten for Converted, (or even zero, ten, and twenty), and use a factor of "3" (or "2") instead of "5."
__________________
"...your Caravel has killed a Spanish Man-o-War."
Hermann the Lombard is offline  
Old August 6, 2002, 12:31   #7
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Not a bad idea if we just can't get that stupid city state...

I was also thinking about working on conversion: If the just converted city is the capital one could argue that you also might convert the civilizations leader, which then would proclaim the new religion as state religion (like it was done with christianity in old rome). Either all or maybe each city with a given probability would then also be converted.
The values for the clerics would have to be adjusted though, maybe lower the conversion factor and maybe not making the whole converting process too probable. But all in all rather easy slic and some txt adjustements.

What do you think?
mapfi is offline  
Old August 6, 2002, 13:17   #8
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Yeah it did not hit me that we can keep stored in global variable wich cities were converted.

And this idea may lead to a completely new feature.
Religion.
Probably controled by messagebox. Wich i dont know how far we can go. Yet, this is a major addition!
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old August 6, 2002, 13:25   #9
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Big project lurking around and attacking out of nowhere!

and I was just starting to get into this stuff...
mapfi is offline  
Old August 6, 2002, 14:11   #10
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Hasn't Locutus already worked on the concept of religion for his ctp3-mod?
mapfi is offline  
Old August 6, 2002, 14:23   #11
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
hehehe

As i think.
Besides storing wich cities were converted you would also store the player who converted.
Everyturn the player who converted takes a small percentage of gold from the converted civ according to the city's population and an extra if he converted the capitol. (plus the gold from sell indulgences is bigger).
Every time a city is converted the city owner gets a choice to join the convertor religion. If he dont accept he still keeps losing its money (note he can still reform the city).

If he accepts all of his cities get converted to the other player religion (this will cause unhapppiness in all cities that werent converted and increase the happiness in those that were converted). The number of gold taken by the other civ drasticly decreases and the player with the new religion can sell indulgences to other civs and get the same amout as if it was converted by him.

I dont think it will be a problem to teach the AI how to use it.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old August 6, 2002, 14:27   #12
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Some thought were given to its mod but i think they went too far away from reality.
And nothing was said when or how he was going to make. This can be the kick to start all of what he wanted.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old August 7, 2002, 00:49   #13
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Could you test this code Mapfi or anyone?

It follows the first idea of only changing the money from conversion and sell improvements.
It should add one gold per population of the converted cities to the player who convert these city.
It also re-calculates the sell indulgences. Giving one gold per civ in a city if the city is converted by the cleric owner. And 1 gold for every 5 pop if the city isnt converted. And 1 gold per 10 pop if the city isnt converted.

If it works we can move on to next stage: Giving identity to the religions.

Any comments?

Code:
////////////////////////////////////////////////////////////////////////////
// 1) Religion Code
////////////////////////////////////////////////////////////////////////////

city_t ConvertedCity[];
int_t ReligionOwner[];

int_t ReligiousCount;

int_f GetCityConvertor(city_t tmpCity) {	// if GetCityConvertor = 0, means city is not converted
int_t tmpPlayer;
int_t i;
	if(CityIsValid(tmpCity)) {
		for(i = 0; i <= ReligiousCount; i = i + 1) {
			if(tmpCity == ConvertedCity[i]) {
				tmpPlayer = ReligionOwner[i];
			}
		}
	}
	return tmpPlayer;
}


HandleEvent(ConvertCity) 'StoreConvertedCity' pre {
city_t tmpCity;
int_t i;
	if(CityIsValid(city[0]) && IsPlayerAlive(player[0])) {
		for(i = 0; i <= ReligiousCount; i = i + 1) {	
			if(city[0] == ConvertedCity[i]) {	
				ReligionOwner[i] = 0;		// Erase old owner 
			}
		}
		ConvertedCity[ReligiousCount] = city[0];
		ReligionOwner[ReligiousCount] = player[0];
		ReligiousCount = ReligiousCount + 1;		// Store city and player who converted
	}
}

HandleEvent(BeginTurn) 'ConvertorTakesTheMoneyPerTurn' post {
int_t SinfulCiv;
int_t PriestCiv;
int_t theTenth;
int_t i;
	SinfulCiv = player[0];
	for(i=0; i < player[0].cities; i = i + 1) { 	 
		GetCityByIndex(SinfulCiv, i, city[0]);	
		PriestCiv = GetCityConvertor(city[0]);
		if(PriestCiv != 0) {
			theTenth = city[0].population;	// How much it will be? 1 gold per pop per turn?
			AddGold(SinfulCiv, theTenth);
			AddGold(PriestCiv, - theTenth);
		}
	}
}

HandleEvent(SellIndulgencesOrder) 'ConvertorTakesTheMoneyFromIndulgences' pre {
int_t SinfulCiv;
int_t PriestCiv;
int_t ConvertorCiv;
int_t theTenth;
army_t GodsArmy;
location_t tmpLoc;
	GetCityByLocation(tmpLoc, city[0]);		//
	PriestCiv = GodsArmy.owner;			//
	ConvertorCiv = GetCityConvertor(city[0]);
	SinfulCiv = City[0].owner;
	if(ConvertorCiv == PriestCiv) {		// If city is converted by the cleric owner
		theTenth = city[0].population;		// How much gold he gets? 1 gold per  pop 
		AddGold(SinfulCiv, theTenth);
		AddGold(PriestCiv, - theTenth);
	}
	elseif(ConvertorCiv == 0) {			// if City is not converted
		theTenth = 1 + city[0].population/5;	// How much gold he gets? 1/10 gold per pop 
		AddGold(SinfulCiv, theTenth);
		AddGold(PriestCiv, - theTenth);
		
	}
	elseif(ConvertorCiv != PriestCiv) {		// if city is coverted by another civ religion
		theTenth = 1 + city[0].population/10;	// How much gold he gets? 1/20 gold per pop 
		AddGold(SinfulCiv, theTenth);
		AddGold(PriestCiv, - theTenth);
	}
}
EDIT: A small mistake that would ruin everything was find. The code above is now correct.
Teh correct version
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand

Last edited by Pedrunn; August 7, 2002 at 07:32.
Pedrunn is offline  
Old August 7, 2002, 07:31   #14
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
well, you got me started there! I'll list the changes:
  • included new function for checking if city is already in the array
  • erased validity checks when debugging (i don't know if those are necessary - you tell me - but when I was looking for mistakes they came in my way
  • erased counters, because the .# gives the actual size of the array
  • took a while till I spotted that: ConvertedCity[ROwnerCounter] = player[0];, should be ReligionOwner of course
  • included Reformation of city by owner
  • erased the part of the converted cities giving gold, since that is already done by the regular game, we could, however, make adjustements here
  • took IndulgenceSaleMade as event
  • changed minus signs in sell indulgence, you subtracted gold from the seller
  • changed the values in sellindulgences, a tenth of pop is not going to make much difference

It worked in my testing, so far... Thanks a lot for getting me going!

note: we should of course set the values of the sell indulgence event in the const.txt to zero, to make it clearer what the total effect actually is and where it's defined, same if we want to change the converted cities paying gold -> 2nd note: in the game this is 0.2 times the gold production of the city - so not what you had in mind here, but we can easily access the cities gold production via slic if we want to make any changes there

Code:
////////////////////////////////////////////////////////////////////////////
// v.1 Religion Code by Pedrunn
// v.2 by mapfi
////////////////////////////////////////////////////////////////////////////

city_t ConvertedCity[];
int_t ReligionOwner[];


int_f GetCityConvertor(city_t tmpCity) {	// if GetCityConvertor = 0, means city is not converted
int_t tmpPlayer;
int_t i;
	if(CityIsValid(tmpCity)) {
		for(i = 0; i < ConvertedCity.#; i = i + 1) {
			if(tmpCity == ConvertedCity[i]) {
				tmpPlayer = ReligionOwner[i];
			}
		}
	}
	return tmpPlayer;
}

int_f CheckforCity(city_t tmpCity) {	//if City is already in array returns place, otherwise next free array place
int_t i;
int_t num;
num = ConvertedCity.#;
	for(i = 0; i < ConvertedCity.#; i = i + 1) {
		if(tmpCity == ConvertedCity[i]) {
				i=num;
		}
	}
	return num;
}

HandleEvent(ConvertCity) 'StoreConvertedCity' post {
int_t i;
	i = CheckforCity(city[0]);
	ConvertedCity[i] = city[0];
	ReligionOwner[i] = player[0];
}

HandleEvent(UnconvertCity) 'StoreUncovertedCity' post {		//reformation by city owner
int_t i;
	i = CheckforCity(city[0]);
	ConvertedCity[i] = city[0];
	ReligionOwner[i] = 0;
}

HandleEvent(IndulgenceSaleMade) 'ConvertorTakesTheMoneyFromIndulgences' post {
int_t SinfulCiv;
int_t PriestCiv;
int_t ConvertorCiv;
int_t theTenth;
	PriestCiv = unit[0].owner;
	ConvertorCiv = GetCityConvertor(city[0]);
	SinfulCiv = city[0].owner;
	if(ConvertorCiv == PriestCiv) {			// If city is converted by the cleric owner
		theTenth = city[0].population*5;		// How much gold he gets? 1 gold per pop times 5
		AddGold(SinfulCiv, - theTenth);
		AddGold(PriestCiv, theTenth);
	}
	elseif(ConvertorCiv == 0) {			// if City is not converted
		theTenth = city[0].population*3;		// How much gold he gets? 1 gold per pop times 3
		AddGold(SinfulCiv, - theTenth);
		AddGold(PriestCiv, theTenth);
		
	}
	elseif(ConvertorCiv != PriestCiv) {			// if city is coverted by another civ religion
		theTenth = city[0].population;		// How much gold he gets? 1 gold per pop 
		AddGold(SinfulCiv, - theTenth);
		AddGold(PriestCiv, theTenth);
	}
}
mapfi is offline  
Old August 7, 2002, 07:59   #15
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Quote:
Originally posted by mapfi
  • included new function for checking if city is already in the array
  • erased counters, because the .# gives the actual size of the array
I dont think this will give any advantage. But for sure you a much experienced programmer than i am (my very first code only has two/three months).

Quote:
Originally posted by mapfi
  • took a while till I spotted that: ConvertedCity[ROwnerCounter] = player[0];, should be ReligionOwner of course
You got me few minutes before i had edited that post where i fixed this bug. I also changed the cod in a way that it only has one count (instead of for city and other for the player).

Quote:
Originally posted by mapfi
  • included Reformation of city by owner
I did forgot that, dindnt i?

Quote:
Originally posted by mapfi
  • erased the part of the converted cities giving gold, since that is already done by the regular game, we could, however, make adjustements here
Yet i have added that because i plan to pop messages box every turn (without show() function for sure) where it says how much gold was lost/gained by the civ. Yet we didnt made religious so important to have this messaging poping out. (I also plan to add other information in this message box about trade and others features)

Quote:
Originally posted by mapfi
  • took IndulgenceSaleMade as event
I hadnt seen this event befor. It sure looks to be trustful to work than SellIndulgences orders. Other than i dont see much of a difference
  • changed minus signs in sell indulgence, you subtracted gold from the seller
[/quote]

Ooops

Quote:
Originally posted by mapfi
  • changed the values in sellindulgences, a tenth of pop is not going to make much difference
I was going to start a discussion about that. This value was just temporary (thats why i create a whole new variable in the code so that was easier to edit.

Quote:
Originally posted by mapfi
It worked in my testing, so far... Thanks a lot for getting me going!
Glad to hear this. This is enough for us to work with yor code and to move on to stage two. Although i may need to get used to the .# wich i had never seen it before. ( as i said i am not much of experienced programmer)

Quote:
Originally posted by mapfi
note: we should of course set the values of the sell indulgence event in the const.txt to zero, to make it clearer what the total effect actually is and where it's defined, same if we want to change the converted cities paying gold
Thats what i had in mind
Quote:
Originally posted by mapfi
-> 2nd note: in the game this is 0.2 times the gold production of the city - so not what you had in mind here, but we can easily access the cities gold production via slic if we want to make any changes there
Sure thing. This is also good if we will want to implement the message box idea.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand

Last edited by Pedrunn; August 7, 2002 at 08:07.
Pedrunn is offline  
Old August 7, 2002, 08:46   #16
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Quote:
I dont think this will give any advantage. But for sure you a much experienced programmer than i am (my very first code only has two/three months).
well otherwise the array would get huge when cities are converted a lot and as for the experienced programmer "Errare humanum est" -> I'm not... had a semester of programming C++ two years ago, haven't done any since and just started reading into SLICing a week ago
Quote:
Yet i have added that because i plan to pop messages box every turn (without show() function for sure) where it says how much gold was lost/gained by the civ. Yet we didnt made religious so important to have this messaging poping out. (I also plan to add other information in this message box about trade and others features)
well if we keep on working on this at the same pace it may soon be important
Quote:
I hadnt seen this event befor. It sure looks to be trustful to work than SellIndulgences orders. Other than i dont see much of a difference
i'm not sure but maybe you can give the unti the order more than once even it will only execute once - anyhow, this is just to be on the safe side
Quote:
This is enough for us to work with yor code and to move on to stage two. Although i may need to get used to the .# wich i had never seen it before.
The .# is usually something like .size in other languages, so most common just a strange way of writing it in slic
Stage 2:
Quote:
Every time a city is converted the city owner gets a choice to join the convertor religion. If he dont accept he still keeps losing its money (note he can still reform the city). If he accepts all of his cities get converted to the other player religion (this will cause unhapppiness in all cities that werent converted and increase the happiness in those that were converted). The number of gold taken by the other civ drasticly decreases
so we'll do that in slic with part of the code I took out, additionally when more than half of the cities are converted there could also be a pop up that the people petitiones the leader to convert all cities.
Quote:
and the player with the new religion can sell indulgences to other civs and get the same amout as if it was converted by him.
now it's getting complicated - can we unconnect religion and player? The problem is the data shown in the map which specifically connects those two. and i don't think it's possible to have a players city with his religion converted- i'll try that just now
mapfi is offline  
Old August 7, 2002, 09:23   #17
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Yes, yes, yes

if I add/adjust the event handler for UnconvertCity(city_t) with a convertcity event
ConvertCity(city_t, int_t, int_t) //City actually converted
the game allows me to select any player we want, even the same as the owner of the city, and the blue sign appears beside the blue city!
which means, we can redefine the int_t for player in those events as religion - so at the beginning we're all atheist and after some research you can select a state religion which allows you to build the clerics instead of the conditions now - boah this is major work ahead but as far as I can see all doable!
mapfi is offline  
Old August 7, 2002, 10:37   #18
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
well I tried something with what we had with religion and player unconnected, I zipped it, so have a look at it(it hasn't been tested...)

What we need now is the messagebox stuff and of course the new defining of the goldturnover from religious cities - do they all pay in a religion specific pot and whoever has that religion get's a share of it?
And we should beginn to add bonuses for the different religions, for production, gold or science...

edit: added eventhandler for capturing city
Attached Files:
File Type: zip religion.zip (1.3 KB, 3 views)

Last edited by mapfi; August 7, 2002 at 11:43.
mapfi is offline  
Old August 7, 2002, 12:16   #19
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
looking good

Couple of things...
In CheckForCity, "i=num;" I think should be "num=i;" so you store the position into the number. Have I understood that right?

And in the IndulgenceSaleMade event, :
Code:
elseif(ConvertorCiv != PriestCiv) {
that could just be an "else {", not that it really matters much.
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Immortal Wombat is offline  
Old August 7, 2002, 14:26   #20
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
hey thanks!

num = i, yes, i didn't test it as i said
for the other one just bad style, you're right
i'll keep on thinking... and trying out

Last edited by mapfi; August 7, 2002 at 15:01.
mapfi is offline  
Old August 7, 2002, 15:03   #21
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
forgot the updated one, hope to have something more tomorrow night
Attached Files:
File Type: zip religion.zip (1.4 KB, 4 views)
mapfi is offline  
Old August 7, 2002, 15:11   #22
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
You have been working on a code!?!
I have staterd one too.

And I am almost done with mine!
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old August 7, 2002, 16:34   #23
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
nah, nah, nah

there's nothing as too much work - what i've got right now is the thing posted and I was planning on taking that further - but in that case I'll wait for your code and anyway, bedtime for me now...
mapfi is offline  
Old August 7, 2002, 21:04   #24
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 07:33
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
Wow, guys, this is looking great

Exactly the sort of thing I was working on, but since I'm extremely busy, I'm glad to see you guys are doing my work for me I'll try to post some ideas on how to expand the religion idea even further later on. My vision is that religion should become CtP's equivilant of Civ3's culture. There should IMHO also be some sort of 'level' of religion: some cities are strongly religious, some only very weakly, ala culture. Perhaps cities could even have several religions, with one of them being the dominant one... but this requires careful thinking to work it out properly...
__________________
Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery
Locutus is offline  
Old August 7, 2002, 21:16   #25
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Can SLIC do arrays of more than two dimensions like C can?

int_t CITY_RELIGIONS[][][];
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Immortal Wombat is offline  
Old August 7, 2002, 21:30   #26
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 07:33
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
No, but you can fake it. Instead of array[10][10][10], you can have array[(10*10*10)].
__________________
Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery
Locutus is offline  
Old August 7, 2002, 23:10   #27
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
I have finished ny code.

I hope you dont mind. But tha .# scaries the hell out of me. So i kept the counter. You may change it if you want.

Iit is late here in Brasil and i will get some sleep.
Tomorrow i will start the debuging, improving and testing.

Good Night
Attached Files:
File Type: slc as_pedrunn.slc (12.8 KB, 6 views)
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old August 8, 2002, 02:52   #28
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Just had a quick look, since I haven't got much time today. Looks very good.
Couldn't find the text for the messagebox 'ReligionInfo' though. And you've got that loop in ConvertCity - it calls itself over and over again.
I can see you're partly going into another direction than me. I was centering around the little colored cross that's displayed in the regular view to make it easy for the player to keep track of the city's religion. I like your message boxes though, I haven't read into that part of slic yet.

Now what we have to address is:
What's exactly the benefit of converting a enemy city? Just some money, or more? And what happens if the player changes his religion? In your code as I understand it - if player b converts to the religion of player a, b doesn't get any money if he himself converts cities of player c instead a will get the money.

Another problem so far is, that clerics require Theocracy - I think we can easily change that - but also that whenever you change your government to something else the crosses dissappear - we still got the information in our array then but no little crosses to show the player, and I like them so much

Where are the tactics for the ai considering conversion? I hope that's not hard coded...
mapfi is offline  
Old August 8, 2002, 09:43   #29
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 02:33
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Quote:
Originally posted by mapfi
Couldn't find the text for the messagebox 'ReligionInfo' though.
Actually the messages are totally wrong in the code. It looks like i had a misconcept with the alertbox. I have attached a txt with the correct lines

Quote:
Originally posted by mapfi
And you've got that loop in ConvertCity - it calls itself over and over again.
The bug is in this line.
Code:
Event: ConvertCity(city[0], PlayerReligion[tmpplayer], 0);
It seems i cant get the game to save the religion at the beggining of the game with the code.
Code:
HandleEvent(BeginTurn) 'SaveReligionsArrays' post {	// At the Begginning of the game
int_t tmpPlayer;
	for(tmpPlayer = 0; tmpPlayer <= 32; tmpPlayer = tmpPlayer + 1) { // For all
		if(IsPlayerAlive(tmpPlayer)) {				 // alive player
			PlayerReligion[tmpPlayer] = tmpPlayer;		 // Given them a religion
		}
	}
	DisableTrigger('SaveReligionsArrays');
}
Since in the message RELIGIOUS_INFO it say the religion name of the player is 0 and not the name of the civiliztion as i expected.
I think this is causing the loop.
Any ideas to solve this
Quote:
Originally posted by mapfi
I can see you're partly going into another direction than me. I was centering around the little colored cross that's displayed in the regular view to make it easy for the player to keep track of the city's religion. I like your message boxes though, I haven't read into that part of slic yet.
I want religion to be a very deep aspect of the game.
What i aim at is to create religons that do not depend on the civs. Yet the civ who created it was going to receive advantages because of her.
The religion would start being spread by its starting civ and once civs get totally converterd to it. The totally converted civ is going to convert others civ to the player who started the religion (I like to think that relion is a totally different/separated concept from civilization. it is like it has its own life).

Now what we have to address is:

Quote:
Originally posted by mapfi
What's exactly the benefit of converting a enemy city? Just some money, or more? And what happens if the player changes his religion? In your code as I understand it - if player b converts to the religion of player a, b doesn't get any money if he himself converts cities of player c instead a will get the money.
Thats what i wrote (It gets the money from selling indulgences too and dont get) but we could fix that so that part of the money goes to the player b or we could come up with another advantage if the religion is well suceed (Locutus i think that is where you are aiming at, isnt?). This something to dicuss about it.
Quote:
Originally posted by mapfi
Another problem so far is, that clerics require Theocracy - I think we can easily change that - but also that whenever you change your government to something else the crosses dissappear - we still got the information in our array then but no little crosses to show the player, and I like them so much
The crosses disapear when enacting new govs? Are you sure? I really really dont thing they do but i am not 100% sure about it.
A really small change in the unit.txt would make the cleric avaible to all govs. But i plan to create a new unit with less chance of succeding in the conversion avaible to all civs. Since i want new teocracy to have an advantage

Quote:
Originally posted by mapfi
Where are the tactics for the ai considering conversion? I hope that's not hard coded...
The Goals.txt determines how should the AI use the tactic and strategy.txt determines how the likely they will use this order depending on the AIs strategy.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old August 8, 2002, 10:42   #30
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 06:33
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
Quote:
The bug is in this line.
Code:
Event: ConvertCity(city[0], PlayerReligion[tmpplayer], 0);
Yep, if you look in that little piece of code I wrote you'll find I solved that by using a global variable to count the called events. There might be something better, though
Quote:
What i aim at is to create religons that do not depend on the civs.
That's my aim too, and as I found out, the colored cross can appear at any players city. Just read a few post ahead.
Quote:
The crosses disapear when enacting new govs? Are you sure?
Quite sure, tested it, but try it out in the game yourself.
mapfi is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:33.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team