- deleted content -

I tried the second part, it didn't seem to work...

When i went looking for the original civ files, the folder was empty.

My computer shows hidden folders and files
 
I tried the second part, it didn't seem to work...

When i went looking for the original civ files, the folder was empty.

My computer shows hidden folders and files


If you look in Documents/My games. Beyond the Sword/Assets thhen it isnt there. For my BTS atleast, theres two foders, one in documents and one in computer. Do the one in computer

Also it needs to say exactly:
CIVILIZATION_MALI
if it says that exactly it will work
 
I replaced LIBYA with MALI. but **** it doesnt work... but i found the other civs files, i first had to go through application data...

Can i go into the original files and just take Libya civ info and paste it in there?
 
I replaced LIBYA with MALI. but **** it doesnt work... but i found the other civs files, i first had to go through application data...

Can i go into the original files and just take Libya civ info and paste it in there?

Yes you could, you could also just remove the mali files and just keep libya were it is... or just play wit both of them since they arent the same civ
 
Pie, I'm stealing all of your stuff BTW. veBear, you already know I steal all of your stuff. I'm trying to go on a modding rampage tonight.
 
for me too Capo ;), I am glad you like my features and use them!

veBear:
I am sorry, I don't have any special diplo music, I use the default ones.

Here's the code for your Bandeirantes:

PHP:
        def onCombatResult(self, argsList):
                'Combat Result'
                pWinner,pLoser = argsList
                playerX = PyPlayer(pWinner.getOwner())
                unitX = PyInfo.UnitInfo(pWinner.getUnitType())
                playerY = PyPlayer(pLoser.getOwner())
                unitY = PyInfo.UnitInfo(pLoser.getUnitType())

                # ---- UNIT: BANDEIRANTES Start --------------
                if pWinner.getUnitType() == gc.getInfoTypeForString("UNIT_BANDEIRANTES"):
                  if CyGame().getSorenRandNum(2, "Random number for Unit Bandeirantes to get Worker or Settler") == 0:
                    iUnit = gc.getInfoTypeForString("UNIT_WORKER")
                    iUnitAIType = UnitAITypes.UNITAI_WORKER
                  else:
                    iUnit = gc.getInfoTypeForString("UNIT_SETTLER")
                    iUnitAIType = UnitAITypes.UNITAI_SETTLE
        		# Create the unit
        		NewUnit = playerX.initUnit(iUnit,  pWinner.getX(), pWinner.getY(), iUnitAIType, DirectionTypes.DIRECTION_SOUTH)
        		NewUnit.finishMoves()

                # optional, only english, if you want it in more languages use CyTranslator() and add a tag in a TextInfo.xml
                if playerX.isHuman():
                    CyInterface().addMessage(pWinner.getOwner(), True, 10, "Your Bandeirantes has captured a "+PyInfo.UnitInfo(iUnit).getDescription()+"!", None, 2, PyInfo.UnitInfo(iUnit).getButton(), ColorTypes(14), unitX.getX(), unitX.getY(), True, True)
                # ---- UNIT: BANDEIRANTES End ----------------

                if (not self.__LOG_COMBAT):
                        return
                if playerX and playerX and unitX and playerY:
                        CvUtil.pyPrint('Player %d Civilization %s Unit %s has defeated Player %d Civilization %s Unit %s'
                                %(playerX.getID(), playerX.getCivilizationName(), unitX.getDescription(),
                                playerY.getID(), playerY.getCivilizationName(), unitY.getDescription()))

(I can't test it, I hope it works, if not. post it :))
 
oO.. damn... another job is coming and I have rare spare time.... :D

that's nice, you can compare the codes and take the better one ;)
did pla took care of UnitAIType ?
 
Oh ok. No, I didn't compare the type of loser unit. so keep using plats code.
 
I will have a go, (with the appropriate tools (baldyr's civplayer module :p if possible...)). though I wouldn't mind doing the building checks, wouldn't it be simpler to find if the civ controls 3 original capitals?

I will do some work on it tommorrow... is the Mod senario based or random based?
 
@PIE
Code:
if CyGame().getSorenRandNum(2, "Random number for Unit Bandeirantes to get Worker or Settler") == 0:
Yours have a 50% chance for worker and 50% chance for settler though.

@veBear
Checking num of cities and num of buildings is easy. However, I don't see how to trigger victory in python
 
A senario makes my wok easier. I read somewhere about victories so I will work on it today and see where I get. I will use the buildings aswell
 
do you mind if I could have the mod itself to test my code when it comes to it!
 
fair enough, I am done then (unless you find problems :p)

Firstly you will need to get this tool (put the module in the python folder, the setup code you will merge yourself from my code :P)

then in eventmanager:
Code:
Under the last import statement:
## Victory Condition - Start ##
import CivPlayer
## Victory Condition - End ##

Under onLoadGame (between the return statement and the other statement)
                ## Victory Condition - Start ##
                CivPlayer.setupCivPlayer()
                ## Victory Condition - End ##

Under onGameStart (put under the string above the rest of code):
		## Victory Condition - Start ##
                CivPlayer.setupCivPlayer()
                ## Victory Condition - End ##

and under onBeginGameTurn (anywhere you want I would think):

		## Victory Condition - Start ##
		iRequiredCities = 20
                eRequiredBuilding = "BUILDING_IMPERIAL_SQUARE"
                iRequiredBuildings = 3
                eVictoryType = "VICTORY_SPECIAL"
                Game = CyGame()
		for pCivPlayer in CivPlayer.CivPlayer.getCivs():
                        pPlayer = pCivPlayer.get(1)
                        eTeam = pCivPlayer.get(2)
                        if pPlayer.getNumCities >= iRequiredCities:
                                if pPlayer.countNumBuildings(gc.getInfoTypeForString(eRequiredBuilding)) >= iRequiredBuildings:
                                        Game.setWinner(eTeam, gc.getInfoTypeForString(eVictoryType))                                
                                
		## Victory Condition - End ##

put this right at the very end of the file!
## Victory Condition - Start ##
if gc.getGame().isFinalInitialized():
        CivPlayer.setupCivPlayer()
## Victory Condition - End ##

You can edit the variables of iRequiredCities, iRequiredBuildings, eRequiredBuilding and eVictoryType as you want! also I took the liberty of adding this for the CIV4VictoryInfo.xml
Code:
		<VictoryInfo>
			<Type>VICTORY_SPECIAL</Type>
			<Description>TXT_KEY_VICTORY_SPECIAL</Description>
			<Civilopedia>TXT_KEY_VICTORY_SPECIAL_PEDIA</Civilopedia>
			<bTargetScore>0</bTargetScore>
			<bEndScore>0</bEndScore>
			<bConquest>0</bConquest>
			<bDiploVote>0</bDiploVote>
			<bPermanent>0</bPermanent>
			<iPopulationPercentLead>0</iPopulationPercentLead>
			<iLandPercent>0</iLandPercent>
			<iMinLandPercent>0</iMinLandPercent>
			<iReligionPercent>0</iReligionPercent>
			<CityCulture>NONE</CityCulture>
			<iNumCultureCities>0</iNumCultureCities>
			<iTotalCultureRatio>0</iTotalCultureRatio>
			<iVictoryDelayTurns>0</iVictoryDelayTurns>
			<VictoryMovie/>
		</VictoryInfo>

Hope it works!

as a side note, I hope setWinner does what I think it does! :rolleyes: So I will sit here in anticipation for you to test it!
 
maybe I could :p I must warn you though, my computer isn't the fastest thing in the world :lol:

Out of interest what's the mod about?

and also, feel free to ask me for other python work again!
 
Back
Top Bottom