Jeckel
May 26, 2007, 05:50 AM
Various utilities I wrote to help out Python Modders, enjoy. :)
JCvConfigParser Utility (http://forums.civfanatics.com/downloads.php?do=file&id=5590)
A INI file parser and manager.
Allows easy access to options in a mod's config.ini file.
A very handy and well written utility to begin with. I rewrote it to use the python class structure so that instead of calling functions from the module, you now instance the CvConfigParser class and then call methods from the class instance.
On top of standard methods, get, getint, getfloat, and getboolean, I added 3 new methods, getlist, gettuple, and getdict. The 3 new methods smartly handle simple some input from the INI file. None, True, False, integars, and floating numbers will all be handled smartly, though imbedded lists, tuples, and dictionaries are not allowed and all dictionary keys are handled as strings.
This utility uses and requires JCvPath Utility.
JCvPath Utility (http://forums.civfanatics.com/downloads.php?do=file&id=5589)
A Civ4 Path manager.
Allows easy retrieval of Civ path strings.
Provides a class you can instance to get a CvPath object. You can then call various methods which take no arguments and return a valid path string or None. There are methods for the vanilla Civ and Warlords directories, for both the install and My Games.
Inaddition there are methods to retrieve the current Mod directory. This functionality relies on an outside finle called CvModName.py wich has a single attribute called modName that is set to a string equal to the Mod's root folder name. Without this file the Mod path retrievial methods will return like there is no mod.
JCvAlertManager Utility (http://forums.civfanatics.com/downloads.php?do=file&id=5591)
A Civ4 messaging manager.
Allows an easy way to send messages and popups to players.
Includes several methods to send messages to a player's screen in a controlable color.
Also included are methods to send simple popups to one player, a list of players, or all players.
JCvConfigParser Utility (http://forums.civfanatics.com/downloads.php?do=file&id=5590)
A INI file parser and manager.
Allows easy access to options in a mod's config.ini file.
A very handy and well written utility to begin with. I rewrote it to use the python class structure so that instead of calling functions from the module, you now instance the CvConfigParser class and then call methods from the class instance.
On top of standard methods, get, getint, getfloat, and getboolean, I added 3 new methods, getlist, gettuple, and getdict. The 3 new methods smartly handle simple some input from the INI file. None, True, False, integars, and floating numbers will all be handled smartly, though imbedded lists, tuples, and dictionaries are not allowed and all dictionary keys are handled as strings.
This utility uses and requires JCvPath Utility.
JCvPath Utility (http://forums.civfanatics.com/downloads.php?do=file&id=5589)
A Civ4 Path manager.
Allows easy retrieval of Civ path strings.
Provides a class you can instance to get a CvPath object. You can then call various methods which take no arguments and return a valid path string or None. There are methods for the vanilla Civ and Warlords directories, for both the install and My Games.
Inaddition there are methods to retrieve the current Mod directory. This functionality relies on an outside finle called CvModName.py wich has a single attribute called modName that is set to a string equal to the Mod's root folder name. Without this file the Mod path retrievial methods will return like there is no mod.
JCvAlertManager Utility (http://forums.civfanatics.com/downloads.php?do=file&id=5591)
A Civ4 messaging manager.
Allows an easy way to send messages and popups to players.
Includes several methods to send messages to a player's screen in a controlable color.
Also included are methods to send simple popups to one player, a list of players, or all players.