View Full Version : Argument problem with .changeResearchProgress


naf4ever
Mar 13, 2006, 11:45 PM
Im trying to test this function out and get it working for another mod im doing yet i keep getting argument errors in the form of this screen:

http://www.naf.cc/civ4/argerror.jpg

This is what my code currently looks like:


player = gc.getActivePlayer()
eTeam = gc.getTeam(player.getTeam())
irPoints = (player.getCommerceRate(CommerceTypes.COMMERCE_RES EARCH))

eTeam.changeResearchProgress(iLoopTech, irPoints, player)


iLooptech in this instance refers to a tech chosen in a previous part of the code. Basically i want this function to double the research points at the end of the turn for the given tech. The error message seems to indicate iLooptech and irPoints are ok but CyTeam and CyPlayer arent matching up with what the program requires. I'm not seeing what im doing wrong though or how to get my CyTeam and CyPlayer arguments to match up with the type of values they want.

Anyone got an idea?

12monkeys
Mar 14, 2006, 03:02 AM
It looks like that you try to pass "player" as a player object (CyPlayer) when you need to pass a player number (int).

Try this :


player = gc.getActivePlayer()
iplayer = gc.getActivePlayer().getID()
eTeam = gc.getTeam(player.getTeam())
irPoints = (player.getCommerceRate(CommerceTypes.COMMERCE_RES EARCH))

eTeam.changeResearchProgress(iLoopTech, irPoints, iplayer)

naf4ever
Mar 14, 2006, 10:17 AM
That seems to have done it. Thanks!