1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Adding Intro movies to mods

Discussion in 'Civ4 - Modding Tutorials & Reference' started by Dale, Nov 6, 2006.

  1. Dale

    Dale Deity

    Joined:
    Mar 14, 2002
    Messages:
    7,041
    Tutorial: How to add an intro movie to a mod

    This tutorial will run through the process of adding an intro movie to a mod. The movie will play full screen after loading the mod, but before the "Dawn of Man" screen.

    To add an intro movie we will need the following in our mod:
    1. \assets\python\screens\CvIntroMovieScreen.py
    2. \assets\python\CustomEventManager.py
    3. \assets\art\movies\intros\Movie.bik
    4. \assets\xml\art\CIV4ArtDefines_Movie.xml

    CvIntroMovieScreen.py

    Firstly, using this tutorial it will produce one screen to play an intro movie on. There's the possibility of more, but this tutorial doesn't cover it. Play around with it and I'm sure you'll get it. :)

    In CvIntroMovieScreen.py we need to change one thing:
    1. Change the following command to this (delete or comment out the existing code):
    Code:
    	def createLogoScreen(self):
                    return
    
    This eliminates the legal logo screen. As it was displayed when starting Civ4 it's not needed.

    CustomEventManager.py

    I am assuming you already have your own python event manager and it's working correctly.
    1. Add the following (this code will end up displaying the movie and then the DoM screen. If you don't want the DoM screen do not add that bit of code):
    Code:
    import CvIntroMovieScreen
    ..
    ..
    ..
    	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)
    
    Movie

    The movie has to be in Bink (bik) format. Use Rad Game Tools to create your movie. This tutorial does not cover the use, refers to that apps help files. http://www.radgametools.com

    CIV4ArtDefines_Movie.xml

    1. This is the easy bit. Point both intro movie tags in this file to your custom movie.
    Code:
    		<MovieArtInfo>
    			<Type>ART_DEF_MOVIE_INTRO</Type>
    			<Path>Assets/Art/Movies/Intros/intro.bik</Path>
    		</MovieArtInfo>
    		<MovieArtInfo>
    			<Type>ART_DEF_MOVIE_2K_INTRO</Type>
    			<Path>Assets/Art/Movies/Intros/intro.bik</Path>
    		</MovieArtInfo>
    
    And that's it. :)

    Dale
     
  2. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    It's exactly what i needed thx bro :)
     
  3. NeverMind

    NeverMind Proud to be Russian

    Joined:
    Apr 29, 2005
    Messages:
    618
    Gender:
    Male
    Location:
    Moscow, Russia
    I couldn't imagine it's so easy. Thank you, Dale!
     
  4. AndyTerry

    AndyTerry Russian Bear

    Joined:
    Feb 1, 2006
    Messages:
    601
    Location:
    St. Petersburg, Russia
    \assets\python\CustomEventManager.py

    There's no such file in original Civ game.
     
  5. AndyTerry

    AndyTerry Russian Bear

    Joined:
    Feb 1, 2006
    Messages:
    601
    Location:
    St. Petersburg, Russia
    Should I replace this:
    Code:
    	def createLogoScreen(self):
    		screen = CyGInterfaceScreen( "IntroMovieScreen", CvScreenEnums.INTRO_MOVIE_SCREEN )
    		screen.setDimensions(screen.centerX(0), screen.centerY(0), 1024, 768)
    		screen.setRenderInterfaceOnly(True)
    		screen.showWindowBackground( False )
    With this:
    Code:
    	def createLogoScreen(self):
                    return
    ?
     
  6. Dale

    Dale Deity

    Joined:
    Mar 14, 2002
    Messages:
    7,041
    Yes, that's correct. :) The whole function is removed and replaced with the return statement.

    As for the custom event manager, when implementing python in Civ4 you need to create your own event manager. This is what I'm refering to when I state "CustomEventManager.py". EG: In my Age of Discovery mod, this file is called AoDEventManager.py.

    Dale
     
  7. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    Very useful. Thanks for posting ;)
     
  8. Arian

    Arian No more ghostbusting!!

    Joined:
    May 10, 2008
    Messages:
    2,088
    Location:
    The Netherlands
    Sorry for digging this up but does it work for 3.13/3.17??
    I can't get it to work with 3.13 :(
     
  9. Wolfshanze

    Wolfshanze CFC Historian

    Joined:
    Nov 12, 2001
    Messages:
    5,689
    Location:
    Florida
     
  10. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    I saw that intro movie is in Dale's RtW - maybe you can figure it that there what was changed in bts ;)
     
  11. peteandbill

    peteandbill Chieftain

    Joined:
    Feb 12, 2008
    Messages:
    45
    For some reason none of the movies in my civ game work .... i don't know why ... they've been doing this for a while ... any suggestions?

    Also, will it work if i just copy the original event manager into my mod and add the method at the bottom?
     
  12. Bangra 7

    Bangra 7 The Port Of Call

    Joined:
    Aug 28, 2008
    Messages:
    213
    Gender:
    Male
    Location:
    Raleigh, North Carolina
    How do I edit *.py files?
     
  13. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    notepad will work
    but something better notepad-like is recommended (i use pspad)
     
  14. peteandbill

    peteandbill Chieftain

    Joined:
    Feb 12, 2008
    Messages:
    45
    how do you make a custom event manager?
     
  15. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    20,922
    I hate to ressurect a dead thread, but it is the closest one to what I am looking for.
    In the intro movie, can music be included in the bik or do I have to define it separatly
     
  16. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    32,643
    Location:
    DE/NL/FR
    Why not just create a .bik with sound?
     
  17. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    20,922
    Thanks, I didn't know if I could do that because in civ there are separate definitions for movies and sound although that may only apply to the religion movies. Do you know if they are handled differently?
     
  18. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    32,643
    Location:
    DE/NL/FR
    Sorry, no idea there :dunno:.
    But the religion movies are .nif files, and not .bik files, so it's probable, that they are handled different.
     
  19. Ricemon

    Ricemon Chieftain

    Joined:
    Feb 26, 2008
    Messages:
    71
    Is there anyway to enable intro movies RIGHT AFTER mod loads and RIGHT BEFORE the mod's main menu? As I know, it is disabled as the default setting.
     
  20. Ajidica

    Ajidica High Quality Person

    Joined:
    Nov 29, 2006
    Messages:
    20,922
    Without hacking the exe I don't believe it is possible. At least, I don't know of any mods that do that.
     

Share This Page