Thread Tools
Old August 22, 2001, 12:29   #1
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 09:43
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Battles shoud destroy tile Improvments.
For the first time i lost to the AI today. I am not totally dead, but my lands become a battlefield. From that game i had an idea .
Tile Improvments should be destroyed (pillaged) in a battle over them. That would add such a good and realistic feature. Does anyone know if that is possible?
__________________
"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 22, 2001, 12:57   #2
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 13:43
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Code:
HandleEvent(BattleAftermath) 'pillage' pre{
     Event:CutImprovements(location[0]);
}
Its that simlpe
Immortal Wombat is offline  
Old August 22, 2001, 13:21   #3
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 09:43
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
!!!!!!!

Thanks IW.
It is working.
__________________
"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 22, 2001 at 13:54.
Pedrunn is offline  
Old August 22, 2001, 17:55   #4
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 13:43
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
It actually works? wow, that's surprised even me!

Glad I could help, I had a bit of trouble posting earlier, but it seems to have come through ok.

Immortal Wombat is offline  
Old August 22, 2001, 19:52   #5
Kull
lifer
King
 
Local Time: 05:43
Local Date: October 31, 2010
Join Date: Mar 1999
Location: El Paso, TX USA
Posts: 1,751
That is a great idea, Pedrunn. It's very realistic, and probably should be incorporated into the new mods. Perhaps a poll is in order to gauge the depth of opinion for or against?

Wombat: Wow, talk about "Ask and ye shall receive"!
Kull is offline  
Old August 23, 2001, 09:03   #6
hexagonian
The Courts of Candle'Bre
Emperor
 
hexagonian's Avatar
 
Local Time: 07:43
Local Date: October 31, 2010
Join Date: Jun 1999
Location: Smemperor
Posts: 3,405
Can I just tack it onto the end of another one of your codes???
__________________
Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
...aisdhieort...dticcok...
hexagonian is offline  
Old August 23, 2001, 12:24   #7
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 09:43
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Unfornutelly since i got that code, Although it worked just fine through the cheat mode i am experiencing game crashs (3 times now) with the message the CTP2 caused an error on the CTP2.exe.
All the crashs happen in abut turn 40-50 wich is the time barbarians ussually appears. My theory is that the AI x Barbarians combat are causing these crashs. Did someone who got this code are experiencing this problem. I will just start a game without it. And i will keep informing.
__________________
"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 23, 2001, 12:37   #8
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 13:43
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Uh-oh It wasn't me!

I see no way that it can be, though the tile improvement functions are notoriously buggy...

Sure Dave, tack it in anywhere, it has no variables, no functions, nothing.
Immortal Wombat is offline  
Old August 23, 2001, 13:57   #9
Paulypav
Warlord
 
Paulypav's Avatar
 
Local Time: 12:43
Local Date: October 31, 2010
Join Date: Oct 2000
Location: Shirley, NY, USA
Posts: 120
Is it possible to make it a random event as well, or is it basically the tile improvement gets destroyed when there's a battle on it. I'm guessing, based on my limited knowledge that it wouldn't be possible to make it occur randomly.

Even if you could make it random you would want it heavily weighted towards destroying the improvement. Leaving a percentage chance of the improvement surviving would reflect the percentage of improvements that survive overall, as partially destroying improvements would likely take way too much work.
__________________
“The American people have now spoken, but it’s going to take a little while to determine exactly what
they said.” — President Clinton
Paulypav is offline  
Old August 24, 2001, 15:56   #10
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 09:43
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
I have just finishing figuring up what happened.
Since i was playing autosaved i went check to see if a battle really happened. The game crashed when it was the turn of the brown ones so they were the first checked.
There was a battle after all. Among a barbarian Light calvary and a Brown Spearman. But surprisily there wasnt a tile not even close to the battle .
I deleted the code and restarted the same game. I am curently at turn 70 and no sight of crashs. The Barbarians even attacked and conquered my capitol (those bastards).

I do not get it! you make a code that work to destroy tile imps. but it crashs when a regular batle happens. Yet everything works fine through Cheat Mode.
I did not get a good conclusion. And i hope someone did played this code. I want to know if it is just me (since my CTP2 is tottally full of others codes) or this did it happen with someone else.
__________________
"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 24, 2001, 16:35   #11
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 13:43
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Oops, this is the exact same problem that crashed the original natural disaster codes
It works fine when there is a tile imp, because it can remove it. When there is not a tile imp, there is nothing to remove, and the game crashes.
Take 2:
Code:
HandleEvent(BattleAftermath) 'pillage' pre {
        int_t  i;
        for(i = 0; i < 24; i = i + 1){
               if(TileHasImprovement(location[0], i)){
                       Event:CutImprovements(location[0]);
               }
        }
}
Immortal Wombat is offline  
Old August 25, 2001, 00:16   #12
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 09:43
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Thanks again IW i will try a new game now.
And to think that i was going to give uo of this great idea :
wish me good luck!
__________________
"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 25, 2001, 09:37   #13
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 09:43
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
I started the new game and i am almost at turn 100. I got some battles with the barbs and they worked fine. No crash. Although none of them were over tile imps. But they did get destroyed through the cheat mode.
I think it is all ok now. Great Job IW.
__________________
"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 25, 2001, 12:00   #14
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: 14:43
Local Date: October 31, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
Quote:
Originally posted by Paulypav
Is it possible to make it a random event as well, or is it basically the tile improvement gets destroyed when there's a battle on it. I'm guessing, based on my limited knowledge that it wouldn't be possible to make it occur randomly.
This code should make it possible:

Code:
HandleEvent(BattleAftermath) 'pillage' pre {
	int_t  i;
	if (Random(6) > 0) {
		for(i = 0; i < 24; i = i + 1){
			if(TileHasImprovement(location[0], i)){
				Event:CutImprovements(location[0]);
			}
		}
	}
}
This code should give you a change one seventh that your tile improvement will survive the battle.

-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
Martin Gühmann is offline  
Old August 26, 2001, 23:02   #15
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 09:43
Local Date: October 31, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
Quote:
Originally posted by Martin Gühmann

This code should give you a change one seventh that your tile improvement will survive the battle.

-Martin
It just keeps getting better and better.
__________________
"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  
 

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 08:43.


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