replant forest for BtS

hrochland

Prince
Joined
Apr 9, 2006
Messages
2,511
Location
Czech Kingdom
Worked anybody, please, on replant forest for BtS?
I have major interest for this code.
Can anybody write me replant forest code for BtS, please
thank you
HROCHland
 
Yes. I put replant forest part from FreenMod and paste to the my BtS mod but Civ 4 crash when mod loading.

HTML:
      def onImprovementBuilt(self, argsList):
                'Improvement Built'
                iImprovement, iX, iY = argsList

                #HrochMod: vysadit les a waterland

                pPlot = CyMap().plot(iX,iY)
#################################################################
             if(iImprovement==gc.getInfoTypeForString('IMPROVEMENT_NEW_FOREST')):
                        pPlot.setImprovementType(-1)
                        pPlot.setFeatureType(4, 1)
                if(iImprovement==gc.getInfoTypeForString('IMPROVEMENT_NEW_FORESTW')):
                        pPlot.setImprovementType(-1)
                        pPlot.setFeatureType(4, 2)
#################################################################
                iWaterland1 = gc.getInfoTypeForString('IMPROVEMENT_WATERLAND1')
                iWaterland2 = gc.getInfoTypeForString('IMPROVEMENT_WATERLAND2') etc. etc.

Is somewhere any next part of code which I find not? Give me advice, please
HROCHland
 
Did you remember to add the NEW_FOREST improvement and the bits allowing workers to build it etc. also?
 
All these elements I pasted to the mod. :(
You have experience that python code is valid for BtS and sex lines in my view is OK?
 
Did you inlcude the line with "pPlot = CyMap().plot(iX,iY)" or just the 6 lines you framed? If not then you need to add it also.

EDIT: nm, thought the code you posted was where you copied it from. I realize now it is where you pasted it - heh
 
I just noticed - the indentions of the code you pasted in are not in alignment with the rest of the code (or even itself in fact).

Spaced indention = bad. Tabulated indentions FTW. ;)
 
Did you inlcude the line with "pPlot = CyMap().plot(iX,iY)" or just the 6 lines you framed? If not then you need to add it also.

EDIT: nm, thought the code you posted was where you copied it from. I realize now it is where you pasted it - heh

HTML:
      def onImprovementBuilt(self, argsList):
                'Improvement Built'
                iImprovement, iX, iY = argsList

                pPlot = CyMap().plot(iX,iY)

                iWaterland1 = gc.getInfoTypeForString('IMPROVEMENT_WATERLAND1')
                iWaterland2 = gc.getInfoTypeForString('IMPROVEMENT_WATERLAND2') etc. etc.

This is part for land-> water / water-> land change. Bmarnz selected it from GreenMod for me (thanks Bmarnz). Later I find that I need replant forest too. I cut sex lines from GreenMod and paste where was in green mod.
Xml parts I pasted too.

:( :( :(
 
Like CyberChrist said, the problem appears to be indention.
Code:
[16 spaces]pPlot = CyMap().plot(iX,iY)
#################################################################
[13 spaces]if(iImprovement==gc.getInfoTypeForString('IMPROVEMENT_NEW_FOREST')):
                        pPlot.setImprovementType(-1)
                        pPlot.setFeatureType(4, 1)
[16 spaces]if(iImprovement==gc.getInfoTypeForString('IMPROVEMENT_NEW_FORESTW')):

You can't have 13 spaces in one place and 16 everywhere else. You must use the same number.
 
Back
Top Bottom