Resource icon

JUnitStats: A JDataKit Expansion v0.1 2016-10-05

Compatability: Civ4 v1.61 and Warlords

JUnitStats Modcomp Thread

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:

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

Import your StatsData file here.

Then find:

#################################################
# 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.
Author
Jeckel
Downloads
235
Views
235
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Jeckel

Top Bottom