• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Python question for mod community

cemason

Chieftain
Joined
Dec 28, 2005
Messages
34
Hello and thanks in advance to anyone that can help!

I'm in the progress of making a simple mod for Civ 4 Warlords and I'm trying to get a few more things done but can't figure them out from the available API. So here's a few questions to see if anyone knows the answer:

1. CyPlot() has a setRevealed(...) function that shows what terrtain lies below the black on a map. So, if I want to reveal a city I can use CyCity().getX() and getY() and call CyMap().sPlot() to get the plot of the city and nearby tiles, then using setRevealed I can have a player have the area viewable. The problem is this isn't exactly what I would like. It doesn't remove the fog of war, like how an enemy city is viewable when he has your religion in his city. Does anyone know of a way to remove fog of war, like how having religions in a city allows you to see the city?

2. Is there a way to direct AI to go after a particular city using python? Perhaps someone knows of how to use CvGameUtils or even CyPlayer to do this?

Like I said earlier, thank you for any help you can give!

-cemason
 
Hello and thanks in advance to anyone that can help!

I'm in the progress of making a simple mod for Civ 4 Warlords and I'm trying to get a few more things done but can't figure them out from the available API. So here's a few questions to see if anyone knows the answer:

1. CyPlot() has a setRevealed(...) function that shows what terrtain lies below the black on a map. So, if I want to reveal a city I can use CyCity().getX() and getY() and call CyMap().sPlot() to get the plot of the city and nearby tiles, then using setRevealed I can have a player have the area viewable. The problem is this isn't exactly what I would like. It doesn't remove the fog of war, like how an enemy city is viewable when he has your religion in his city. Does anyone know of a way to remove fog of war, like how having religions in a city allows you to see the city?

2. Is there a way to direct AI to go after a particular city using python? Perhaps someone knows of how to use CvGameUtils or even CyPlayer to do this?

Like I said earlier, thank you for any help you can give!

-cemason

Wrong forum.

#1: The easiest way I found is to place a unit there temporarily each turn and immediately delete it.

#2: There are overrides for the AI in python, but this pretty much requires you to replace the entire AI with your own python code. As a result, most people modding the AI are doing it from the C++. Talk to the guys in the "Better AI" thread if you are interested in that.
 
Back
Top Bottom