Resource icon

JCvPath v0.200: A Modder's Utility 2016-10-05

JCvPath v0.200

Expansion Compatibility:All
Patch Compatibility: All

This module has several classes that implement an easy way
to retrieve Path Strings for basic Civ4 Directories.

This module was based on CvPath from Civilization IV Alerts
mod by Gillmer J. Derge (on CivFanatics aka "Dr. Elmer Jiggle's")
and should be compatable with the CustomEventManager also by
Gillmer J. Derge.

To determine the active Mod the Mod must contain a CvModName.py
file and the CvModName.py file must have an modName attribute with
a value of a string that is the same as the name of the Mod's root
folder.
For example, if you have a Mod and it is in the Mods/MyMod folder
then in the CvModName.py file
modName = "MyMod"

To use this module you import it and then instance the class CvPath.
The constructor takes no arguments.
import CvPath
pPath = CvPath.CvPath()
You then call its methods like any other class.

The supported methods are:
Basic Path Methods:
getCWD()
"Returns a Path String"
Returns the path to the Current Working Directory.
Note that for some reason the game doesn't give the
acual working directory. It gives the current install
directory.

getDirList(sPath)
"Returns a list of Path Strings or an empty list"
This takes the Path to a Directory and returns a list of Subdirectories
that contain 1 or more files.

getMyDocuments()
"Returns a Path String"
The Path to the My Documents Directory for the host's current user.

getMyGames()
"Returns a Path String"
The Path to the My Games Directory for the host's current user.

Vanilla Civ4 Path Methods:
isCiv()
"Returns True or False"
Returns True if Vanilla Civ4 (ie no Warlords, Beyond the Sword, ect) is running.

getCivDir()
"Returns a Directory String"
Returns the name of the Directory that Civ4 was installed in.

getCiv()
"Returns a Path String"
The Path to Vanilla Civ4 install Directory.

getCivAssets()
"Returns a Path String"
The Path to Vanilla Civ4 Assets Directory.

getCivMods()
"Returns a Path String"
The Path to Vanilla Civ4 Mods Directory.

getMyCiv()
"Returns a Path String"
The Path to Vanilla Civ4 My Games Directory.

getMyCivAssets()
"Returns a Path String"
The Path to Vanilla Civ4 My Games CustomAssets Directory.

getMyCivMods()
"Returns a Path String"
The Path to Vanilla Civ4 My Games Mods Directory.

Warlords Path Methods:
isWarlords()
"Returns True or False"
Returns True if Warlords is running.

getWarlordsDir()
"Returns a Directory String"
Returns the name of the Directory that Warlords was installed in.

getWarlords()
"Returns a Path String"
The Path to Warlords install Directory.

getWarlordsAssets()
"Returns a Path String"
The Path to Warlords Mods Directory.

getWarlordsMods()
"Returns a Path String"
The Path to Warlords Mods Directory.

getMyWarlords()
"Returns a Path String"
The Path to Warlords My Games Directory.

getMyWarlordsAssets()
"Returns a Path String"
The Path to Warlords My Games CustomAssets Directory.

getMyWarlordsMods()
"Returns a Path String"
The Path to Warlords My Games Mods Directory.

Beyond the Sword Path Methods:
isBtS()
"Returns True or False"
Returns True if BtS is running.

getBtSDir()
"Returns a Directory String"
Returns the name of the Directory that BtS was installed in.

getBtS()
"Returns a Path String"
The Path to BtS install Directory.

getBtSAssets()
"Returns a Path String"
The Path to BtS Mods Directory.

getBtSMods()
"Returns a Path String"
The Path to BtS Mods Directory.

getMyBtS()
"Returns a Path String"
The Path to BtS My Games Directory.

getMyBtSAssets()
"Returns a Path String"
The Path to BtS My Games CustomAssets Directory.

getMyBtSMods()
"Returns a Path String"
The Path to BtS My Games Mods Directory.

Mod Path Methods:
getModName()
"Returns a Mod Name String or None"
Returns the name of the currently running Mod.
Note that the Mod Name String is taken from the CvModName file
and will return as None if the file or attribute is missing.

The rest of the Mod Path Methods only read Mods run from the
install Mod Directories and ignore Mods run from the My Games Mod Directory.

getMod()
"Returns a Path String or None"
Returns the Path to the root Directory of the currently running Mod.

getModAssets()
"Returns a Path String or None"
Returns the Path to the Assets Directory of the currently running Mod.

getModConfig()
"Returns a Path String or None"
Returns the Path to the Config Directory of the currently running Mod.

isMod()
"Returns True or False"
If a Mod Name is found in a CvModName.py file and that Mod Name
corisponds to a valid Mod Directory then this will return True.
Author
Jeckel
Downloads
108
Views
260
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Jeckel

Back
Top Bottom