HELP!! Problem with Expanded and Re-ordered Tech Tree

This has got to be the key to understanding our problem:

# Create and place a tech in its proper location
iX = 30 + ( (gc.getTechInfo(i).getGridX() - 1) * ( ( BOX_INCREMENT_X_SPACING + BOX_INCREMENT_WIDTH ) * PIXEL_INCREMENT ) )
iY = ( gc.getTechInfo(i).getGridY() - 1 ) * ( BOX_INCREMENT_Y_SPACING * PIXEL_INCREMENT ) + 5
szTechRecord = "TechRecord" + str(i)

if ( iMaxX < iX + self.getXStart() ):
iMaxX = iX + self.getXStart()
if ( iMaxY < iY + ( BOX_INCREMENT_HEIGHT * PIXEL_INCREMENT ) ):
iMaxY = iY + ( BOX_INCREMENT_HEIGHT * PIXEL_INCREMENT )

screen.attachPanelAt( "TechList", szTechRecord, u"", u"", True, False, PanelStyles.PANEL_STYLE_TECH, iX - 6, iY - 6, self.getXStart() + 6, 12 + ( BOX_INCREMENT_HEIGHT * PIXEL_INCREMENT ), WidgetTypes.WIDGET_TECH_TREE, i, -1 )
screen.setActivation( szTechRecord, ActivationTypes.ACTIVATE_MIMICPARENTFOCUS)
screen.hide( szTechRecord )

if ( gc.getTeam(gc.getPlayer(g_civSelected).getTeam()).isHasTech(i) ):
screen.setPanelColor(szTechRecord, 85, 150, 87)
g_iCurrentState.append(CIV_HAS_TECH)
elif ( gc.getPlayer(g_civSelected).getCurrentResearch() == i ):
screen.setPanelColor(szTechRecord, 104, 158, 165)
g_iCurrentState.append(CIV_IS_RESEARCHING)
elif ( gc.getPlayer(g_civSelected).isResearchingTech(i) ):
screen.setPanelColor(szTechRecord, 104, 158, 165)
g_iCurrentState.append(CIV_IS_RESEARCHING)
elif ( gc.getPlayer(g_civSelected).canEverResearch(i) ):
screen.setPanelColor(szTechRecord, 100, 104, 160)
g_iCurrentState.append(CIV_NO_RESEARCH)
else:
screen.setPanelColor(szTechRecord, 206, 65, 69)
g_iCurrentState.append(CIV_TECH_AVAILABLE)

szTechID = "TechID" + str(i)
szTechString = "<font=1>"
if ( gc.getPlayer(g_civSelected).isResearchingTech(i) ):
szTechString = szTechString + str(gc.getPlayer(g_civSelected).getQueuePosition(i)) + ". "
szTechString += gc.getTechInfo(i).getDescription()
szTechString = szTechString + "</font>"
screen.setTextAt( szTechID, "TechList", szTechString, CvUtil.FONT_LEFT_JUSTIFY, iX + 6 + X_INCREMENT, iY + 6, -0.1, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_TECH_TREE, i, -1 )
screen.setActivation( szTechID, ActivationTypes.ACTIVATE_MIMICPARENTFOCUS )

szTechButtonID = "TechButtonID" + str(i)
screen.addDDSGFCAt( szTechButtonID, "TechList", gc.getTechInfo(i).getButton(), iX + 6, iY + 6, TEXTURE_SIZE, TEXTURE_SIZE, WidgetTypes.WIDGET_TECH_TREE, i, -1, False )

fX = X_START

j = 0
k = 0
 
Well, I did some work and solved the problem. Now I'm ready to add more techs :cool:
 

Attachments

  • Civ4New3Techs.JPG
    Civ4New3Techs.JPG
    106.1 KB · Views: 153
ould you please post your copy of the techinfo file so I can see how you solved the probelm?

Also I see carpentry still leads to nothing...
 
Carpentry is a requirement for BoatBuilding. It's impossible to get BoatBuilding without having the knowledge of Carpentry. You can't build boats until you have those type of skills , it seemed like a logical choice for me.

It's your decision if you want carpentry to lead to something else , I just worked with what I was given to make it work.
 
My original plan was to make carpentry lead to The Wheel and Boat Building, and that a Carpenter would be a requirement for a ShipWright...

My new tech chart is making excellent progress buy the way...soon I will implement.
 
Done.

Now Carpentry leads to the Wheel (and is also a requirement for Boatbuilding).

I'm ready to implement all other techs , just ask and you shall recieve.
 

Attachments

  • fixedtechtree.JPG
    fixedtechtree.JPG
    106.4 KB · Views: 142
Almost but not quite...
Do this...
Make Carpentry an OrPrereq for both Boat Building and The Wheel.
Not an AND, but an OR
Then in the Shipwright buildinginfo make the Carpetner a prerequisite building for the Shipwright building.

The Carpenter Building should provide 1 Production and is a prereq for several other types of buildings. The Requirement for Carpentery is Carpentry. The Requirement for Shipwright is Boat Building and a Shipwright.

...Fishing Boats and all other boats now require a Shipwright.

Also dont forget the Terrain Improvemnt Type "Fishing Boats" which you can find in "CIV4BuildInfos.xml"...
The Pre-Req Tech for that should be Boat Building and not Fishing...
Bleh
so many details!
 
Okay, I have finally finished re-ordering my tech chart...

And I added quite a few techs in the process!

I am now at 65 new Techs, 35 changed techs, 51 unchanged techs...

Thats a total of 151 techs which is 75.5% more than the original game.

As should be expected, most of these techs are loaded into the front half ofthe game since the front half will almost always be longer in an expanded game.
 
Okay, mere minutes ago I jsut finished the RE-implementation of the techs I had already attempted to implement once before when I ran into this mess.

I am still at work and will be fore several hours more...but I will know tonight if my new methodology works!

I am cautiously optimistic!
:crazyeye:
 
It Worked!
However...
I still have some tiny problems that are pretty much just cosmetic...
Some of my lines "merge" and some cross under other techs...
however this is not a real problem since everything is functional!
 
Congrats man , I'm very happy for you!
 
I'm curious... how did you finally get it to work? I've been having the same problems...
 
The order is important ... A certain tech must be in a certain spot depending on the prerequisites of that tech or the tech that it leads to. Unfortunately my definition isn't as scientific as I would like , but that is what I discovered.
 
Okay, here are some secrets...
Things must be placed within the file in the order they come in horizontally in the chart. Vertically does not matter.
Further, it is important to note that their grid placement is equally important...And here is where I have some cleanup to do...the game allows for one tech above, one even and one below. Three arrows comming off of a single tech. If you have two that are slightly above or below the prereq tech, the resulkt will be a combined line that splits. This is crucial! This is even if the difference in height is a single row (by default all techs should be two rows apart)...

........B
A......C ---This works perfectly....
........D

........B
........C
A......D ---This results in two lines comming off the top third of A. Since the game only allows for three lines total this means that the lines going to B and C will both start at the same point and will simply split off of each other when they apporach their target techs...

There is more which I am trying to figure out...like how it decides WHERE to bend the lines...

Also remember that the line can never bend more than twice, and the lines must not cross!
 
TG Apple, I regret to inform you that you are completely incorrect. The logic is nowhere near that simple...I wish it were...
See the attached picture from the original unaltered tech chart:
wrong5fq.jpg

Notice the Line from Animal Husbandry to Writing?
It is most certainly not bending at the half way point.
 
Bah, so I am. Every arrow in MY tech tree bends in the middle!

Probably something to do with multiple prequesites stemming or branching, though I'm not sure quite how logic works.
 
Mylon said:
I had some problems with my mod where new techs were available at the wrong time instead of only after the proper requirements. I started over from scratch and it worked. Either the tech file doesn't like comment tags, the "goody" tag makes prerequisites behave oddly, or something else happened that messed things up.
Well I verified the bolded (and the underlined) part - had trouble with the new techs, removed the comments and voil&#224;, it works. Mind you I still can't figure out the order - it's just a trial and error for me but at least I know not to use comments. :wallbash:
 
Back
Top Bottom