Modding Voting

isau

Deity
Joined
Jan 15, 2007
Messages
3,071
Hey guys,

I got the SDK to compile at long last and have been happily modding. Thanks to all of you who've helped me move along to this point.

I have run into a problem, though. One thing I was trying to mod was how votes are counted up for elections. This seems to be done with the getVotes method of class CvPlayer. However, if I change the int getVotes returns,
the UN stops working altogether! Even the graphic doesn't show up in the city (tho you can open the city screen to see the UN is there), and no voting ever takes place. Just seemed really weird.

Has anyone by any chance fiddled with how the voting mechs work for BTS?
 
The SDK sometimes give realy weird effects which is quite frsutrating. For example, if you try to add certain types to a class, it compiles alright, but when the mod is loaded it crashes to desktop. Therefore I have learned that whenever I modify something significant, I test it before proceding. THere resut is that mod progress is generaly slow due to all the testing :(
 
Thanks for the tip Demon.

I actually managed to fix the voting function earlier today. The problem turned out to be not the number being returned by the getVotes method, but the fact that I wasn't checking the isAlive and isBarbarian values for a leader when looping through their traits within that function. This was causing getVotes to throw an exception and not return a good value, which in turn would cause the UN to break completely. Just one of those odd things...
 
Top Bottom