Natural Wonders Mod Comp

Code:
				## Chance of Spawning each Natural Wonder: (CyMap().getWorldSize() +1) * 12 ##
					[COLOR="Lime"]if 1 < 2:[/COLOR]						WonderPlot = []
						for i in xrange(CyMap().numPlots()):
 
Code:
				## Chance of Spawning each Natural Wonder: (CyMap().getWorldSize() +1) * 12 ##
					[COLOR="Lime"]if 1 < 2:[/COLOR]						WonderPlot = []
						for i in xrange(CyMap().numPlots()):

Thanks! It definitely works (the 100% spawn code) in BtS, RevolutionDCM is giving problems again though (because yes I am that guy that's trying to merge everything that he likes with RevDCM). In fact, no Natural Wonders spawn at all with RevDCM with the old code as well, just nothing happens - I am trying to figure out now why for myself and the people that also want NW with RevDCM.

EDIT:
In the RevEvents.py file onCityBuilt is already used. Therefore the onCityBuilt in CvEventManager does not work.
The fix is very simple though:
paste the same code in RevEvents.py under the other code beneath onCityBuilt.
The other part of the code, onPlotRevealed, can be left in CvEventManager and both pieces of code function on their own
in different files. Case closed :)
 
Did you know though that building a city next to a NW does not give a free specialist? I tested it for basic BtS as well. Or is there just a very small chance that it gives a free specialist? Anyway, when testing, I didn't get a free specialist in any of the cities that I built right next to a NW (and I built one next to every NW).
 
Nothing wrong.

If you "built" those cities via WorldBuilder, then they won't get the bonus, because codes not triggered.
 

Attachments

  • Civ4ScreenShot0000.JPG
    Civ4ScreenShot0000.JPG
    89 KB · Views: 183
Thanks! It definitely works (the 100% spawn code) in BtS, RevolutionDCM is giving problems again though (because yes I am that guy that's trying to merge everything that he likes with RevDCM). In fact, no Natural Wonders spawn at all with RevDCM with the old code as well, just nothing happens - I am trying to figure out now why for myself and the people that also want NW with RevDCM.

EDIT:
In the RevEvents.py file onCityBuilt is already used. Therefore the onCityBuilt in CvEventManager does not work.
The fix is very simple though:
paste the same code in RevEvents.py under the other code beneath onCityBuilt.
The other part of the code, onPlotRevealed, can be left in CvEventManager and both pieces of code function on their own
in different files. Case closed :)

Good to know, I was planning on merging the two at some point when I sit down to play.
Although I was thinking of attempting to put together a BUG version of it.
 
Nothing wrong.

If you "built" those cities via WorldBuilder, then they won't get the bonus, because codes not triggered.

Haha, I still have to learn a lot, thanks! How can I increase the range of the free Specialist bonus, let's say to a Big Fat Cross bonus instead of the first ring?


Good to know, I was planning on merging the two at some point when I sit down to play.
Although I was thinking of attempting to put together a BUG version of it.

Okay, I have to warn you though that if you do it the way I described, the Wonders will only spawn if the Revolutions options is on.
I am ok with that because I always play with revolutions on, but if you want (other people to be able) to choose, you could of course try to have the code in RevEvents.py AND CvEventManager - I suppose that then it'd work with Revolutions on and off.
 
Replace
Code:
for x in xrange(city.getX() - 1, city.getX() + 2):
	for y in xrange(city.getY() - 1, city.getY() + 2):
		pPlot = CyMap().plot(x, y)

with

Code:
for i in range(21):
	pPlot = city.getCityIndexPlot(i)
 
Replace
Code:
for x in xrange(city.getX() - 1, city.getX() + 2):
	for y in xrange(city.getY() - 1, city.getY() + 2):
		pPlot = CyMap().plot(x, y)

with

Code:
for i in range(21):
	pPlot = city.getCityIndexPlot(i)
Worked again:) You are of great help but I am greedy enough to ask for help one last time :D
Instead of a random specialist, I want it to assign a building (not a random one). I thought this would work:

Code:
				if pPlot.getFeatureType() > -1:
					if gc.getFeatureInfo(pPlot.getFeatureType()).getType().find("FEATURE_PLATY_") > -1:
						lBuildings = []
						lBuildings.append(gc.getInfoTypeForString('BUILDING_NATURAL_WONDER'))

... but it does not. Well, I just stole some code and hoped this would work as I can read python a bit but not write it at all. Any idea how I can do this?

I figured out that a free building would be better than a free specialist for what I want (remember, I wanted Natural Wonders to add culture) because then I can assign more/different effects than with a specialist :)
 
city.setNumRealBuilding(gc.getInfoTypeForString("BUILDING_AIR_BASE"), 1)
 
city.setNumRealBuilding(gc.getInfoTypeForString("BUILDING_AIR_BASE"), 1)
Great, worked again!
Thanks a lot, I will upload my alternative version once I've finished it:) I won't upload it to the database or anything, just post it here and you can leave it here or do whatever you want with it;)
 
Up to you lol
You can ask The_J to let you have the 2nd post to post your alternative version or simply upload to database if you like, so I don't have to do anything :evil:
Afterall, there are some users who would like a merged version with Rev or BUG, which I am definitely lazy to do :D

I just ensure that the skeleton of the codes are in place and that's it.
Whether anyone wants it to have first player benefits, discovery benefits or nearby benefits, I leave it to you guys.
Afterall, that is what mod component is about, you adjust it to what you want in your mod :D

As you can see... I can't even be bothered to update the changelogs recently...
 
Mini Update:
Messages and Movies no longered played during WorldBuilder mode.
 
Not really my idea, dacubz started it :D
I just convert dreams to reality :mischief:
 
hey! I make dreams reality too! just.... um.... slower. :mischief:
 
I was wondering, would it be possible for the Natural Wonders to permanently show their button (the popup button you get when you discover a wonder first)? I suppose that'd mean you can switch those buttons off with the resource-button-button, but that'd be better actually than not being able to turn them off.
 
Updates:

Pressing CTRL + F shows locations of revealed Natural Wonders for one minute.
 

Attachments

  • Civ4ScreenShot0002.JPG
    Civ4ScreenShot0002.JPG
    132.4 KB · Views: 212
Top Bottom