TechWindow

Roamty

BTS
Joined
Nov 30, 2005
Messages
538
Location
South Park
Updated TechWindow to Version: TechWindow 1.g1 CvTechSplashScreen is all you need to make this work in any mod that out there. Just add the folders Assets,Python,Screens,with CvTechSplashScreen being in the Screens folder to any mod. TechWindow 1.g1 works with Vanilla, Warlords and BTS. This has Caesium corrected error fix at line 291. Use 1.g1 or 1.g. now Thankyou Caesium for the fix. Now has the Civilopedia text starting on two lines later thanks to Caesium. "Allows:" as been change to "Units" "Buildings Enabled" "Improvements" made possible by Gaurav. Thankyou Gaurav.

Techwindow 1.g1 small screen

TechWindow 1.g Almost whole screen


http://www.civfanatics.net/uploads12/TechWindow_1.g.zip

http://www.civfanatics.net/uploads12/TechWindow_1.g1.zip


Enhance TechWindow
This mod improves the TechWindow which is shown When you get a new Tech.
This mod is based on the original Tech-Erforscht-Screen by SirRethcir, and made into a mod by me.
Tech-Erforscht-Screen change to TechWindow by me.
 
Last edited:
Downloading it right now. Small but great addition to the game. :goodjob:
 
A nice little tweak. Good mod component.
 
Should as use this as a mod by putting it in the mods folder, or put it in a custom assets folder. Thanks. Otherwise a nice, helpful little addition.

"If you want the rainbow, you have to put up with the rain."

"He who limps is still walking."

"Life is like a box of chocolates, after a while it starts to get old."

"The man who thinks he can and the man who thinks he can't are both right."

The answer to life, the universe, and everything, will always be 42.
 
@Roamty,

Love the mod. Will you be updating this for version 1.61? I see a small note at the bottom of your first post that this works with version 1.61, and indeed it does when I merge it into my mod. However, it is generating a python exception when playing. something to do with the "noMovies" item in the code. See the bolded line in the code below
Code:
# globals
gc = CyGlobalContext()

class TechWindow:
    def onTechAcquired(self, argsList):
        'Tech Acquired'
        iTechType, iTeam, iPlayer, bAnnounce = argsList
        # Note that iPlayer may be NULL (-1) and not a refer to a player object
        
        # Show tech splash when applicable
#----if-Abfrage: bAnnounce-Test ausgeklammert by SirRethcir ----------------------------
 [B]       if (iPlayer > -1 and not CyInterface().noMovies()): #and bAnnounce[/B]
            if (gc.getGame().isFinalInitialized() and not gc.getGame().GetWorldBuilder2Mode()):
                if ((not self.bMultiPlayer) and (iPlayer == CyGame().getActivePlayer())):
                    popupInfo = CyPopupInfo()
                    popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
                    popupInfo.setData1(iTechType)
                    popupInfo.setText(u"showTechSplash")
                    popupInfo.addPopup(iPlayer)
                
        if (not self.__LOG_TECH):
            return
        CvUtil.pyPrint('%s was finished by Team %d' 
            %(PyInfo.TechnologyInfo(iTechType).getDescription(), iTeam))

Here is the error that it generates
Code:
 File"Tech Window", line 20, in onTech Acquried
Attribute Error'CyInterface', object has no attribute 'noMovies'

I think that the "noMovies" attribute was removed in version 1.61.

Again, love the mod, any help you can give is appreciated :D
 
That's great, Roamty. Would you be interested in helping us (me) with a tweak in a different direction on the tech popup window? I was hoping to use the tech popup in our Mod as a way to lay out the story of colonizing a planet, and since we don't have movie-making skills (and, as Amra points out, they removed that part anyway), I was thinking of doing it through the tech popup quote, e.g. instead of there being a quote, there would more of a story like:
String Theory
"...so this mathematical framework has proven to be more than an abstract concept. In fact, the practical applicatons are quite astounding."
"For example?"
"For example: string theory's fifth corollary has provided us with the science we needed to begin designing what ApPhys Team Beta has dubbed 'Resonance Shielding.' Our models suggest that this Shielding will protect standard electronic devices against the effects of the Lattice."
(Excited murmurs.)
"Very well, Dr. Chamdra. You have your funding to continue your research."
One option would be to make the text part of this window bigger, and either put this in the quote or in the 'pedia entry and display one or both. Another would be simply to put a link to the 'pedia entry for the tech with a customizable text key -- for example, the quote could be the beginning of the story, and there would be a "continue reading..." link so people who want to skip this can (and probably most would, my fiction-writing desires notwithstanding :p)

Any thoughts on that?
 
Thankyou Amra the fix is a small one. The File "TechWindow" on line 20, I change "no Movies" to "noTechSplash". Also line 22 I change to this
if ((not CyGame().isNetworkMultiPlayer()) and (iPlayer == CyGame().getActivePlayer())):

from this
if ((not self.bMultiPlayer) and (iPlayer == CyGame().getActivePlayer())):
 
Roamty said:
Thankyou Amra the fix is a small one. The File "TechWindow" on line 20, I change "no Movies" to "noTechSplash".

Thanks for updating it. It is much appreciated :goodjob:
 
For Mikezang no TechWindow 1.a does not support 1.52 it is for patch 1.61 use TechWindow for the patch 1.52
 
Hi Roamty,

I get the Python exception:
CyGame object has no attribute GetWorldBuilder2Mode

... and I see that CyGame does have the attribute "GetWorldBuilderMode"

I'm going to remove the "2" and see if it runs.

Cheers,
Spocko

PS: this mod for 1.52 was great - looking forward to using it in 1.61

PPS: Also, I commented out the check on self_LOG or whatever... and then finally I used only the CvTechSplash file to modify my 1.61 version of the file (ignored TechWindow.py) and it works fine. When I tried using TechWindow, the TechSplash appeared twice - that and the fact I had to comment out the code at the bottom where it writes to the LOG plus removing the "2", I figured I didn't need the TechWindow.Py file :)

While I sound ungrateful - I'm not! In fact, I need your help with a question :) How could I make the TechSplash window wider (almost touching both sides of the screen) so that more improvements can be shown horizontally without the little scroll bar underneath being needed?

PPPS: Got it. Here's the relevant XML code (I'm using a 1280x1024 screen...)
Code:
	def __init__(self, iScreenID):
		self.nScreenId = iScreenID
			
		self.iTech = -1
		self.nWidgetCount = 0
		
		# widget names
		self.WIDGET_ID = "TechSplashScreenWidget"
		self.SCREEN_NAME = "TechSplashScreen"
		self.EXIT_ID = "TechSplashExit"
		
		self.X_SCREEN = 17  #   117                                                                                     # Spocko 205
		self.Y_SCREEN = 27
		self.W_SCREEN = 1400     # 1200                                                                               # Spocko 1024
		self.H_SCREEN = 768
		self.Z_BACKGROUND = -1.1
		self.Z_CONTROLS = self.Z_BACKGROUND - 0.2
		self.DZ = -0.2
		
		self.Z_HELP_AREA = self.Z_CONTROLS - 2
		self.W_HELP_AREA = 200
		
		# Panels
		
		self.iMarginSpace = 15
		
		self.X_MAIN_PANEL = 17  #   117                                                                             # Spocko 205
		self.Y_MAIN_PANEL = 55
		self.W_MAIN_PANEL = 996        #796                                                                        # Spocko 620
		self.H_MAIN_PANEL = 545
		
		# Upper Panel
		
		self.X_UPPER_PANEL = self.X_MAIN_PANEL + self.iMarginSpace
		self.Y_UPPER_PANEL = self.Y_MAIN_PANEL + self.iMarginSpace
		self.W_UPPER_PANEL = self.W_MAIN_PANEL - (self.iMarginSpace * 2)
		self.H_UPPER_PANEL = 200
		
		self.X_TITLE = self.X_MAIN_PANEL + (self.W_MAIN_PANEL / 2)
		self.Y_TITLE = self.Y_UPPER_PANEL + 12
		
		self.W_ICON = 64 # 90
		self.H_ICON = 64  # 90
		self.X_ICON = self.X_UPPER_PANEL + 134                                                      # Spocko 56 # 23 #42
		self.Y_ICON = self.Y_UPPER_PANEL + (self.H_UPPER_PANEL / 2) - (self.H_ICON / 2) + 17
		
		self.X_ICON_PANEL = self.X_UPPER_PANEL + self.iMarginSpace + 2
		self.Y_ICON_PANEL = self.Y_UPPER_PANEL + self.iMarginSpace + 33
		self.W_ICON_PANEL = 300   #  200   per Roamty                                                          #  Spocko was 140
		self.H_ICON_PANEL = 135 # self.H_MAIN_PANEL - (self.iMarginSpace * 2)
		
		self.X_QUOTE = self.X_UPPER_PANEL + self.W_ICON_PANEL + (self.iMarginSpace * 2)
		self.Y_QUOTE = self.Y_UPPER_PANEL + self.iMarginSpace + 36
		self.W_QUOTE = 500                                                                                               #  Spocko was 400
		self.H_QUOTE = self.H_UPPER_PANEL - (self.iMarginSpace * 2) - 38
 
Roamty said:
For Spocko try version TechWindow 1.a with your changes it did work for me with no TechSplash or Python error.

Thanks Roamty,
Actually, I did use v1.a, and had different results than you (and I have about 35 other modpacks cooked into my own fusion mod, so I may have interference from another mod - but still, there's only that one call from my eventmanager...). Everything works great just by incorporating CvTechSplash.py into my mod, and the screen is even more satisfying now that I've made it wider.

What is the purpose of the TechWindow file? From my limited understanding of Python, it seems to be concerned mostly with determining whether or not the game is an MP game... I'd like to know more about this file, for I know you would not have worked so hard on the code just to check for whether the game was MP :blush:

Great mod and thanks for your time developing it!
Spocko
 
Roamty said:
TechWindow 1.c works with new patch 1.61, and with Warlords.
That's great to hear! Thanks for the good work. :goodjob:
 
Top Bottom