Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization

Notices

Reply
 
Thread Tools
Old Feb 02, 2011, 06:52 AM   #1
vincentz
Divemaster
 
vincentz's Avatar
 
Join Date: Feb 2009
Location: Denmark
Posts: 2,527
Python Intro Movie problems

I get this after the movie have played the first time :



After the movie have played it will go into black screen and await me clicking with the mouse on the screen.

It only happens two times. after that it seem to ignore the python error.

I followed this guide :
http://forums.civfanatics.com/showthread.php?t=191978

except instead of having a customeventmanager I use the BtS' eventmanager as it is the only change I made in that file. Is it important to have your own special customeventmanager? And what would be the name/content of that?

Any clues?


This is the video (in wmv format. I binked it for the game), but I doubt there is something wrong there : Introvideo
__________________
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense." Buddha


Last edited by vincentz; Sep 28, 2011 at 02:38 AM.
vincentz is online now   Reply With Quote
Old Feb 02, 2011, 01:14 PM   #2
The_J
Say No 2 Net Validations

 
The_J's Avatar
 
Join Date: Oct 2008
Location: Germany / Netherlands
Posts: 24,995
Images: 51
Seems that something else got messed up, probably something with a hardcoded order somewhere in the .dll .

But sure isn't a problem with the CvEventManager itself, i added an intro to my mod also in the normal manager.

Did you make any .dll changes before the error appeared?
__________________
Civ4-BtS-Mod "Mars, Now!"


Steam eats the souls of little gamers!!!
The_J is offline   Reply With Quote
Old Feb 02, 2011, 01:34 PM   #3
vincentz
Divemaster
 
vincentz's Avatar
 
Join Date: Feb 2009
Location: Denmark
Posts: 2,527
nope. no dll errors as I dont use a dll

But if you made a intro then I will steal your code
__________________
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense." Buddha

vincentz is online now   Reply With Quote
Old Feb 02, 2011, 04:25 PM   #4
The_J
Say No 2 Net Validations

 
The_J's Avatar
 
Join Date: Oct 2008
Location: Germany / Netherlands
Posts: 24,995
Images: 51
You are assuming that i know what i did and that i commented it .
And i also used this tutorial, so we both must have done something similar.
Looking at my files...hmm... it seems, i did it exactly like in the tutorial, just added the code in the normal manager .
__________________
Civ4-BtS-Mod "Mars, Now!"


Steam eats the souls of little gamers!!!
The_J is offline   Reply With Quote
Old Feb 03, 2011, 04:09 AM   #5
vincentz
Divemaster
 
vincentz's Avatar
 
Join Date: Feb 2009
Location: Denmark
Posts: 2,527
I'll try to isolate the changes into a testmod and see if there is a conflict with some of my other python files.

Btw. I seem to have problems getting a nice 1:1 conversion on the moviefile when I bink it. To get a decent quality I need to go at least 200% (which is still not perfect) and if I just put the same datarate as my original wmv file (440 Kb/s) the size will explode from 2.4 to 24 MB.

Any good hints?
__________________
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense." Buddha


Last edited by vincentz; Feb 03, 2011 at 04:13 AM.
vincentz is online now   Reply With Quote
Old Feb 03, 2011, 05:19 AM   #6
vincentz
Divemaster
 
vincentz's Avatar
 
Join Date: Feb 2009
Location: Denmark
Posts: 2,527
It still comes up with a python error.

I'll post the files and the testmod in hope that I did something wrong and it can easely be spotted :

CIV4ArtDefines_Movie.xml (cut)
Spoiler:
Code:
<?xml version="1.0"?>
<!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Firaxis Games (Firaxis Games) -->
<!-- Sid Meier's Civilization 4 -->
<!-- Copyright Firaxis Games 2005 -->
<!-- -->
<!-- Movie art path information -->
<Civ4ArtDefines xmlns="x-schema:CIV4ArtDefinesSchema.xml">
	<MovieArtInfos>
		<MovieArtInfo>
			<Type>ART_DEF_MOVIE_INTRO</Type>
			<Path>Art/Movies/Intros/intro.bik</Path>
		</MovieArtInfo>
		<MovieArtInfo>
			<Type>ART_DEF_MOVIE_2K_INTRO</Type>
			<Path>Art/Movies/Intros/intro.bik</Path>
		</MovieArtInfo>
		<MovieArtInfo>
			<Type>ART_DEF_MOVIE_NVIDIA_INTRO</Type>
			<Path>Art/Movies/Intros/TheWay_720x486.bik</Path>
		</MovieArtInfo>
		<MovieArtInfo>
			<Type>ART_DEF_MOVIE_PLACEHOLDER</Type>
			<Path>Art/Movies/Placeholder.bik</Path>
		</MovieArtInfo>
......



CvIntroMovieScreen.py (all)
Spoiler:
Code:
## Sid Meier's Civilization 4
## Copyright Firaxis Games 2005
from CvPythonExtensions import *
import CvUtil
import ScreenInput
import CvScreenEnums

# globals
gc = CyGlobalContext()
ArtFileMgr = CyArtFileMgr()
localText = CyTranslator()

class CvIntroMovieScreen:
	"Intro Movie Screen"
	bMovieState = 0
	def interfaceScreen (self):
		
		self.currentMovie = "ART_DEF_MOVIE_2K_INTRO"
		self.X_SCREEN = 0
		self.Y_SCREEN = 0
		self.W_SCREEN = 1024
		self.H_SCREEN = 768
		self.Y_TITLE = 12
		self.BORDER_HEIGHT = 100
		
		self.X_EXIT = 410
		self.Y_EXIT = 326
		
		game = CyGame()
		if ( game.isNetworkMultiPlayer() or game.isPitbossHost()):
			return
		
		self.createMovieScreen(self.currentMovie)
	
	def createMovieScreen(self, movieArtDef):
	
		if CyUserProfile().getGraphicOption(GraphicOptionTypes.GRAPHICOPTION_NO_MOVIES):
			return
		
		# Create a new screen, called IntroMovieScreen, using the file CvIntroMovieScreen.py for input
		screen = CyGInterfaceScreen( "IntroMovieScreen", CvScreenEnums.INTRO_MOVIE_SCREEN )
		screen.setDimensions(screen.centerX(0), screen.centerY(0), -1, -1)
		screen.setRenderInterfaceOnly(True)
		screen.showWindowBackground( False )
		screen.setShowFor( 0 )
		
		# Show the screen
		screen.showScreen(PopupStates.POPUPSTATE_IMMEDIATE, False)		
		
		screen.setButtonGFC("Exit", u"Your movies are not installed correctly.", "", #self.EXIT_TEXT,
			self.X_EXIT, self.Y_EXIT, 400, 100, WidgetTypes.WIDGET_CLOSE_SCREEN, -1, -1, ButtonStyles.BUTTON_STYLE_STANDARD)
		
		# Play the movie
		movieFilePath = CyArtFileMgr().getMovieArtInfo(movieArtDef).getPath()
		screen.playMovie( movieFilePath, -1, -1, -1, -1, 0)
		
	def createLogoScreen(self):
                return
		
		# Show the screen
		screen.showScreen(PopupStates.POPUPSTATE_IMMEDIATE, False)
		
		# Background First
		screen.setImageButton( "LogoBackground", ArtFileMgr.getInterfaceArtInfo("MAINMENU_LOAD").getPath(), screen.centerX(0)-2, screen.centerY(0)-2, 1028, 776, WidgetTypes.WIDGET_GENERAL, -1, -1 )
		
		# Logos
		screen.setImageButton( "Logos", ArtFileMgr.getInterfaceArtInfo("INTRO_LOGOS").getPath(), screen.centerX(0)+233, screen.centerY(0)+331, 549, 294, WidgetTypes.WIDGET_GENERAL, -1, -1 )
		
		screen.addMultilineText("LegalText1", "<font=1>" + localText.getText("TXT_LEGAL_LINE_1", ()) + "</font>", screen.centerX(0)+110, screen.centerY(0)+590, 804, 200, WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)
		screen.setLabel( "LegalText2", "Background", "<font=2>" + localText.getText("TXT_LEGAL_LINE_2", ()) + "</font>", CvUtil.FONT_CENTER_JUSTIFY, screen.centerX(0)+512, screen.centerY(0)+740, -0.1, FontTypes.SMALL_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
		screen.setShowFor( 4000 )

	def closeScreen(self):
		screen = CyGInterfaceScreen( "IntroMovieScreen", CvScreenEnums.INTRO_MOVIE_SCREEN )
		screen.hideScreen()
		
	def hideScreen(self):
		screen = CyGInterfaceScreen( "IntroMovieScreen", CvScreenEnums.INTRO_MOVIE_SCREEN )
		screen.hideScreen()
	
	# Will handle the input for this screen...
	def handleInput (self, inputClass):
		screen = CyGInterfaceScreen( "IntroMovieScreen", CvScreenEnums.INTRO_MOVIE_SCREEN )
		if (inputClass.getNotifyCode() == NotifyCode.NOTIFY_MOVIE_DONE or inputClass.getNotifyCode() == NotifyCode.NOTIFY_CLICKED or inputClass.getNotifyCode() == NotifyCode.NOTIFY_CHARACTER):
			if (inputClass.getNotifyCode() != NotifyCode.NOTIFY_MOVIE_DONE):
				setNoIntroMovie(true)
			if self.bMovieState == 3:
				return self.hideScreen()
			elif self.bMovieState == 2:
				self.bMovieState = 3
				self.currentMovie = "ART_DEF_MOVIE_INTRO"
				self.closeScreen()
				self.createMovieScreen( "ART_DEF_MOVIE_INTRO" )
			elif self.bMovieState == 1:
				self.bMovieState = 2
				self.closeScreen()
				self.createLogoScreen()
			else:
				self.bMovieState = 1
				self.currentMovie = "ART_DEF_MOVIE_NVIDIA_INTRO"
				self.closeScreen()
				self.createMovieScreen( "ART_DEF_MOVIE_NVIDIA_INTRO" )
		return 0

	def update(self, fDelta):
		return


CvEventManager.py (cut)

Spoiler:
Code:
## Sid Meier's Civilization 4
## Copyright Firaxis Games 2006
## 
## CvEventManager
## This class is passed an argsList from CvAppInterface.onEvent
## The argsList can contain anything from mouse location to key info
## The EVENTLIST that are being notified can be found 


from CvPythonExtensions import *
import CvIntroMovieScreen
import CvUtil
import CvScreensInterface
import CvDebugTools
import CvWBPopups
import PyHelpers
import Popup as PyPopup
import CvCameraControls
import CvTopCivs
import sys
import CvWorldBuilderScreen
import CvAdvisorUtils
import CvTechChooser

gc = CyGlobalContext()
localText = CyTranslator()
PyPlayer = PyHelpers.PyPlayer
PyInfo = PyHelpers.PyInfo

......... (cut untill triggered events)


#################### TRIGGERED EVENTS ##################	

	def onGameStart(self, argsList):
		# display mod's intro movie
		introMovie = CvIntroMovieScreen.CvIntroMovieScreen()
		introMovie.interfaceScreen()
        	
		# display DoM message
		for iPlayer in range(gc.getMAX_PLAYERS()):
			player = gc.getPlayer(iPlayer)
			if (player.isAlive() and player.isHuman()):
				popupInfo = CyPopupInfo()
				popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
				popupInfo.setText(u"showDawnOfMan")
				popupInfo.addPopup(iPlayer)
				
	def __eventEditCityNameBegin(self, city, bRename):
		popup = PyPopup.PyPopup(CvUtil.EventEditCityName, EventContextTypes.EVENTCONTEXT_ALL)
		popup.setUserData((city.getID(), bRename))
		popup.setHeaderString(localText.getText("TXT_KEY_NAME_CITY", ()))
		popup.setBodyString(localText.getText("TXT_KEY_SETTLE_NEW_CITY_NAME", ()))
		popup.createEditBox(city.getName())
		popup.setEditBoxMaxCharCount( 15 )
		popup.launch()

..........
__________________
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense." Buddha


Last edited by vincentz; Sep 28, 2011 at 02:38 AM.
vincentz is online now   Reply With Quote
Old Feb 03, 2011, 01:41 PM   #7
The_J
Say No 2 Net Validations

 
The_J's Avatar
 
Join Date: Oct 2008
Location: Germany / Netherlands
Posts: 24,995
Images: 51
I appreciate the design of your movie.



To the problem:
In my CvIntroMovieScreen.py is, unlike in yours and the default one, this line here:
PHP Code:
        screen.setButtonGFC("Exit"u"Your movies are not installed correctly."""#self.EXIT_TEXT,
            
self.X_EXITself.Y_EXIT400100WidgetTypes.WIDGET_CLOSE_SCREEN, -1, -1ButtonStyles.BUTTON_STYLE_STANDARD
commented out.

I also commented 3 lines in handleInput out, because i think it also created some problems:
Spoiler:

PHP Code:
    def handleInput (selfinputClass):
        
screen CyGInterfaceScreen"IntroMovieScreen"CvScreenEnums.INTRO_MOVIE_SCREEN )
        if (
inputClass.getNotifyCode() == NotifyCode.NOTIFY_MOVIE_DONE or inputClass.getNotifyCode() == NotifyCode.NOTIFY_CLICKED or inputClass.getNotifyCode() == NotifyCode.NOTIFY_CHARACTER):
            if (
inputClass.getNotifyCode() != NotifyCode.NOTIFY_MOVIE_DONE):
                
setNoIntroMovie(true)
            if 
self.bMovieState == 3:
                return 
self.hideScreen()
            
elif self.bMovieState == 2:
                
self.bMovieState 3
                self
.currentMovie "ART_DEF_MOVIE_INTRO"
                
self.closeScreen()
                
self.createMovieScreen"ART_DEF_MOVIE_INTRO" )
            
elif self.bMovieState == 1:
                
self.bMovieState 2
                self
.closeScreen()
                
#self.createLogoScreen()
            
else:
                
self.bMovieState 1
                
#self.currentMovie = "ART_DEF_MOVIE_NVIDIA_INTRO"
                
self.closeScreen()
                
#self.createMovieScreen( "ART_DEF_MOVIE_NVIDIA_INTRO" )
        
return 
__________________
Civ4-BtS-Mod "Mars, Now!"


Steam eats the souls of little gamers!!!
The_J is offline   Reply With Quote
Old Feb 03, 2011, 03:13 PM   #8
vincentz
Divemaster
 
vincentz's Avatar
 
Join Date: Feb 2009
Location: Denmark
Posts: 2,527
Thank God!

I just stole your CvIntroMovieScreen.py and now everything is fine.

Thank you

edit : Ok this might sound strange, but suddenly everything is running 100% more smoothly. The graphics used to stutter a bit every 1-2 secs or so on a large map with 15 AI and high graphic settings (i only have 128 MB graphics and 1.5 GB ram)
This stutter is now completely gone. Also the response and the ai seems faster somehow. Very mysterious. Needs to be double checked tomorrow.

dbl edit : it gets stranger. I can reveal a giant map (160x100) and fly around like it was a dual map. Must be a betterAI or unofficial patch which I dont use, that made those changes. Maybe I should look into integrate those if only 1 file could make such a big change. Strange.
__________________
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense." Buddha


Last edited by vincentz; Feb 03, 2011 at 03:38 PM.
vincentz is online now   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Python Intro Movie problems

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Advertisement

All times are GMT -6. The time now is 12:38 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR