1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Python question for mod community

Discussion in 'Civ4 - Creation & Customization' started by cemason, Jan 20, 2007.

  1. cemason

    cemason Chieftain

    Dec 28, 2005
    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!

  2. Gaurav

    Gaurav Prince

    May 14, 2006
    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.

Share This Page