Question: Is there a Way to Increase AI Starting Gold?

Officer Reene

It hates you all
Joined
Jan 21, 2006
Messages
698
Location
In the middle of nowhere
Is this possible?

so far my experiments with CIV4HandicapInfo.xml and Civ4EraInfos.xml only effects human players and not AI... :sad:


Is there a way to increase the AI starting gold?:confused:

If there is a way.... how can I do it?


any help would be greatly appreciated :goodjob:
 
Officer Reene said:
Is this possible?

so far my experiments with CIV4HandicapInfo.xml and Civ4EraInfos.xml only effects human players and not AI... :sad:


Is there a way to increase the AI starting gold?:confused:

If there is a way.... how can I do it?


any help would be greatly appreciated :goodjob:

Basically the best way to do it might be through the onGameStart method in python, you can use either the isPlayable or isHuman methods in the CyPlayer class.
 
Im dont know how to code in python...:sad:

and I try to avoid python editing because alot of times that causes Out of Sync Errors... In MP...

Im not sure if this would effect MP... (because usually OOS errors occur with messing with AI gameplay and I dont think editing python this way would effect it) but since I cant code python its a moot point :(


anyway thx for the ideas... If anyone has more... please let me know ;)
 
You have just to insert the 2 lines into the CvEventManager.py of your MOD :

Code:
def onGameStart(self, argsList):
        'Called at the start of the game'
        if (gc.getGame().getGameTurnYear() == gc.getDefineINT("START_YEAR")):
                for iPlayer in range(gc.getMAX_PLAYERS()):
                        player = gc.getPlayer(iPlayer)
                        if (player.isAlive() and player.isHuman()):
                                popupInfo = CyPopupInfo()
                                popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
                                popupInfo.setText(u"showDawnOfMan")
                                popupInfo.addPopup(iPlayer)
            #### add the folowing 2 lines and change nbgold with the amound of gold you want #####
                        elif (player.isAlive() and not player.isHuman()):
                                player.setGold(nbgold)
            ######################################################################################

        if gc.getGame().isPbem():
                for iPlayer in range(gc.getMAX_PLAYERS()):
                        player = gc.getPlayer(iPlayer)
                        if (player.isAlive() and player.isHuman()):
                                popupInfo = CyPopupInfo()
                                popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_DETAILS)
                                popupInfo.setOption1(true)
                                popupInfo.addPopup(iPlayer)


Tcho !
 
Great! :goodjob:

I'll try it and see if it works in MP!;)

thx for your help Sto! :D


I'll keep you posted! :mischief:
 
well I did some things but I got it working in SP... thx Sto :goodjob:


I couldnt get it to run at first! :confused:

I found out my alignment was off (indentation) therefore my "dawn of man" popup wouldnt show :rolleyes:

I fixed that and then the popup worked fine


the only weird thing is that when I added Currency Tech (using WB) they displayed 0 on gold to trade in the diplomacy window....

yet when I placed a spy in their cities they showed the starting gold :confused:


I hope the AI knows it has the extra gold to trade... and use...


anyway I will be testing this in MP the next couple of days so I will keep you posted on my results :crazyeye:



thx again Sto! Your the :king:
 
As i'm not an expert modder , i can't help you for details . but i've seen with my map scripts that if you put the option 'lock the modified assets' when you play , the change are take in count but does not appear into the world builder .( and for an example if you change a starting technologie , the technologie is still learned but the case in the technologie tree is not green )

and when i add starting gold to AI player with a similar method, it is shown into the world builder .

I can't help you much , Tcho!
 
Sto said:
As i'm not an expert modder , i can't help you for details . but i've seen with my map scripts that if you put the option 'lock the modified assets' when you play , the change are take in count but does not appear into the world builder .( and for an example if you change a starting technologie , the technologie is still learned but the case in the technologie tree is not green )

and when i add starting gold to AI player with a similar method, it is shown into the world builder .

I can't help you much , Tcho!


well thx anyway...

it's works... because my spy can see their money...

but they dont show it in the diplomacy (gold trade) window

oh well... :crazyeye: I'll just see how it turns out! :goodjob:
 
MP seems to work... without any OOS problems :goodjob:

I am playing normal speed and the year is currently 1 AD

I think I might test it further in SP to see if they use the extra coins allotted to them (I didnt playtest it alot in SP since I was anxious to try it in MP :mischief: )


Thanks for your help Sto :)


I'll keep you posted ;)
 
Lord Olleus said:
Obviously, you can only trade gold once you have researched currency!

see post #7


Officer Reene said:
...the only weird thing is that when I added Currency Tech (using WB) they displayed 0 on gold to trade in the diplomacy window....

yet when I placed a spy in their cities they showed the starting gold :confused:
 
Lord Olleus said:
My fault, I had missed that post.

very wierd indeed how it did not show up on the diplomacy screen.


Im going to play single player a little long next time I get a chance...to see if the AIs use the extra gold or not....
 
Why not adding a huge amount of gold and at the same time a high number of armies to test that ? :confused:

edit : if the gold isn't taking in count AIplayer will run into anarchy or kill units ?!
 
Sto said:
Why not adding a huge amount of gold and at the same time a high number of armies to test that ? :confused:

edit : if the gold isn't taking in count AIplayer will run into anarchy or kill units ?!


At first I didnt understand your suggestion...but now I got it... :D


gonna have to try it this weekend though... since Idont have time now :mad:

busyyyyyy IRL ;)
 
playing Normal Speed in MP and at the year 1735 AD...

no problems with the script...

*Hooray* :lol:


thx again Sto! :goodjob:
 
Hey Sto,

I am trying to merge the Civlerts mod component:

http://forums.civfanatics.com/showthread.php?t=157088


and the TechCost mod:

http://forums.civfanatics.com/showthread.php?t=168120

it works in single player...

but in MP it doesnt work! :sad:

I lose the "dawn of man" pop-up window and I can not rename cities (it automatically names cities from generic list... w/o letting me name the cities at all - even when city is created... I can not rename them :mad: )


I think it has to do with your suggestion in python coding because your line is right after the "Dawn of Man" reference in python...

any ideas on how to get around this? :confused:

any help would be greatly appreciated! :goodjob:
 
I've just took a look at the files and don't know what's the problem ... I don't think that the line of code to add AI starting gold is for something . But that depend on how you merge the 2 python comp .

Do you check the python error log ? This time , i can't help you because i've never done something like that and i will be a bad advise .

Sorry , Tcho ! ( you may post your CvEventManager() , perhaps someone can help you )
 
Sto said:
I've just took a look at the files and don't know what's the problem ... I don't think that the line of code to add AI starting gold is for something . But that depend on how you merge the 2 python comp .

Do you check the python error log ? This time , i can't help you because i've never done something like that and i will be a bad advise .

Sorry , Tcho ! ( you may post your CvEventManager() , perhaps someone can help you )


Im not sure if I even needed your new code (sorry :blush: )

I added 300 (gold) to the starting gold in the CIV4EraInfos.xml (as opposed to the CIV4Handicap.xml)

and when I removed your line from the python file (CvEventManager.py)

the other AI still had 300 starting Gold

but when I left your line in

the other AI had more than 300 Gold (but oddly) less than 600 gold :confused:

anyway I dont know if that did the trick...

but it seems to work when I tested it out in 3 games...


Im not sure if my merger of the two other mods works...

I gotta test that next time :mischief:


thanks for your help Sto... :goodjob:

I'll probably ask for your advice in the future :crazyeye:
 
Back
Top Bottom