[MOD] GreatPersonMod with RenamerMod

Patricius said:
Thankyou very much in advance for your reply.

Patricius

I tried to send this as a message, but your inbox is full, and the info seems like it might belong on the main thread anyway, so I'm posting it here.

If I sounded abrupt or critical in the previous message, please accept my apologies -- I'd love to see this mod working completely with pictures for the actual great people and randomly generated names with the generic pictures once they run out.

I love the mod; I only downloaded it yesterday, but playing in Python to figure out how to avoid the Pink screen of death was fun, and it really adds to the flavour of the game when the great people pop ups happen -- seems so much more exciting. Great idea.

If the code I sent (modulo whatever mistakes I made) works, then the only outstanding issues with the Mod that I see are:

1. If someone adds names to their XML files (e.g. in CustomAssets), you won't have pictures, but their will be a unique name, so we'll get the Pink screen of death. It would be nice to detect that situation and show the generic pic, but I have no idea whatsoever how to go about doing that.

2. If someone adds a great person type, right now, you'll get a pink screen for all the names they put in the XML (unless they add pictures for each name). Once they run out of names, it will try to find the image "Great General"; if that is there, then it would show that. If we could detect whether there is a file with a certain name, then we could easily display:

A - The image for the named person if we have it.
B - A generic "Great Artist", "Great General", etc. if we have that.
C - A generic "Great Person" pic if there is no "Great General" in the directory.

I think that if that behaviour could be attained, then the mod would be "complete", in that it would do sensible things even if people added their own names or great person types in the XML, whether there were images in the directory for them or not. If someone is using this mod as part of their own mod, all they'd have to do is add the names to the XML files, and they'd get "Great Person" shots for their new type; by adding a "Great General" image, they'd get that image for their new type, and anyone for whom they'd add a specific individual image, they'd get that.

Unfortunately, all this requires being able to find out whether the necessary file exists before trying to load it into the interfaceScreen (or detecting that the load failed). Fortunately, if we can do that, then we should be able to get the behaviour I was talking about above, which would be very cool, and, I think, make this a very well behaved, very complete mod component.
 
how can i load this mod every time i start the game?
i need a detailed explanation plz...i suck at comp :confused:
 
imagine83 said:
how can i load this mod every time i start the game?
i need a detailed explanation plz...i suck at comp :confused:

Assuming your OS is some variant of Windows, three Options:

1. Slow, slightly annoying.
Load Civ IV.
Go to Advanced.
Load Mod, select GreatPersonMod
Wait for CIV IV to re-load.

2. Much better, loads mod automatically.
Make a copy of the CIV IV shortcut you are using to boot the game.
(right click, select copy, then on background of folder, right click and paste)
Rename the copy to CIVIVGreatPersonMod or something
Right-click on the new CIVIV shortcut, and select properties.
Look at where it says TARGET:
Mine says:

"C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Civilization4.exe"

After the text that is there, type in a space, and then

"mod=\Mods\GreatPersonMod"

The final line will look something like

"C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Civilization4.exe" "mod=\Mods\GreatPersonMod"

You *do* need the quotes as shown; they aren't there just to show you what to type!

Assuming that you've put it in the Mods directory and not renamed the mod, then once you've done this, you'll have two shortcuts: your original one, which will load CIV IV with no mods, and the new one, which should load the Great Person Mod when it boots.

3. If you never want to load vanilla civ again, you could move the mod to the CustomAssets folder, but I think that solution 2 is much cleaner.

If you were asking about running this in conjunction with othe mods, that is a lot more complicated :-(
 
Hi guys, I just wanted to let you know, I am working on updating this mod, which would include Lopez's Randam Great Person renamer, and hooking those random names to a generic pic already created. I am looking at different ways of doing this, and I am trying to figure it out with some help from more experieced programmers. I feel that with those abiities added, this mod would finally be complete.
Sincerely,
Patricius
 
Patricius said:
Hi guys, I just wanted to let you know, I am working on updating this mod, which would include Lopez's Randam Great Person renamer, and hooking those random names to a generic pic already created. I am looking at different ways of doing this, and I am trying to figure it out with some help from more experieced programmers. I feel that with those abiities added, this mod would finally be complete.
Sincerely,
Patricius
Good stuff, can't wait :thumbsup:
 
GreatPersonModwithRenamerMod

Name:GreatPersonModwithRenamerMod
Version:1.0
Release Date: 5-21-06
Author:Patricius
Short Description:
Whenever a great person, such as a great artist or prophet is born in any of YOUR cities, a window will popup, showing you a picture and a quote from the great person.Also, when all unique names are used a up, a civ-specific random name will be used with a generic picture.
Credits:
Snoopy, for starting this mod
RobO for helping smooth out code of CustomEventManger
TheLopez for renamer mod
Scottcstoness for his work on fixing pinkscreen problem
Much thanks to Tableist and Alerum68 for helping find quotes

Download Mirror 1: Uploading.com
Download Mirror 2: Civfanatics Server
Download Mirror 3: Pending approval on 3d Downloads.com

Make sure you read the installation instructions carefully.

Description
After many wrong turns and dead ends, the first release of GreatPersonMod with RenamerMod is complete. Although very similar to TheGreatPersonMod, which contain around 170 pics and quotes of the most famous people throughout histroy, this mod adds many new features which really complete the mod.

View attachment 127489 View attachment 127488

Among these are TheLopez's Renamer mod, which when used with Generic Pics, eleminates those pink screens at the end of the game that appear once all the Unique names are used up.

This mod also is now much more compatible with other mods. The Custom Event Manager is used, and all changes have been noted, for better merging.
Also, if you want to add extra great people's names in the XML, it is much easier to use this mod with it. If you also provide a picture, it will load the provided picture, otherwise, it will just load the generic picture. You only have to add new XML names, you don't have to do anything with the artwork unless you want to, and if you do, they just have to stick the right image in the GreatPeople directory.

It is also easier If you want to add new great people types. Assuming you do it properly, so you have type UNIT_GENERAL, for example, then if you give them names and add pictures, it should find them, if there are no pictures, it will use the "Great General.dds" file, assuming you provide that, and if you don't, it will use the "Great Person.dds" file.

View attachment 127490

All in all, this release is finally worthy to be called complete, and, I hope that you will enjoy the historical immersion that this adds to the game. So Please comment on what you think, and what you think could improve this even more.








Install Instructions:
-------------------------
Unzip the contents into Program Files\Firaxis Games\Civilization IV\MODS
Run GreatPersonArtPath .bat file by clicking on it.(Very Important to do)This file is located inside the folder, where the .ini file is.
It is important that you run this .bat file once, or the mod will not work. It is the only way i could get the mod to accept different pics once the unique names run out.

Running the Mod
---------------------
1. Start Civilization IV
2. From the menu, go to advanced, then click on Load a Mod
3. Load GreatPersonModwithRenamerMod
4. Civilization IV will restart
5. Start a game as usual

Note that everytime you want to play your game, Civilization IV will have to restart and load the mod.


The file size of this Mod is roughly 43mb. (17mb compressed)
 
Now that I am finally finished basically with this mod, I would like to ask people what other Great People Graphics that they would like to see. If you have a favorite new Great Person Mod, I will make new graphics and post them at the top of the thread.

Sincerely,
Patricius
 
You can get CIV IV to load the GreatPersonwithRemamerMod directly by:

1) Create a new short-cut to CIV IV (just copy and paste the existing one)
2) Right-click and select Properties
3) Edit the "Target" line to read:

"C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Civilization4.exe" "mod=\Mods\GreatPersonModwithRenamerMod"

Where you don't change the first part; leave it as whatever it is at, but add in the "mod=XX" part, where you actually add the mod directory: although, if you follow the instructions above, what I have listed there is the mod directory.

I'm just lazy, and I'd rather be able to click on a short-cut that loads the mod directly than wait for CIV IV to load twice!
 
Thanks for this Mod component.

We have implemented it in the Realism Mod. However why would i need the cvGPArtPath.py? Nothing is pointing toward it? And the file doesn't "replace" any of the original files either. So what is the deal with it?

Thanks
Houman
 
Houman said:
Thanks for this Mod component.

We have implemented it in the Realism Mod. However why would i need the cvGPArtPath.py? Nothing is pointing toward it? And the file doesn't "replace" any of the original files either. So what is the deal with it?

Thanks
Houman

It's just a convenient place to stick a variable that holds the path to the .dds files; that way we can use a os.path.exists call to check whether the .dds file corresponding to the Great Person's name exists; if it doesn't, it defaults to the "Great Artist" / "Great Prophet" pic, and if the "Great General" pic doesn't exist, for example, then it will load the generic "Great Person" pic.

The cvGreatPersonScreen.py file opens up cvGPArtPath.py to snag the path to the images.

The .bat file that you need to run creates this file and sets the variable appropriately; if you move the mod to a different place (e.g. a different mod directory or into custom assets), you just re-run the .bat file.
 
scottcstoness said:
It's just a convenient place to stick a variable that holds the path to the .dds files; that way we can use a os.path.exists call to check whether the .dds file corresponding to the Great Person's name exists; if it doesn't, it defaults to the "Great Artist" / "Great Prophet" pic, and if the "Great General" pic doesn't exist, for example, then it will load the generic "Great Person" pic.

The cvGreatPersonScreen.py file opens up cvGPArtPath.py to snag the path to the images.

The .bat file that you need to run creates this file and sets the variable appropriately; if you move the mod to a different place (e.g. a different mod directory or into custom assets), you just re-run the .bat file.


There must be an easier way. Why don't you use relative path instead of absolute path?

Regards
Houman
 
Houman said:
There must be an easier way. Why don't you use relative path instead of absolute path?

Regards
Houman

What directory does CIV IV run in? How do we know what subdirectory the mod is in? Running a .bat file once is pretty easy. You just click on it, then never have to worry about it again.

Don't get me wrong, if there is an easier way to do it, I'm all for it! I came up with the .bat thing after looking through the code in the standard Renamer Mod that tried to find the directory with the current mod in it, and this seemed easier.
 
Well the Mod is supposed to be always under /Mods directory.
Don't get me wrong but the way it is implemented now it can only be used as a single mod and never as a Mod component. Besides as you already can see there is a user just above who has problems with it.

I will propose this problem to our team, if there is a better solution, I will let you know. ;)

Thanks
Houman
 
Houman said:
Well the Mod is supposed to be always under /Mods directory.
Don't get me wrong but the way it is implemented now it can only be used as a single mod and never as a Mod component. Besides as you already can see there is a user just above who has problems with it.

I will propose this problem to our team, if there is a better solution, I will let you know. ;)

Thanks
Houman

Actually, I wrote it that way so that it could easily be used as a mod component; so long as the directory structure is the same beneath the directory in which the .bat file is run (which it better be, or the code won't find the pictures either!), it should work, whether run as its own Mod or as part of another mod; all that needs to happen is to run the .bat file or initialize the cvGPArtPath.py file in some other way appropriate to the mod that is being run.

If there is a better way to do it, I'd love to find out; this seemed a much better way than hard-coding Mods/GreatPersonwithRenamerMod as part of the path; this way if you want to include it in another mod, it will pick up whatever directory the .bat file is being run in, then add the Assets/Art/GreatPeople relative path to it...

I'm not convinced there isn't some way to use cvArtFileMgr to find out if the file has been loaded or not, because from some of the testing that I did, it seemed like Civ was pre-loading the Art Files; changing the Art files while civ was running resulted in a pink GP screen because the code knew that the file was in the directory, but Civ couldn't find it. So, there might be a way to find out if a certain art file exists through the ArtFileMgr; I looked, but couldn't find any documentation on it, and thought that running a single set .bat file wouldn't be too egregious if we couldn't find another way to accomplish the same task.

Anyway, I just wanted to let you know that the whole point of the .bat file was so that it *could* easily be incorporated inside another mod as a mod component (albeit with the annoyance of having to run the .bat file).

Keep me updated on whether or not there is a cleaner way to do this, because I'm definitely interested...
 
scottcstoness said:
Actually, I wrote it that way so that it could easily be used as a mod component; so long as the directory structure is the same beneath the directory in which the .bat file is run (which it better be, or the code won't find the pictures either!), it should work, whether run as its own Mod or as part of another mod; all that needs to happen is to run the .bat file or initialize the cvGPArtPath.py file in some other way appropriate to the mod that is being run.

If there is a better way to do it, I'd love to find out; this seemed a much better way than hard-coding Mods/GreatPersonwithRenamerMod as part of the path; this way if you want to include it in another mod, it will pick up whatever directory the .bat file is being run in, then add the Assets/Art/GreatPeople relative path to it...

I'm not convinced there isn't some way to use cvArtFileMgr to find out if the file has been loaded or not, because from some of the testing that I did, it seemed like Civ was pre-loading the Art Files; changing the Art files while civ was running resulted in a pink GP screen because the code knew that the file was in the directory, but Civ couldn't find it. So, there might be a way to find out if a certain art file exists through the ArtFileMgr; I looked, but couldn't find any documentation on it, and thought that running a single set .bat file wouldn't be too egregious if we couldn't find another way to accomplish the same task.

Anyway, I just wanted to let you know that the whole point of the .bat file was so that it *could* easily be incorporated inside another mod as a mod component (albeit with the annoyance of having to run the .bat file).

Keep me updated on whether or not there is a cleaner way to do this, because I'm definitely interested...

as houman promised, he ask me to look in this mod component and you are right, there is no way how to obtain mod name within python
but in realism mod i update this mod using Dr Elmer Jiggle utils (CvPath and CvConfigParser) - this utils is used in almost modpacks which i test.
In this methods is used file CvModName (similar to your CvArtGraph...), but this file only sets name of directory where mod is installed (not absolute path).

His utils also can set all assets path (default directory, user directory etc...)
my idea is: if player don't know how to merge mods, he also don't want to rename default directory for this mod, so CvModName can be set correctly by default. If player can merge with other mod, he also know, how to setup this. And if this mod is used in modpack, CvModName is probably setup correctly anyway

in my changes, i am using CvPath for searching for images in all possible directories. now I am testing my changes, if you are interesting about this, i can send you my work

Mexico from Realism team
 
Mexico said:
as houman promised, he ask me to look in this mod component and you are right, there is no way how to obtain mod name within python
but in realism mod i update this mod using Dr Elmer Jiggle utils (CvPath and CvConfigParser) - this utils is used in almost modpacks which i test.
In this methods is used file CvModName (similar to your CvArtGraph...), but this file only sets name of directory where mod is installed (not absolute path).

His utils also can set all assets path (default directory, user directory etc...)
my idea is: if player don't know how to merge mods, he also don't want to rename default directory for this mod, so CvModName can be set correctly by default. If player can merge with other mod, he also know, how to setup this. And if this mod is used in modpack, CvModName is probably setup correctly anyway

in my changes, i am using CvPath for searching for images in all possible directories. now I am testing my changes, if you are interesting about this, i can send you my work

Mexico from Realism team


Yes, that is pretty much what I did in this one. No bug reports yet...
 
Patricius -- downloaded your mod a few days ago and started a new game with it. In a word, outstanding.:goodjob:

This is a mod that Firaxis should acquire and roll into the codebase. Completely in keeping with the rest of the game and an excellent addition of a bit more history.

Thanks for all the time and effort you and the others put in making it. :)
 
Hi Ancient Player, thanks so much for your positive feedback.

I am sorry to say that because of medical problems in the family, I am unable to put in the time to keep this mod up to date or to upgrade it any more. I have thouroughly enjoyed the time I have spent creating it and i want to thank all those who helped me in the task. I would like to invite someone who wishes to update this when new patches come out, or to upgrade it with new feature, to do so if you wish. Any takers on taking over this mod? At the moment, this does not invlove any work, unless you feel you can improve on the work. I herby give up all claim on this mod, and I hope that it can continue to add a whole new aspect to civ 4, into the future.
Sincerely,
Patricius
 
Patricius said:
Hi Ancient Player, thanks so much for your positive feedback.

I am sorry to say that because of medical problems in the family, I am unable to put in the time to keep this mod up to date or to upgrade it any more. I have thouroughly enjoyed the time I have spent creating it and i want to thank all those who helped me in the task. I would like to invite someone who wishes to update this when new patches come out, or to upgrade it with new feature, to do so if you wish. Any takers on taking over this mod? At the moment, this does not invlove any work, unless you feel you can improve on the work. I herby give up all claim on this mod, and I hope that it can continue to add a whole new aspect to civ 4, into the future.
Sincerely,
Patricius

Patricius, I'm sorry to hear about the medical problems in your family. I hope that everything goes well and you get a chance to join the CFC community again in the near future.
 
Back
Top Bottom