Thread Tools
Old August 29, 2002, 06:16   #61
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:
And you dont have any clue about a fix?
It's hard to spot one's own mistakes, you know - no not a clue...
Quote:
Cities(int_t)
that function always crashed my game!
Quote:
PS: The CreateUnit event does work.
I read that on the forums too and was already thinking and a doing a little bit writing on it but nothing set yet.
Quote:
We should have done this before to the storage of the city safer anyway.
Yet is even more important to do it whenever we call a city out of allCities because when the city ceases to exist it'll still be in the array - as 'noname' which can't be assigned to a city variable
Quote:
Tomorrow we talk about a improvements
Let's hope we've got a lot of them...
mapfi is offline  
Old August 29, 2002, 18:54   #62
Dale
Emperor
 
Dale's Avatar
 
Local Time: 15:33
Local Date: November 1, 2010
Join Date: Dec 2000
Posts: 3,944
What would happen in the instance of a destroyed city? Either by barbs, starvation, conquest, razing, whatever? Does it stay in the religion array? Be a huge waste of memory I think, and leading towards mem-leaks.
Dale is offline  
Old August 30, 2002, 04:12   #63
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
so you think we'll have to throw it out after that... ok. thanks for the advice
mapfi is offline  
Old August 30, 2002, 06:09   #64
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 Dale
What would happen in the instance of a destroyed city? Either by barbs, starvation, conquest, razing, whatever? Does it stay in the religion array? Be a huge waste of memory I think, and leading towards mem-leaks.
Yeah these dynamic arrays are a problem they grew automatically. Do you know how I can reduce the size of such an array afterwards, Dale?

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"

Last edited by Martin Gühmann; August 30, 2002 at 09:04.
Martin Gühmann is offline  
Old August 30, 2002, 08:56   #65
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:
What would happen in the instance of a destroyed city? Either by barbs, starvation, conquest, razing, whatever? Does it stay in the religion array? Be a huge waste of memory I think, and leading towards mem-leaks.
Quote:
so you think we'll have to throw it out after that... ok. thanks for the advice.
Quote:
Yeah these dynamic arrays are a problem they grew automatically. Do you know Dale I can reduce the size of such an array afterwards, Dale?

Cant we just do this:
Code:
int_f CheckforCity(city_t tmpCity) {	//returns place of city in array, or next free place
int_t i;
int_t num;
city_t thecity;
	thecity = tmpCity;
	for (i = 0; i < allCities.#; i = i + 1) {
		if (CityIsValid(allCities[i])) {
			if (thecity == allCities[i]) {
				return i;
			}
		}
		else{
			return i;
		}
	}		
	return allCities.#;
}

void_f StoreCity(city_t tmpCity, int_t tmpreligion) {	//stores city in allCities array
int_t i;
city_t thecity;
int_t thereligion;
	thecity = tmpCity;
	thereligion = tmpreligion;
	i = CheckforCity(thecity);
	allCities[i] = thecity;
	CityReligion[i] = thereligion;
}
__________________
"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 30, 2002, 09:01   #66
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
I think you're right Pedrunn - that should fill the empty places of the array
mapfi is offline  
Old August 31, 2002, 00:07   #67
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 was looking over the file again and just hit me. After fixing the ReligionLevel (that actually is expendable), change KillPlayer by CaptureCity (five minutes task) and the LogRegardEvent (another five minutes task) what do we have to do now??? We are pretty much done with this code!!!
Just test and send to the database. Funny how the making of this code went smoothly. Normaly when I am at the middle of a code i usually became too anxious to see it done. I guess this is because we still have a feeling that something is missing after all religion is a really big thing in real life.

After packing the city expansion I will try to fix these missing stuff.
__________________
"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 31, 2002 at 00:13.
Pedrunn is offline  
Old August 31, 2002, 04:58   #68
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
it's going smoth yes, just a few things that come to my mind, though:

- settler religion
- didn't we want to allow cleric for every government like i did it in the last version and then create a new unit for theocracy that'd do the conversion cheaper or with higher success
- the calculations in the code for the ai, goals and strategies for ai
- balancing and playtesting
- just a thing i'd like to change about the setting: when a city gets converted I'd like to send the message "do you want to convert all cities" only if the religion level in the civ is high enough - some probability calculation there
- the happiness adjusters in the begin turn handler for now only depend on the religion level - we have to somehow include the actual player number as a divisor to make that reasonable.
mapfi is offline  
Old August 31, 2002, 12:00   #69
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
- settler religion
oh yeah i will try to write this right before the finish of the CityX packing.
Quote:
Originally posted by mapfi
- didn't we want to allow cleric for every government like i did it in the last version and then create a new unit for theocracy that'd do the conversion cheaper or with higher success
Thats not really a problem. another 5 minutes task. I will really do this right before testing phase. The CTP1 cleric for non-theocratic player and the CTP2 cleric for the ones under theocracy.
Quote:
Originally posted by mapfi
- the calculations in the code for the ai, goals and strategies for ai
True. this may take a little while.
Quote:
Originally posted by mapfi
- balancing and playtesting.
For sure
Quote:
Originally posted by mapfi
- just a thing i'd like to change about the setting: when a city gets converted I'd like to send the message "do you want to convert all cities" only if the religion level in the civ is high enough - some probability calculation there
Actually i really thought the best was too remove it. It is too exagerate. I think if someone convert to a new religion he should
reform all of its cities one by one. Yet we can make some cities with low religion level convert by itself.

Quote:
Originally posted by mapfi
- the happiness adjusters in the begin turn handler for now only depend on the religion level
- we have to somehow include the actual player number as a divisor to make that reasonable.
Can you explain better? I dont get what you mean

Another feature: Reform gold cost depends on the population and religion level of the city.
__________________
"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 31, 2002 at 12:08.
Pedrunn is offline  
Old September 1, 2002, 08:15   #70
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:
Reform gold cost depends on the population and religion level of the city
Good idea! But we'll either have to do it with a payback on the 1000 gold subtracted or otherwise you'll be able to reform for free when you're treasury is low. Or we'll have to check the players treasury and deny him the action with another message.
Quote:
I think if someone convert to a new religion he should reform all of its cities one by one.
That wasn't what I meant - I thought the player wouldn't get to choose to convert his state religion when only the first or second of his 30 cities is being converted.
This just made me realize we have to check the code for what it does to the following situations:
Player 1 has got City A, 2 - B, and 3 - C:
C is being converted to 2, player 2 converts his state to 1, what happens with C? Where does the money go? And same thing now, when 2 reforms his city B to the ancient religion but his state religion stays 1...
And how can you ever change your state religion back to your ancient one? That's not in the code yet - we could have a message appear when the religion level gets high enough again because enough cities have been reformed to their ancient religion.

The other thing you said you didn't understand: What I meant is, assume you've got three players in the game -> normally you'll have a religion level of 33% if you're doing fine; with 10 players in the game, you'll be stuck around 10% because there are more religions on the world. SO the happiness adjusters have to take that into account.
mapfi is offline  
Old September 1, 2002, 13:14   #71
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

Good idea! But we'll either have to do it with a payback on the 1000 gold subtracted or otherwise you'll be able to reform for free when you're treasury is low. Or we'll have to check the players treasury and deny him the action with another message.
We can check the gold and make it return STOP when there isnt enough money.
Quote:
Originally posted by mapfi
That wasn't what I meant - I thought the player wouldn't get to choose to convert his state religion when only the first or second of his 30 cities is being converted.
This just made me realize we have to check the code for what it does to the following situations:
Player 1 has got City A, 2 - B, and 3 - C:
C is being converted to 2, player 2 converts his state to 1, what happens with C? Where does the money go? And same thing now, when 2 reforms his city B to the ancient religion but his state religion stays 1...
The gold goes to all players that have this religion. if all players have it none get. If anyone has none get too. The player that started with the religion has mo bonus when it comes to the gain of gold.
Quote:
Originally posted by mapfi
And how can you ever change your state religion back to your ancient one? That's not in the code yet - we could have a message appear when the religion level gets high enough again because enough cities have been reformed to their ancient religion.
Yes it is. You can change the state back by reforming a city. In my last code a message will appear asking if you want to convert to the current religion, or the ancient religion (and the city) or to cancel the order.
Quote:
Originally posted by mapfi
The other thing you said you didn't understand: What I meant is, assume you've got three players in the game -> normally you'll have a religion level of 33% if you're doing fine; with 10 players in the game, you'll be stuck around 10% because there are more religions on the world. SO the happiness adjusters have to take that into account.
I did not think of that. So we will divide the religion by the number of player. Yet i want to make the religionLevel partial. The addition all religionLevel should equal 100. this will make the player have an idea on how good their religion are compared to the others religion.
But i was really thinking on taking off the national conversion piece of code. What do you think?
__________________
"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; September 1, 2002 at 13:26.
Pedrunn is offline  
Old September 1, 2002, 13:34   #72
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
Why do you want to take out the national conversion?
Because it's so severe? That's why I thought we shouldn't let the player choose to change his state religion at every conversion/reformation happening but only at certain levels and also maybe not let every forced conversion like this be a success.

You can leave the religion levels like that and just adjust the happiness code with trigger levels at religionlevel >= x * 100/player number. By the way - I think we shouldn't go over +5 happiness and even that might be too much.
mapfi is offline  
Old September 2, 2002, 13:42   #73
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
The City Expansion is already in Locutus hands so i may be focused in this code from now on.
Report:
1) I started doing some changes. The ReligionLevel is working now. I tested the worldpo and converted pop coding and they both work. So i discovered the problem was in the equation. Bingo! It seems the slic first divides/multiplies the variables and them the the actual numbers. Since the ConvertedPop/WorldPop is always a non-integer and lower than 1 it always reurned 0. So we just need to write this equation instead of the other one:
Code:
Level = (ConvertedPop*100)/WorldPop;
2) The settlers with religion coding is tougher then i thought it would be. since both CreateUnit and CreateCity does not have a unit_t buitin variable. So i may have to do (if possible) some big work around.

3) You were right about the religion names in the messages. We cant make just player[something] that it will work. This will ony work if we use a built in variable from the event. Eg. If you use/change the value of player[0] in the BeginTurn event it will work since this event has a int_t variable.

4) Have you seen ReformCityUnit piece of coding work? I have tested and i did not get any message. But happily i have seen the msg working with UnconvertCity(city_t). I will make the reform cost gold code soon (cost = 200 + citypop*ReligionLevel*3; Thats ok for you?).

5) I will add the alive players count in the happines modifier. 5 and 6 is probably too much. I guess the maximum is best to be 4.

Quote:
Why do you want to take out the national conversion?
Because it's so severe? That's why I thought we shouldn't let the player choose to change his state religion at every conversion/reformation happening but only at certain levels and also maybe not let every forced conversion like this be a success.
I think we should remove the national conversion. Or make a message pop up for every city in the empire that has a military unit asking if you want the unit to convert the city. Ala Unit Updater code.
As for the Conversion / Reforming city we could make a random calculation depending on the religion Levels of both new and to convert religion. sucees, convert city. failed, sorry but the people of this city did not accept the true faith .
Of course the Coversion chance from unit.txt will be unused.
__________________
"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; September 2, 2002 at 13:59.
Pedrunn is offline  
Old September 2, 2002, 15:46   #74
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:
Have you seen ReformCityUnit piece of coding work?
It worked when I tested it - there was no problem with it. You're sure you had enough money?
Quote:
I think we should remove the national conversion. Or make a message pop up for every city in the empire that has a military unit asking if you want the unit to convert the city. Ala Unit Updater code.
I don't understand why you don't like it but the possibility you propose seems reasonable too.

If we put some chance of failure into the reform event it certainly has to get cheaper - it might be too expensive as it is, but then... no actually now it's balanced, it fits the investing cost and the rather low return.

Quote:
It seems the slic first divides/multiplies the variables and them the the actual numbers. Since the ConvertedPop/WorldPop is always a non-integer and lower than 1 it always reurned 0.
You're saying A*2/B is calculated as (A/B)*2. I wonder if somebody noticed that before or if they all were just lucky not to stumble over it or always used brackets to be sure or just disbanded a piece of work in despair?
mapfi is offline  
Old September 6, 2002, 07:53   #75
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
New Version:

1) City Religion Level Fixed.

2) Only who is alive has a religion. Not all 32 players that may or may not be in the game

3) There is a check every turn for new players from revolted cities and gives them the religion of the city who first revolted.

4) Happines modifier depends on a multiplier = number of religions in the game

5) The AI check all of its cities. if the city has a different religion from yours he tries to reform it.

6) Reformation cost the gold according to the equation ReligionLevel*CityPop*5. Effects were added and choices were polished depending on the relation between the city owner religion and the city religion.
The AI only reforms of has four times the gold to reform and if its religion level is bigger than 1/3 of the city religion level.

7) Settler settle cities with same religion as the city wich they were built.

What do you think, mapfi?

PS: Dont try to play with DebbugSlic = Yes.
It reports bugs that dont interfer in the code.
__________________
"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 September 6, 2002, 07:55   #76
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
forgot the code

Note: I just notests i made seven upgrades in this version. isnt this suggestive )
Attached Files:
File Type: slc as_religion.slc (18.2 KB, 7 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 September 6, 2002, 19:30   #77
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
Here's number 8. Since I won't have any time over the weekend I'll post it even though I haven't done that much to it.
- Pedrunn: You completely forgot a testing routine in the settler stuff, it's where you'll find now a variable "testunit".
- The Settler stuff won't work out nicely yet. I rewrote it but the fact that there'll be nonexisting units in the ReligiousSettler array will give slicerrors because there's no UnitIsValid function and in orther to use the ArmyIsValid you'll have to valid Unit to put into that function... I'm believing that it works nevertheless though, believing at least...
- The LogRegardEvent: I was PMing Peter about this, but he couldn't see what I saw (instead he nicely pointed out some other mistakes), so I'll just post my screeshot here:
Attached Thumbnails:
Click image for larger version

Name:	screenshot.jpg
Views:	51
Size:	14.2 KB
ID:	23745  
mapfi is offline  
Old September 6, 2002, 19:34   #78
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, i've got win XP - I like it though...

the syntax we're using (where p is another integer):
LogRegardEvent(tmpPlayer, p, -2, 0, ID_NONE, 0);
I've got NONE in the stringfiles and I've tried playing with the last 0, no change.

And here's the code (with the LogRegard disabled), as last time setup to be part of SAP with the according Modswapper option:
Attached Files:
File Type: zip religion8.zip (34.0 KB, 3 views)
mapfi is offline  
Old September 7, 2002, 07:26   #79
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
There is no unit is valid check???

And what about this one:

unit.valid - true if the unit still exists, false otherwise

From the slic documentaion about the build in array types.

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old September 7, 2002, 07:29   #80
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
- Pedrunn: You completely forgot a testing routine in the settler stuff, it's where you'll find now a variable "testunit".
I see this in a lot of codes and i do write this routine most of the time. But is this really needed? How does this improve the code?
Sorry for my ignorance
Quote:
Originally posted by mapfi
- The Settler stuff won't work out nicely yet. I rewrote it but the fact that there'll be nonexisting units in the ReligiousSettler array will give slicerrors because there's no UnitIsValid function and in orther to use the ArmyIsValid you'll have to valid Unit to put into that function... I'm believing that it works nevertheless though, believing at least...
I tested this feature and it did work. For the message we could use a if(ReligiousSettler.# > 0) to prevent the slic error. But i dont see why a problem would happen?
Quote:
Originally posted by mapfi
- The LogRegardEvent: I was PMing Peter about this, but he couldn't see what I saw (instead he nicely pointed out some other mistakes), so I'll just post my screeshot here:
I will look another function to change the regard. But this function was used several times in the NewDiplomod code. Why are we getting errors?
Quote:
//player[0] = tmpReligion; no error, but it's not written into it - i'll always get the same religion in the message
This is the most terrible comment i have ever seen. I tested and you were right. player[0] no matter how we change it during the code will always be defined as the built in variable of the event.
There is a way to solve this. Make the messages being send to the religion owner in the turn of the player that started the religion.
Or we can forget this is make real-life religions like the ones you suggested a while ago. But we still have to figure out how save its names.

1) There is still a loop in the "Do want to convert" message that you get when a city of yours is converted to another religion. Can you check this. I just cant see/fix these loops

EDIT: Thanks martin, I had no idea of this unit.valid. I only had eyes to the functions when i looked for a valid unit test. That will help us a lot.
__________________
"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; September 7, 2002 at 07:44.
Pedrunn is offline  
Old September 7, 2002, 10:54   #81
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
Pedrunn, look at this again taken from your code more closely and your ignorance will be gone in seconds
Code:
while(i < ReligiousSettler.# && sucess == 0) { 
		GetArmyFromUnit(tmpUnit, tmpArmy);
		if(!ArmyIsValid(tmpArmy)) {
			ReligiousSettler[i] = tmpUnit;
			SettlerReligion[i] = tmpReligion;
			sucess = 1;
		}
		i = i + 1;
	}
}
What does it do? It overwrites every single part of the array with the same values. What you actually wanted to do is to test if the unit in the religioussettler array was valid. Well, my code worked for that but thanks to martin, it's even easier!
mapfi is offline  
Old September 7, 2002, 11:18   #82
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
Here's the update to the code - I'll just post the slic this time. Thanks to Martin who pointed the unit.valid thing out, the settler stuff works just perfectly now. I also corrected some other small bug in a for-loop. I tested all possible situations with settlers and I'm sure that it works as intended now.
The LogRegardEvent however, is the last debugslic=yes error and still gives me the wrong type of argument and even freezes my machine again. I've talked to Peter about this and he doesn't have the problems on his machine. So I find it particularly nice of him that he offered me his computer...

The strange thing is, I've played with Dale's AOM which has the new diplomod which just uses this function and I didn't get one error. Furthermore, if you look at some previous post the problem I had with PlayerCityCount seems to be the same. That's solved now after Pedrunn had the code. Pedrunn, what did you do? I can't pinpoint it, but that'll probably be the solution, I hope...
(so the LogRegard is disabled in the slic - I'd be happy if some people could activate it and try it out on their system)
Attached Files:
File Type: slc religion8.slc (18.8 KB, 4 views)
mapfi is offline  
Old September 7, 2002, 11:24   #83
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
Pedrunn, the two other things you mentioned:
I can't find a loop in the doyouwantconvert messages. Are you sure? Didn't it display several times because the ai player was actually converting more than one city during his turn?

As for the player[0] stuff, i'm sorry I made a terrible comment
Seriously, I don't like the solutionwe got now either but it's just not working out. Either SLIC would need a string variable for that, or the player array would have to be accessible for numbers over 0 anytime. Maybe if we just asked activision to do a patch...
mapfi is offline  
Old September 7, 2002, 15:14   #84
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
The LogRegardEvent however, is the last debugslic=yes error and still gives me the wrong type of argument and even freezes my machine again. I've talked to Peter about this and he doesn't have the problems on his machine. So I find it particularly nice of him that he offered me his computer...
I get the same messages you do with LogRegardEvent with DebugSlic = Yes but my PC doesnt freezes. I will test if at least the regard is given if the DebugSlic = No.
Does the game crashs with DebugSlic = No.

Quote:
Originally posted by mapfi
if you look at some previous post the problem I had with PlayerCityCount seems to be the same. That's solved now after Pedrunn had the code. Pedrunn, what did you do? I can't pinpoint it, but that'll probably be the solution, I hope..
This is a coding secret
(*If i had at least once tried to fix this but no clue what he is talking bout )

Quote:
Originally posted by mapfi
Pedrunn, the two other things you mentioned:
I can't find a loop in the doyouwantconvert messages. Are you sure? Didn't it display several times because the ai player was actually converting more than one city during his turn?
I will test this again then.

Quote:
Originally posted by mapfi
As for the player[0] stuff, i'm sorry I made a terrible comment
Seriously, I don't like the solutionwe got now either but it's just not working out. Either SLIC would need a string variable for that, or the player array would have to be accessible for numbers over 0 anytime. Maybe if we just asked activision to do a patch...
But i still dont see another solution
Even if we are going to use real-life religion i dont nave any idea on how to make the correct religion name appear appear in the messages too. I feel tied up.

PS: I willl check your new the code now.
__________________
"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 September 7, 2002, 16:23   #85
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:
(*If i had at least once tried to fix this but no clue what he is talking bout )
I guess it'll remain a mistery...

DebugSlic = No results in the game running properly but I don't think the regard is give then. If I compare our code to the new Diplomod, the only difference I see is that we use an int as an argument instead of a value of the player array. But we we're talking about this before and didn't find a solution for our code...
mapfi is offline  
Old September 8, 2002, 01:51   #86
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
Here is the pre-9 version of the code (will wait your editing to turn it to 9).

Additions:

1) Religious Info Messages fixed using the player who started a religion to send the message to those with this starting religion.
player[0] is the variable of the message for the religion. and for the religion level the variable is ReligionLevel.

2) Religion variable for the message for the Do You Want to Convert fixed by changing the event from ConvertCityUnit(unit_t, city_t) to ConvertCity(city_t, int_t, int_t). The variable for the religion in the message is player[0]. Note: I had to add a new int_t variable (ReligionCodeConversion) to prevent messages to pop up every time the code uses the event ConvertCity (wich arent few!!!)

3) Another message added to the Reformation Event to better explain the player who is reforming what happens. In this case i added a message telling him that the city has the same religion as the player so he cant reform.

3) Prevent a human player to convert cities with same religion of yours.

4) AI dealing better with the religion: If he tries to convert a city with same religion of yours he actually tries to Sell Indulgences. And if he tries to sell indulgences to a city with religion different of your he tries to convert it first.

5) Reformation decreases happiness in the city.

6) Tested LogRegard Event and it does work so i left it in the code.

7) Better organization of the code. May look odd at first but i think it is better. According to order: New Functions --> Events --> messages.

Comments:
--> I cant think of nothing else to improve the code so far except adding more info to the religios info (happy mod of religion, number of players with it, etc...). I think we are one step to release this code.
--> Lets define wich numbers we will use after all for the (my suggestion):
- NewReformCost - (CityReligionLevel*cityPop*10);
- AI chance of Reforming - (PlayerGold = 4*reformCost) and (PlayerRelLevel > CityRelLevel/3)
- AI chance of Converting- (ConvertorReligionLevel = 3*ConvertedReligonLevel)
- HappyMod - (see code)
- Sell Indulgences money - (theTenth = city[0].population*3)(theTenth = city[0].population/2)
- Every Turn Money ( 3*gold per citypop of converted city of non converted cities / players with this religion
- Regard - Same Religion + 5, different religion - 2
Non-slic changes:


--> Messages: Those messages i PMed you are fine for this code. Just some minor changes

--> Increase to the max of possible the values for the GOAL_CONVERT_CITY, GOAL_REFORM and GOAL_SELL_INDULGENCES. The slic make the calculation it it should or shouldnt do this goal and how.

--> ORDER_REFORM does not cost gold or movement those have to be set to 0.

--> Sell Indulgences also cant give money (const.txt)

--> Tomorrow i will make the different clerics for theocratics and non-theocratics govs.

I think that is all.
Attached Files:
File Type: slc religion9.slc (19.5 KB, 5 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 September 10, 2002, 01:45   #87
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
Mapfi, I guess you are too busywith the hidden nationality slic. So since we are pretty much done here i will make the code a mod with expansions for the Apolyton Pack and GoodMod and submit to the database. .
The readme is what is going to take me more time though.
__________________
"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 September 10, 2002, 02:09   #88
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, I was playing with that recently - submitting it to the directory? If everything works - ok. I'd rather release a beta in this thread before though, so some people might try it out before we put it onto the file server. Only to avoid several fixes after such a release.
And if the last post is still the most up-to-day version I'll look into tonight, I already got in on my computer.
mapfi is offline  
Old September 10, 2002, 15:48   #89
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
I did try the code out and it failed. There's now something wrong in the doyouwanttoconvert stuff I'm sure. Sorry for not having more time to look into it. If you however have time to pack it up I'll do a playtest this week and as I see it I'd still rather reword and correct part of those messages. I'm trying not even to mention this logregard thinigie!
As for the values - depends on the experience in a full game and people's likings.
mapfi is offline  
Old September 26, 2002, 13:53   #90
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
saving this from page 2 or I'll never find it again...

Pedrunn, I'm working on this again. Checked half of the code on my last train ride. Besides some small mistakes I'll also rewrite the variable names a little - use some systematic naming. I'd be happy if you could PM or mail me the strings again as I seem to have totally outdated ones...
I'll give you a updated version of this thing within the next few days.
By the way, are you planning to use this in your hopefully-soon-to-be-released mod?
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