Natural wonders development thread

they have spawning codes on gamestart

I should be able to do a pedia page for it at a later date, I like working with the Pedia, hopefully it will be pretty easy.

The thing that was missing isn't missing as such but if you read back though the past few pages dacubz wanted the cultural bonuses to be changed to money bonuses.
 
Well, when I start a game in the mod, they don't spawn.
 
Well, when I start a game in the mod, they don't spawn.

I am getting the following python error which is probably stopping the spawn.
Code:
Traceback (most recent call last):

  File "CvEventInterface", line 23, in onEvent

  File "CvEventManager", line 199, in handleEvent

  File "CvEventManager", line 345, in onGameStart

  File "CvEventManager", line 36, in doNaturalWondersConstantsInit

NameError: global name 'Game' is not defined
ERR: Python function onEvent failed, module CvEventInterface

Two lines down Game is defined. ;)

Edit moving the definition line just leads to different errors. :(
 
I'll take a look

edit:

the global Game must be defined first.

anyway that error is impossible.....

Code:
def doNaturalWondersConstantsInit():
        iBaseCulture = 500 #amount of culture given to a city with natural wonder in radius (affected by gamespeed!)
        iDiscoveryCulturePercentage = 20 #percentage of culture gained when wonder discovered: if 20 and city has 200 culture it will become 240
        global iCulture
        global iGold
        global Game
        global fCultureModifier
        Game = CyGame()
        iModifier = gc.getGameSpeedInfo(Game.getGameSpeedType()).getUnitGreatWorkPercent()
        fCultureModifier = 100/float(iDiscoveryCulturePercentage)
        iCulture = iBaseCulture * iModifier /100
        iGold = 400 #Gold given to player for ownership

this should be the code. If this is what you guys have then I have no clue how...
 
1) Game undefined fixed
2) fCultureModifier typo fixed
3) bNotRevealed always false fixed
4) Missing Text messages TXT_KEY_WONDERDISCOVERED_YOU and TXT_KEY_WONDERDISCOVERED_ELSE added

Notes:
1) This is still the giving disgusting culture and gold version
2) Since no additional codes added, TXT_KEY_WONDERDISCOVERED_ELSE will inform you XXX has been discovered by certain leader, even if you have not met that leader
3) All others which I mentioned before
 
Code:
#Natural Wonders Contants
def doNaturalWondersConstantsInit():
        iBaseCulture = 500 #amount of culture given to a city with natural wonder in radius (affected by gamespeed!)
        iDiscoveryCulturePercentage = 20 #percentage of culture gained when wonder discovered: if 20 and city has 200 culture it will become 240
        global iCulture
        global iGold
        global Game
        global fCultureModifier
        iModifier = gc.getGameSpeedInfo([B][COLOR="Red"]Game.getGameSpeedType()[/COLOR][/B]).getUnitGreatWorkPercent()
        fCultureModifier = 100/float(iDiscoveryCulturePercentage)
        [B][COLOR="red"]Game = CyGame()[/COLOR]	[/B]
        iCulture = iBaseCulture * iModifier /100
        iGold = 400 #Gold given to player for ownership
 
I had that fixed in my version... I have a more recent version sitting around. oops. Should I upload my version?
 
Up to you lol, this is your project, not mine.
I am just loithering around :D
 
thats because you had my version that doesn't have errors. They were errors I fixed before giving it to you, but then I uploaded the unfixed version :crazyeye:
 
you will need to merge in the code. the python will be quite easy to merge but then you need somebody to merge in my SDK code into rhyes DLL also
 
Again, this seems to have stopped.
 
Same

I would have been working but I thought you were gonna finish it up (and I have been working on my 2000 line program for the strategy forum :D I just got a process down from taking 25 ms to 1 ms optimization ftw :lol:)

in any case, use dacubz posted version (thats my latest code) the last thing we need coded is the happiness instead of culture :p If you don't want to do it I will do it within the week.
 
I'm not sure I have the latest version.
 
So, clarify. What is wanted?
 
Back
Top Bottom