Announcement

Collapse
No announcement yet.

CvTechChooser.py... is mine messed up?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CvTechChooser.py... is mine messed up?

    Could someone please check if their CvTechChooser.py in the Civ4\Assets\Python\Screens directory is the same as mine starting on line 576

    Code:
    # Go through all the techs
    		for i in range(gc.getNumTechInfos()):
    		
    			bChanged = 0
    		
    			if ( gc.getTeam(gc.getPlayer(g_civSelected).getTeam()).isHasTech(i) ):
    				if ( g_iCurrentState[i] != CIV_HAS_TECH ):
    					g_iCurrentState[i] = CIV_HAS_TECH
    					bChanged = 1;
    I'm almost certain I didn't change it since I never modify files there but I'm getting an error message:
    Traceback (most recent call last):
    File "CvScreensInterface", line 67, in showTechChooser
    File "CvTechChooser", line 69, in interfaceScreen
    File "CvTechChooser", line 582, in updateTechRecords
    IndexError: list index out of range

    My tech screen isn't showing a change in color when a tech is researched. Also, sometimes when I go in to a city screen all of the build buttons and the "spend gold to finish" button are gone.

    Roger Bacon

  • #2
    Here are my lines from 576:

    PHP Code:
            # Go through all the techs
            
    for i in range(gc.getNumTechInfos()):
            
                
    bChanged 0
            
                
    if ( gc.getTeam(gc.getPlayer(g_civSelected).getTeam()).isHasTech(i) ):
                    if ( 
    g_iCurrentState[i] != CIV_HAS_TECH ):
                        
    g_iCurrentState[i] = CIV_HAS_TECH
                        bChanged 
    1;
                
    elif gc.getPlayer(g_civSelected).getCurrentResearch() == ):
                    if ( 
    g_iCurrentState[i] != CIV_IS_RESEARCHING ):
                        
    g_iCurrentState[i] = CIV_IS_RESEARCHING
                        bChanged 
    1;
                
    elif gc.getPlayer(g_civSelected).isResearchingTech(i) ):
                    if ( 
    g_iCurrentState[i] != CIV_IS_RESEARCHING ):
                        
    g_iCurrentState[i] = CIV_IS_RESEARCHING
                        bChanged 
    1;
                
    elif gc.getPlayer(g_civSelected).canEverResearch(i) ):
                    if ( 
    g_iCurrentState[i] != CIV_NO_RESEARCH ):
                        
    g_iCurrentState[i] = CIV_NO_RESEARCH
                        bChanged 
    1;
                else:
                    if ( 
    g_iCurrentState[i] != CIV_TECH_AVAILABLE ):
                        
    g_iCurrentState[i] = CIV_TECH_AVAILABLE
                        bChanged 
    1;

                if ( 
    bChanged ):
                    
    # Create and place a tech in its proper location
                    
    szTechRecord "TechRecord" str(i)
                    
    szTechID "TechID" str(i)
                    
    szTechString "<font=1>"
                    
                    
    if ( gc.getPlayer(g_civSelected).isResearchingTech(i) ):
                        
    szTechString szTechString unicode(gc.getPlayer(g_civSelected).getQueuePosition(i)) + ". "
                        
                    
    iX 30 + ( (gc.getTechInfo(i).getGridX() - 1) * ( ( BOX_INCREMENT_X_SPACING BOX_INCREMENT_WIDTH ) * PIXEL_INCREMENT ) )
                    
    iY = ( gc.getTechInfo(i).getGridY() - ) * ( BOX_INCREMENT_Y_SPACING PIXEL_INCREMENT ) + 5

                    szTechString 
    += gc.getTechInfo(i).getDescription()
                    if ( 
    gc.getPlayer(g_civSelected).isResearchingTech(i) ):
                        
    szTechString += " ("
                        
    szTechString += str(gc.getPlayer(g_civSelected).getResearchTurnsLeft(i, ( gc.getPlayer(g_civSelected).getCurrentResearch() == )))
                        
    szTechString += ")"
                    
    szTechString szTechString "</font>"
                    
    screen.setTextAtszTechID"TechList"szTechStringCvUtil.FONT_LEFT_JUSTIFYiX X_INCREMENTiY 6, -0.1FontTypes.SMALL_FONTWidgetTypes.WIDGET_TECH_TREEi, -)
                    
    screen.setActivationszTechIDActivationTypes.ACTIVATE_MIMICPARENTFOCUS )

                    if ( 
    gc.getTeam(gc.getPlayer(g_civSelected).getTeam()).isHasTech(i) ):
                        
    screen.setPanelColor(szTechRecord8515087)
                        
    g_iCurrentState.append(CIV_HAS_TECH)
                    
    elif gc.getPlayer(g_civSelected).getCurrentResearch() == ):
                        
    screen.setPanelColor(szTechRecord104158165)
                        
    g_iCurrentState.append(CIV_IS_RESEARCHING)
                    
    elif gc.getPlayer(g_civSelected).isResearchingTech(i) ):
                        
    screen.setPanelColor(szTechRecord104158165)
                        
    g_iCurrentState.append(CIV_IS_RESEARCHING)
                    
    elif gc.getPlayer(g_civSelected).canEverResearch(i) ):
                        
    screen.setPanelColor(szTechRecord100104160)
                        
    g_iCurrentState.append(CIV_NO_RESEARCH)
                    else:
                        
    screen.setPanelColor(szTechRecord2066569)
                        
    g_iCurrentState.append(CIV_TECH_AVAILABLE
    Hope, it will help you

    Comment

    Working...
    X