View Full Version : Question: Is there a Way to Increase AI Starting Gold?
Officer Reene Jun 26, 2006, 04:46 PM 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:
ArbitraryGuy Jun 26, 2006, 06:30 PM Haven't looked through the XML for and AI gold at start setting. But, if nobody finds one, you could have an event fire in python on the beginning of the game which would give all the non-human players a certain amount of gold.
TheLopez Jun 26, 2006, 06:32 PM 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.
Officer Reene Jun 26, 2006, 08:45 PM 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 ;)
Sto Jun 27, 2006, 02:11 AM You have just to insert the 2 lines into the CvEventManager.py of your MOD :
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.BUTT ONPOPUP_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.BUTT ONPOPUP_DETAILS)
popupInfo.setOption1(true)
popupInfo.addPopup(iPlayer)
Tcho !
Officer Reene Jun 27, 2006, 04:46 AM 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:
Officer Reene Jun 27, 2006, 08:32 AM 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:
Sto Jun 27, 2006, 09:01 AM 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!
Officer Reene Jun 27, 2006, 04:08 PM 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:
Officer Reene Jun 28, 2006, 11:21 AM 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 Jun 28, 2006, 12:04 PM it's works... because my spy can see their money...
but they dont show it in the diplomacy (gold trade) window
Obviously, you can only trade gold once you have researched currency!
Officer Reene Jun 28, 2006, 12:16 PM Obviously, you can only trade gold once you have researched currency!
see post #7
...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 Jun 28, 2006, 03:43 PM My fault, I had missed that post.
very wierd indeed how it did not show up on the diplomacy screen.
Officer Reene Jun 28, 2006, 05:00 PM 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....
Sto Jun 28, 2006, 06:00 PM 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 ?!
Officer Reene Jun 28, 2006, 07:47 PM 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 ;)
Officer Reene Jun 30, 2006, 07:41 AM playing Normal Speed in MP and at the year 1735 AD...
no problems with the script...
*Hooray* :lol:
thx again Sto! :goodjob:
Officer Reene Jul 09, 2006, 01:02 AM 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:
Sto Jul 09, 2006, 08:16 AM 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 )
Officer Reene Jul 09, 2006, 09:50 AM 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:
|
|