randomize resources = true / false to features

keldath

LivE LonG AnD PrOsPeR
Joined
Dec 20, 2005
Messages
7,366
Location
israel
HI,
inside a saved map fron the world builder,

you have a tag, in the beginmap part,
the you can use - randomize resources = true or false,
so you will be able to play a pre saved map, with changeable resources on the map each game.

so far so good,

but - what if i want to have a randomize resource as well?
how can this be achieved?
since - for now, you wont get any resources if you didnt pre placed them manually via world builder.
so the goal is to have both features and bonuses randomized each game start.


any one have any idea where should i start?
 
but - what if i want to have a randomize resource as well?
how can this be achieved?
since - for now, you wont get any resources if you didnt pre placed them manually via world builder.
? Just switch the tag to Randomize Resources=true and it will re-do the work, including for example resources specific to your mod that were not in the WBSave file. Note that it will switch back the tag to false afterwards.

so the goal is to have both features and bonuses randomized each game start.
any one have any idea where should i start?

Interesting idea. The start is in the CvWBDesc.py file where you have a
Code:
		if (self.mapDesc.bRandomizeResources != "false"):
			for iPlotLoop in range(CyMap().numPlots()):
				pPlot = CyMap().plotByIndex(iPlotLoop)
				pPlot.setBonusType(BonusTypes.NO_BONUS)
			CyMapGenerator().addBonuses()
The same could probably be applied to Features as there is a CyMapGenerator().addFeatures() command.

I wonder if this could interest Platy for his World Builder?... :coffee:
 
huh cool, nice help :)

i have duplicated all the code of the bonuses, with replacement of the bonus for features, but,
game loads, now upon loading a saved map - in game - it gives an error -

failed to read worldbuilder file + the path of the file.

ive duplicated all the lines needed, checked my self several times.
didnt work...

suggestions?

maybe theres some place else that needs to be defines? or that perhaps the resources need different code then the bonuses?
 
I don't know, I haven't tried it. Could you share your file?
 
OK, I'll have a look at it tomorrow.
 
Great! ;)
 
Top Bottom