Announcement

Collapse
No announcement yet.

Show Picture of Great X when Great X is born

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

  • Show Picture of Great X when Great X is born

    I think it would be a great idea to have a window pop up showing a picture of Moses if Moses is born in your civilization, Elvis for Elvis, etc.


    Can anyone help out with a mod like this? We just have to collect the pictures for each of the Great names (that can be my job), but we need a programmer to do the script work, anyone know how and willing?
    be free

  • #2
    I *think* I could figure it out, it seems like it should be pretty easy and would be great way for me to learn more about modding this game

    Comment


    • #3
      Sn00py,

      Sounds like an interesting idea. I figured it would be interesting to look into.

      It turns out that event handling for this is pretty straightforward. With a couple hours of my time and only a few lines of code, I was able to define a new popup window that shows up whenever the player builds a great person. (See attached.)

      The only thing I am not sure how to handle at the moment, as I haven't looked into it yet, is how to add resource information for great person pictures into the XML in a nice flexible way. I'll check it out tomorrow maybe.

      Vovan
      Attached Files
      XBox Live: VovanSim
      xbox.com (login required)
      Halo 3 Service Record (I fail at FPS...)
      Spore page

      Comment


      • #4
        A couple of hours I could've set you up with this in a few secs. Oh well, at least you probably learned a lot of useful stuff from doing it yourself... The only thing that's needed to generate the popup itself is this:
        Code:
        			popup = PyPopup.PyPopup()
        			popup.addDDS('Assets/Art/fool.dds', 0, 0, 256, 256)
        			popup.setBodyString( 'Save now, fool!' )
        			popup.launch()
        This assumes the fool.dds file exists of course (I copied this code from one of my own little private mods), but replace it with the name of the image file of the GP in question and you're in business.

        To associate a GP with an image, just keep a dictonairy in Python with the GP names as keys and the image paths as values. You can't really do this in XML.
        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

        Comment


        • #5
          Great work! OK now I will compile together all the images I can get.



          Will this become the first "most popular" mod for Civ4?


          Does anyone know where the list of the great people's names in civ4 are? - nevermind, found it
          Last edited by FrostyBoy; November 1, 2005, 06:57.
          be free

          Comment


          • #6
            Yeah very intersting!

            great job!

            Comment


            • #7
              This mod would be a great bonus

              Comment


              • #8
                Originally posted by Locutus
                A couple of hours I could've set you up with this in a few secs.
                I knew some would say something like this. In the end it's really not a lot of code at all. But you have to realize that I had no idea whatsoever what I was doing when I started.

                You can't really do this in XML.


                Well, it's a good thing you told me that, otherwise I would have spend a loooong time trying to add this stuff through XML...
                XBox Live: VovanSim
                xbox.com (login required)
                Halo 3 Service Record (I fail at FPS...)
                Spore page

                Comment


                • #9
                  Originally posted by Locutus
                  A couple of hours I could've set you up with this in a few secs. Oh well, at least you probably learned a lot of useful stuff from doing it yourself... The only thing that's needed to generate the popup itself is this:
                  Code:
                  			popup = PyPopup.PyPopup()
                  			popup.addDDS('Assets/Art/fool.dds', 0, 0, 256, 256)
                  			popup.setBodyString( 'Save now, fool!' )
                  			popup.launch()
                  This assumes the fool.dds file exists of course (I copied this code from one of my own little private mods), but replace it with the name of the image file of the GP in question and you're in business.

                  To associate a GP with an image, just keep a dictonairy in Python with the GP names as keys and the image paths as values. You can't really do this in XML.
                  Cool, I know the actual event handling was going to be a breeze, I just wasn't sure how to display an image from file. So that's all you have to do? What does DDS stand for anyway, and what kind of files does it handle?

                  Comment


                  • #10
                    Originally posted by TheDarkside
                    What does DDS stand for anyway, and what kind of files does it handle?
                    I believe it stands for Direct Draw Surface, though I might be wrong, and it handles .dds files.
                    XBox Live: VovanSim
                    xbox.com (login required)
                    Halo 3 Service Record (I fail at FPS...)
                    Spore page

                    Comment


                    • #11
                      Originally posted by vovan


                      I believe it stands for Direct Draw Surface, though I might be wrong, and it handles .dds files.
                      Ah, didn't realize it was a standardized image file, I thought it was something specific to Civ for handling jpegs/gifs/ what-not.

                      Thanks

                      Comment


                      • #12
                        Sn00py,

                        Attached is an archive with all the stuff you'll need to finish the mod (except pictures ). In the archive, you will find two things: directory GreatPersonMod (put it under My Games\Civ4\MODS) and GP_test.wbsave. If you play as the Russians in the wbsave scenario, you'll get a bunch of great people to in the first few turns, so you can test out your pictures. Note however, that you need to have the GreatPersonMod loaded for the popups to show up. There is a subdirectory in the mod folder: Assets/Art/GreatPeople. Put your images into that folder and name them according to the name of the great person, so for example, Homer.dds will show up when Homer is born.

                        I think the code is pretty much complete, the only thing that bothers me is if the great person picture is missing, it will give you a nice big pink rectangle instead of the picture. I'm not sure how to check whether a resource exists before showing the popup...

                        Vovan
                        Attached Files
                        XBox Live: VovanSim
                        xbox.com (login required)
                        Halo 3 Service Record (I fail at FPS...)
                        Spore page

                        Comment


                        • #13
                          Haven't really looked into this - but can you have an event trigger a sound effect?

                          If so it would be really cool to compile a list of quotes from/about the great people, record them, and have them play when they are created.

                          Also, I'll help out with making the person images if we decide on a common size/layout.

                          Comment


                          • #14
                            Originally posted by ixnay
                            Haven't really looked into this - but can you have an event trigger a sound effect?

                            If so it would be really cool to compile a list of quotes from/about the great people, record them, and have them play when they are created.
                            Yes. Triggering sound effects is just a matter of calling a function. It would be fairly simple to add a different sound for every great person whenever the window shows up.

                            It's a good idea, too, you think we could get Leonard Nimoy to do those voices for us too?

                            Vovan
                            XBox Live: VovanSim
                            xbox.com (login required)
                            Halo 3 Service Record (I fail at FPS...)
                            Spore page

                            Comment


                            • #15
                              Awesome.

                              This has the makings for being an excellent mod if we really put some effort into it.
                              Attached Files

                              Comment

                              Working...
                              X