Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization

Notices

Reply
 
Thread Tools
Old Jun 19, 2007, 04:29 PM   #1
Davinci Fan
Chieftain
 
Join Date: Jun 2007
Posts: 86
Units require resource proximity...

I was wondering if there was a way to require that a resource be directly nearby a city before that city can build a certain unit. I want to stress that the resource does not need to be exploited at the moment, it just needs to show up in the city management screen. Is this possible?
Davinci Fan is offline   Reply With Quote
Old Jun 19, 2007, 07:02 PM   #2
EmperorFool
Deity
 
EmperorFool's Avatar
 
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
It looks like this would be possible with some Python programming. There is a function in CvGameUtils.py that seems promising.

Code:
def cannotTrain(self,argsList):
	pCity = argsList[0]
	eUnit = argsList[1]
	bContinue = argsList[2]
	bTestVisible = argsList[3]
	return False
I have no idea what bContine nor bTestVisible (true/false boolean values) mean, but I suppose you could start by ignoring them. Given pCity, you can examine the plots around the city for the resource.

I'm not sure what you mean by "the resource does not need to be exploited" as that implies, for example, no need for a mine on an Iron resource, but that would then imply that the resource does not show up in the city screen, but you contradict this, saying "it just needs to show up in the city management screen."

Do you mean that you want the resource to show in the city screen even without a mine built? Or have I misunderstood your requirements?

Changing what makes the city think that it has access to a resource may be more difficult and involve C++ coding (SDK).

For example, I don't know if the game will call the above cannotTrain() function for Swordsman if the city doesn't already have Iron present. The function above implies that you can only override what the game already thinks it can do. You can't tell it that it can train Swordsman if it doesn't already believe it can. Does that make sense?

Finally, I don't know whether or not the game calls this function for the AI or only the human. Others may have experience with this part.
EmperorFool is offline   Reply With Quote
Old Jun 19, 2007, 09:39 PM   #3
Davinci Fan
Chieftain
 
Join Date: Jun 2007
Posts: 86
What I mean by not exploited:

When you double-click on the city, the city management screen shows up with the 'fat cross.' All I want is that the resource square show up in that cross - regardless of whether or not there is a mine or farm or what have you. In order for the city to be able to build that unit.

What I envision on the whole:

Some optional XML tag in the unit entry that lists a proximity resource requirement.

Some Python code that checks for that resource for cities and restricts that unit to cities with that resource.
Davinci Fan is offline   Reply With Quote
Old Jun 19, 2007, 09:48 PM   #4
EmperorFool
Deity
 
EmperorFool's Avatar
 
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
I think I understand what you're saying. Taking the example of a Swordsman, marked to require Iron (as it does) in the city square, regardless of having a mine.

1. You don't have Iron Working, so no cities can train Swordsman.

2. You research Iron Working and a source of Iron appears inside the fat cross of city X. That city only should immediately be able to start building Swordsman, correct?

3. You build a mine on the Iron. Can other cities start building Swordsman now? Or do resources only supply the city in whose fat cross(es) they appear?

4. If two cities' fat crosses overlap, placing Iron inside both cities, can they both train Swordsman? Only one city can "work" that tile to get the food/hammers/commerce. Does the availability of resources work the same way?

My guess is that this would require C++ programming. You are changing the rules that make resources available to cities. That means SDK programming beyond the XML tags. As well, I think you need to do SDK programming to add the existence of the XML tag, too.

I know enough to make the educated guess that the above is correct but not enough of the SDK to do the work. Some others here do have that knowledge. Good luck!
EmperorFool is offline   Reply With Quote
Old Jun 19, 2007, 10:14 PM   #5
Davinci Fan
Chieftain
 
Join Date: Jun 2007
Posts: 86
What I plan to do is define a few new resources, so though your analysis is largely correct, there is a small discrepancy with respect to 3. Swordsman requires that the civilization have access to iron, but that the city have access to resource X. I am not familiar with the SDK, so if possible I want to get this done in py.

What I would like to do: The game checks at the beginning of each turn for which cities possess which of these resources and assigns a certain integer (0 through 25) to a variable. The GameUtil checks what each city's variable is when it calls the cannotTrain function and returns accordingly.

Would this work, and more importantly, would it work quickly enough?
Davinci Fan is offline   Reply With Quote
Old Jun 20, 2007, 01:37 AM   #6
Primax
CivPlayers Modder
 
Join Date: Jul 2006
Location: Australia
Posts: 73
If you just want to create a few new resources and allow units to be created if the city has axs to that resource it can all be done in XML.

If on the other hand as I understand it you mean if the new resource is in the cities fat cross but not hooked up by road. (this would also mean that an other city could not build that unit even if hooked to original city via road) than I think this could be done in XML (for new resource and new units requiring it) and python.

This would check if the bonus is connected via a road (could be in another city not necessarily in the fatcross) and is from cycity.

BOOL hasBonus(BonusType iBonus)
bool - (BonusID) - is BonusID connected to the city?

this gets the bonus from a plot and is from cyplot:

BonusType getBonusType(TeamType eTeam)
int (int /*TeamTypes*/ eTeam)

this one returns if plot is within city radius:

INT isCityRadius()
int ()

this tells you if it could be worked (which could be usefull?)
BOOL isPotentialCityWork()
bool ()

I would think you would have to use a function that gives you the fat cross boundary then searches thru all plots in that area with the cyplot getBonusType function looking for the bonus. this will end up giving you a true/false result. which you would use in conjunction with the cannot train function.

Last edited by Primax; Jun 20, 2007 at 02:09 AM.
Primax is offline   Reply With Quote
Old Jun 20, 2007, 08:52 AM   #7
Zebra 9
Emperor
 
Zebra 9's Avatar
 
Join Date: May 2006
Location: Middle of Cyberspace
Posts: 1,554
This is possible from the python function EmperorFool told you about above. Like he said check the plots in the fat cross (I think you would also want to make sure that they are inside of the players culuture). Then if they have the resoure in the borders return False, otherwise True.

bContinue is true if the city is already building the unit and it is checking if you can still build the unit in that city. I'm going to check the SDK to see what bTestVisible is.
__________________
I'm Updating My MOD COMPs

Zebra 9 is offline   Reply With Quote
Old Jun 21, 2007, 04:45 PM   #8
Zebra 9
Emperor
 
Zebra 9's Avatar
 
Join Date: May 2006
Location: Middle of Cyberspace
Posts: 1,554
bTestVisible when false appears to be checking if the city has the correct buildings and resources, if true it doesn't check this.
__________________
I'm Updating My MOD COMPs

Zebra 9 is offline   Reply With Quote
Old Jun 22, 2007, 06:32 AM   #9
Davinci Fan
Chieftain
 
Join Date: Jun 2007
Posts: 86
Thanks Zebra. Do you have any suggestions for how to go about coding this, like how to add an XML tag or run a check of city plots?
Davinci Fan is offline   Reply With Quote
Old Jun 22, 2007, 06:06 PM   #10
Zebra 9
Emperor
 
Zebra 9's Avatar
 
Join Date: May 2006
Location: Middle of Cyberspace
Posts: 1,554
Unfortunatly we can't add any XML tags from python (Yet, maybe w/ BtS, you could try using a INI config), to check plots I use a small script that looks like:
Code:
		for iX in range(x-1, x+2, 1):
			for iY in range(y-1, y+2, 1):
				pPlot = CyMap().plot(iX,iY)
so when you add this to CvGameUtils.py it will look like:
Code:
def cannotTrain(self,argsList):
	pCity = argsList[0]
	eUnit = argsList[1]
	bContinue = argsList[2]
	bTestVisible = argsList[3]

	x = pCity.getX()
	y = pCity.getY()
	for iX in range(x-1, x+2, 1):
		for iY in range(y-1, y+2, 1):
			pPlot = CyMap().plot(iX,iY)

	return False
then to find the resource you want you need to check if the plot is owned by the cities owner and if it has the resource on it. The code for this is:
Code:
def cannotTrain(self,argsList):
	pCity = argsList[0]
	eUnit = argsList[1]
	bContinue = argsList[2]
	bTestVisible = argsList[3]

	x = pCity.getX()
	y = pCity.getY()

	bFoundCopper = False	## Have we found the resource

	if eUnit == gc.getInfoTypeForString("UNIT_AXEMAN"):	## Is it a unit that require resource proximity
		for iX in range(x-1, x+2, 1):
			for iY in range(y-1, y+2, 1):
				pPlot = CyMap().plot(iX,iY)
				if pPlot.getOwner() == pCity.getOwner():	## Is the plot owner the same as the city owner
					if pPlot.getBonusType(pCity.getOwner()) == gc.getInfoTypeForString("BONUS_COPPER"):	## Check for the resource
						bFoundCopper = True	## We found copper
		if bFoundCopper == False:
			return True	## We didn't find the copper so tell the SDK not to let this city build the unit

	return False
That should work.
__________________
I'm Updating My MOD COMPs

Zebra 9 is offline   Reply With Quote
Old Jun 22, 2007, 07:05 PM   #11
EmperorFool
Deity
 
EmperorFool's Avatar
 
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
Here's a class that packages up the functionality. Warning: not tested.

Save this file next to CvGameUtils.py as UnitExtraResources.py:

Code:
# UnitExtraResources
#
# Holds a set of extra resource requirements for units.
# The resource only must exist somewhere in a city's fat cross.

from CvPythonExtensions import *

gc = CyGlobalContext()

class UnitExtraResources():

    def __init__(self):
        # Maps { unit type -> bonus type }
        self.unitMap = {}

    def add(self, eUnit, eBonus):
        """Adds the bonus as a requirement for the unit type.

        Only one bonus for each unit type is allowed -- duplicates overwrite previous values.

        e.g. add(gc.getInfoTypeForString("UNIT_SWORDSMAN"), gc.getInfoTypeForString("BONUS_WHEAT"))
        """
        self.unitMap[eUnit] = eBonus

    def remove(self, eUnit):
        if (self.unitMap.has_key(eUnit)):
            del self.unitMap[eUnit]

    def get(self, eUnit):
        if (self.unitMap.has_key(eUnit)):
            return self.unitMap[eUnit]
        
        return -1

    def hasBonus(self, pCity, eUnit):
        if (not self.unitMap.has_key(eUnit)):
            return True
        
        map = CyMap()
        cityX = pCity.getX()
        cityY = pCity.getY()
        cityOwner = pCity.getOwner()
        eBonus = self.unitMap[eUnit]
        for x in range(-2, 2):
            for y in range(-2, +2):
                if ((x == -2 or x == 2) and (y == -2 or y == 2)):
                    # skip corners of square to make fat cross
                    continue
                
                pPlot = map.plot(cityX + x, cityY + y)
                if (pPlot.getOwner() == cityOwner and pPlot.getBonusType() == eBonus):
                    return True
        
        # Bonus not found
        return false
To use it, add these parts to CvGameUtils.py:

Code:
...

import CvUtil
import UnitExtraResources # add this line

...

class CvGameUtils:
	"Miscellaneous game functions"
	def __init__(self): 
		# replace the line that says "pass" with this
		self.extras = UnitExtraResources.UnitExtraResources()
		self.extras.add(gc.getInfoTypeForString("UNIT_SWORDSMAN"), gc.getInfoTypeForString("BONUS_WHEAT"))

...

	def cannotTrain(self,argsList):
		pCity = argsList[0]
		eUnit = argsList[1]
		bContinue = argsList[2]
		bTestVisible = argsList[3]
		return not self.extras.hasBonus(pCity, eUnit) # change this line

...
This class allows you to add resource requirements for more than one unit, but only one extra bonus per unit. It also ignores what plots each city is actually working which I assume is what you wanted (you didn't answer my question above about two cities with the same plot in their fat crosses).

Another caveat is that this goes off of units -- not unit classes. Thus, adding the above wheat requirement for Swordsman won't affect Praetorians. It would be easy to change this, so let me know.
EmperorFool is offline   Reply With Quote
Old Jun 23, 2007, 12:07 AM   #12
Davinci Fan
Chieftain
 
Join Date: Jun 2007
Posts: 86
Thanks

I will be the first to admit that I am not the best at python - finding ideas for changing the rules is more my style than implementing them - but I think I get what this does.

I have a couple things to clear up and a couple questions:

Regarding whether multiple cities benefit from the same square or not: I would like it if they could share. This seems to be the case, so that is not a problem.

Going off of units is perfect for my mod.

Questions: Is it possible to modify it so that a unit can require two resources?

Please tell me if I would be using the script correctly if I did the following:

Code:
def __init__(self): 
		# replace the line that says "pass" with this
		self.extras = UnitExtraResources.UnitExtraResources()
		self.extras.add(gc.getInfoTypeForString("UNIT_SWORDSMAN"), gc.getInfoTypeForString("BONUS_WHEAT"))
		self.extras.add(gc.getInfoTypeForString("UNIT_WARRIOR"), gc.getInfoTypeForString("BONUS_COAL"))
		self.extras.add(gc.getInfoTypeForString("UNIT_ARCHER"), gc.getInfoTypeForString("BONUS_OIL"))
Obviously this is an example; requiring coal for warriors and oil for archers is silly. I just want to know if this is the way to go about it.
Davinci Fan is offline   Reply With Quote
Old Jun 23, 2007, 11:36 AM   #13
EmperorFool
Deity
 
EmperorFool's Avatar
 
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
Yes, you're using it correctly in your example. It would certainly be doable to change it to allow multiple resources per unit. Let me take a poke at it (I'm learning Python, too) and repost what I come up with.

It would be cool if you could test what's here to see if a) it works at all and b) if performance is acceptable. It's easier to fix problems when you make small steps.
EmperorFool is offline   Reply With Quote
Old Jun 23, 2007, 12:08 PM   #14
EmperorFool
Deity
 
EmperorFool's Avatar
 
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
Updated code

Okay, I've changed the class to allow multiple bonuses per unit. I've also removed the get() and remove() functions as they're really not necessary. If you find you need them, I can update them to work with the new class.

Code:
# UnitExtraResources
#
# Holds a set of extra resource requirements for units.
# The resource only must exist somewhere in a city's fat cross
# and be inside the player's cultural borders.

from CvPythonExtensions import *

gc = CyGlobalContext()

class UnitExtraResources():

    def __init__(self):
        # Maps { unit type -> [ bonus types ] }
        self.unitMap = {}

    def add(self, eUnit, eBonus):
        """
        Adds the bonus as a requirement for the unit type.

        Multiple bonuses for each unit type are allowed.

        e.g. add(gc.getInfoTypeForString("UNIT_SWORDSMAN"), gc.getInfoTypeForString("BONUS_WHEAT"))
        """
        if (self.unitMap.has_key(eUnit)):
            # add bonus to list
            self.unitMap[eUnit].append(eBonus)
        else:
            # create singleton list
            self.unitMap[eUnit] = [eBonus]

    def hasBonuses(self, pCity, eUnit):
        """
        Check the given city radius for all the bonuses required by the given unit type.

        Returns True only if all bonuses are found somewhere in the owned fat cross plots.
        """
        if (not self.unitMap.has_key(eUnit)):
            return True
        
        map = CyMap()
        cityX = pCity.getX()
        cityY = pCity.getY()
        cityOwner = pCity.getOwner()
        
        bonuses = self.unitMap[eUnit]
        bonusCount = len(bonuses)
        foundCount = 0
        # create temporary map of { bonus type -> found it yet? }
        foundMap = {}
        for eBonus in bonuses:
            foundMap[eBonus] = False
        
        for x in range(-2, 2):
            for y in range(-2, +2):
                if ((x == -2 or x == 2) and (y == -2 or y == 2)):
                    # skip corners of square to make fat cross
                    continue
                
                pPlot = map.plot(cityX + x, cityY + y)
                if (pPlot.getOwner() != cityOwner):
                    continue
                
                eBonus = pPlot.getBonusType()
                if (bonusMap.has_key(eBonus) and not bonusMap[eBonus]):
                    # found a plot with one of the needed bonuses that we haven't found yet
                    bonusMap[eBonus] = True
                    foundCount += 1
                    if (foundCount >= bonusCount):
                        # found all needed bonuses
                        return True
        
        # at least one bonus not found
        return false
You use it the same way, just call add() with the same unit type once for each bonus. Note also that I changed the checking method to "hasBonuses" to make it clear that it checks for all bonuses.

I've tried to comment more than I usually would. Feel free to ask questions as I enjoy teaching others to code and it helps me get better at Python (new language for me).
EmperorFool is offline   Reply With Quote
Old Jun 23, 2007, 12:26 PM   #15
Davinci Fan
Chieftain
 
Join Date: Jun 2007
Posts: 86
Odd bug: Following your instructions, when the import line is added, the GUI disappears (I only see the units and terrain); when I take out that line, the game works, but the mod does nothing.
Davinci Fan is offline   Reply With Quote
Old Jun 23, 2007, 12:36 PM   #16
Davinci Fan
Chieftain
 
Join Date: Jun 2007
Posts: 86
couple questions on coding in general:

What does the 'from CvPythonExtensions import' line do? I see stuff like import in all kinds of code.

is the 'gc = CyGlobalContext()' defining a variable named gc?
Davinci Fan is offline   Reply With Quote
Old Jun 23, 2007, 12:58 PM   #17
Sto
Should i code today ...
 
Sto's Avatar
 
Join Date: Dec 2005
Location: Marseille (France)
Posts: 1,137
I've done some changes for the fun , here the EmperorFool code with also some fix that may create bugs . Perhaps , a mix of the two would be great (not tested):

Code:
    def add(self, eUnit, lBonus):
	"""Adds the bonus as a requirement for the unit type.

	For one bonus
	e.g. add(gc.getInfoTypeForString("UNIT_SWORDSMAN"), [ gc.getInfoTypeForString("BONUS_WHEAT") ])

	For more than one bonus
	e.g. add(gc.getInfoTypeForString("UNIT_SWORDSMAN"), [ gc.getInfoTypeForString("BONUS_WHEAT"), gc.getInfoTypeForString("BONUS_OIL") ])
	"""
	self.unitMap[eUnit] = lBonus

    def hasBonus(self, pCity, eUnit):
	if (not self.unitMap.has_key(eUnit)):
	    return True
	

	# check if the city is valid , sometimes the city plot is not valid
	if pCity.isNone() : return False

	map = CyMap()
	iW = map.getGridWidth()
	iH = map.getGridHeight()

	cityX = pCity.getX()
	cityY = pCity.getY()
	cityOwner = pCity.getOwner()

	for eBonus in self.unitMap[eUnit]:
            bTest = False                        
            for x in range(-2, 2):
                for y in range(-2, +2):
                    if ((x == -2 or x == 2) and (y == -2 or y == 2)):
                        # skip corners of square to make fat cross
                        continue

                    iX = cityX + x
                    iY = cityY + y

                    # adapt the coordinates if the map is WrapX or WrapY
                    if map.isWrapX() : iX = iX % iW
                    if map.isWrapY() : iY = iY % iH
                    
                    pPlot = map.plot( iX , iY )

                    # check if the plot is valid ( invalid plot or plot outside the map in case of a city close to a border )
                    if pPlot.isNone() : continue
                    
                    if (pPlot.getOwner() == cityOwner and pPlot.getBonusType() == eBonus):
                        bTest = True

            # if the bonus is not found in the city cross , return False
            if not bTest : return False
            
	# All Bonus found
	return True
Tcho !
__________________
Sometimes it is better to remain silent and be thought a fool, than to speak and remove all doubt. ... Gustave Parking .
Sto is offline   Reply With Quote
Old Jun 23, 2007, 01:48 PM   #18
Sto
Should i code today ...
 
Sto's Avatar
 
Join Date: Dec 2005
Location: Marseille (France)
Posts: 1,137
Quote:
Originally Posted by Davinci Fan View Post
What does the 'from CvPythonExtensions import' line do? I see stuff like import in all kinds of code
import a lot of things , especially all the variable type define in civ4 , plotType etc ...

Quote:
Originally Posted by Davinci Fan View Post
is the 'gc = CyGlobalContext()' defining a variable named gc?
CyGlobalContext() is the python module that retrieve xml value . As it is always used , gc is a global variable that can be used all over the functions without being redefined .

To check if there is a bug , you need to enable the python debugger . Go to Civilization4.ini and put "HidePythonExceptions = 0" and you will have a pop up when you get a bug .

If there is no bug , can you post your modified files to check what happened ?

Tcho !
__________________
Sometimes it is better to remain silent and be thought a fool, than to speak and remove all doubt. ... Gustave Parking .
Sto is offline   Reply With Quote
Old Jun 23, 2007, 02:15 PM   #19
EmperorFool
Deity
 
EmperorFool's Avatar
 
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
Good point about wrapping x/y, Sto. I see so much code that ignores that that I assumed the game handled it for you. I'll check the SDK when I've got more energy to verify.

Here's the modified version that handles multiple bonus types and fixes quite a few bugs. Yes, I actually tested it this time to get you started. I know it can be frustrating waiting for replies.

Code:
# UnitExtraResources
#
# Holds a set of extra resource requirements for units.
# The resource only must exist somewhere in a city's fat cross
# and be inside the player's cultural borders.

from CvPythonExtensions import *

gc = CyGlobalContext()

class UnitExtraResources:

    def __init__(self):
        # Maps { unit type -> [ bonus types ] }
        self.unitMap = {}

    def add(self, eUnit, eBonus):
        """
        Adds the bonus as a requirement for the unit type.

        Multiple bonuses for each unit type are allowed.

        e.g. add(gc.getInfoTypeForString("UNIT_SWORDSMAN"), gc.getInfoTypeForString("BONUS_WHEAT"))
        """
        if (self.unitMap.has_key(eUnit)):
            # add bonus to list
            self.unitMap[eUnit].append(eBonus)
        else:
            # create singleton list
            self.unitMap[eUnit] = [eBonus]

    def hasBonuses(self, pCity, eUnit):
        """
        Check the given city radius for all the bonuses required by the given unit type.

        Returns True only if all bonuses are found somewhere in the owned fat cross plots.
        """
        if (not self.unitMap.has_key(eUnit)):
            return True
        
        map = CyMap()
        cityX = pCity.getX()
        cityY = pCity.getY()
        cityOwner = pCity.getOwner()
        eTeam = pCity.getTeam()
        
        bonuses = self.unitMap[eUnit]
        bonusCount = len(bonuses)
        foundCount = 0
        # create temporary map of { bonus type -> found it yet? }
        foundMap = {}
        for eBonus in bonuses:
            foundMap[eBonus] = False
        
#        self.debug("City @ %d, %d" %(cityX, cityY))
        for x in range(-2, 3):
            for y in range(-2, 3):
                if ((x == -2 or x == 2) and (y == -2 or y == 2)):
                    # skip corners of square to make fat cross
#                    self.debug("Corner: %d, %d" %(x, y))
                    continue
                
                pPlot = map.plot(cityX + x, cityY + y)
                if (pPlot.getOwner() != cityOwner):
#                    self.debug("Not owned: %d, %d" %(x, y))
                    continue
                
                eBonus = pPlot.getBonusType(eTeam)
                if (foundMap.has_key(eBonus) and not foundMap[eBonus]):
                    # found a plot with one of the needed bonuses that we haven't found yet
                    foundMap[eBonus] = True
                    foundCount += 1
#                    self.debug("Found bonus %d (%d of %d)" %(eBonus, foundCount, bonusCount))
                    if (foundCount >= bonusCount):
                        # found all needed bonuses
                        return True
        
        # at least one bonus not found
#        self.debug("Missing %d bonus(es)" %(bonusCount - foundCount))
        return false

    def debug(self, message):
        CyInterface().addMessage(CyGame().getActivePlayer(), True, 10, message, "", 2, None, ColorTypes(8), 0, 0, False, False)
About imports. Each file defines its own variables and classes and functions. When you want file X to use something from file Y you must import file Y. You can import all or part of it, and give it a local name if you want. You'd need to read up on Python for more details. The tutorial at www.python.org is okay.

As Sto said, gc is a global variable that gives you access to all sorts of handy data about the game. You may notice that I didn't even use it in my file.

I noticed that the function gets called 3 times per unit. I assume it's calling with different values of the two boolean flags.
EmperorFool is offline   Reply With Quote
Old Jun 23, 2007, 04:30 PM   #20
Sto
Should i code today ...
 
Sto's Avatar
 
Join Date: Dec 2005
Location: Marseille (France)
Posts: 1,137
I think the best to test your code is to start a game with wrapX and start with a city at 1 tile from the two borders ( to be on the wrap border and to have tiles that are away from the map ) . I wait for your feed back on this . i've just check the SDK and don't understand where this is located .

Tcho !
__________________
Sometimes it is better to remain silent and be thought a fool, than to speak and remove all doubt. ... Gustave Parking .
Sto is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Units require resource proximity...

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Require assistance in adding units Static0437 Civ4 - Creation & Customization 0 Mar 03, 2008 06:54 PM
GUNPOWDER doesn't require a resource??? Ravinhood Civ4 - General Discussions 18 Nov 05, 2005 08:22 AM
Potential mod: units require population TheDS Civ3 - Creation & Customization 7 Feb 05, 2005 07:32 AM
Edit Units to not Require Resources? sourboy Civ3 - Creation & Customization 1 Feb 18, 2004 09:23 PM
Why the Request: Units Require Improvements? yoshi Civ3 Conquests - Requests, Fixes, & Changes 29 Sep 19, 2003 11:26 AM


Advertisement

All times are GMT -6. The time now is 12:01 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR