JUnitStats: JDataKit Expansion v0.1

Jeckel

Great Reverend
Joined
Nov 16, 2005
Messages
1,637
Location
Peoria, IL
This mod is both a proff of concept for the use of JDataKit to store unit data, as well as the base building block of my JCivAtheletes Mod, which is the main component for my JWorldSports Mod. That being said, it does nothing noticable ingame and is not ment as a stand alone component.


The main function of this utility is to provide an easy way to set various Types and Stats on units when they are created. This is accomplished by setting up StatsData files. StatsData files contain a dictionary of Types, with each Type have a list of Stats as its value. This list of Stats is itered over and the file is checked for a dice rolling method for each Stat, if none is found a default dice rolling method is used to determine the Stats initial Value.

You can add as many StatsData files as you want and each StatsData file may have its own default rolling method and custom rolling methods for its perticular Stats. For more detailed explanation and examples, see the 3 StatsData files provide with the mod, PhysicalStatsData.py, MentalStatsData.py, and SocialStatsData.py.

To register a StatsData file, open CvJUnitStatsEventManager.py and find this:

Code:
# Import all the StatsData files
import PhysicalStatsData
import MentalStatsData
import SocialStatsData

and import your StatsData file here.

Then find:

Code:
##################################################
# globals

gc = CyGlobalContext()

# Register the StatsData files by putting their name as a string.
listStatsDataFiles = ["PhysicalStatsData", "MentalStatsData", "SocialStatsData"]

Add your StatsData file to the list, be sure to put quotes around it to make it a string.

Assuming your StatsData file is setup right, this will inialize and set all your Types and Stats.


File: JUnitStats_v0.1.zip
Compatible: Civ4 v1.61 and Warlords
Mod Folder: Mods\JUnitStats
Released: October 10, 2006
Size: 27.2 kb

CivFanatics: JUnitStats: A JDataKit Expansion v0.1 File Now Released
 
Top Bottom