This is a short python script to generate random leaders. You have to have python on your computer (available for free for linux and windows, this was written in windows) to run the script. It generates a file of leaders called leaders.xxx where xxx is the three letter code that you enter when the script asks. It also asks for the maximum fire, move, shock, and siege values that you want, as well as the number of generals, admirals, conquistadors, and explorers. Random numbers are generated using the time as a seed. Rank is random between 1 and 6, admirals and explorers have 0 siege value. Leaders are created throughout the period of 1419-1819, and live between 10 and 30 years. For simplicity, all leaders appear at the start of the year. No leaders are dormant. All leaders have generic names (generals are called "general" and so on).
A warning: This script automatically overwrites the original file. If you tell it to make leaders.fra, it will write over any leaders.fra in the directory that you're running the program.
Another warning: I haven't tested this. If you do test it, let me know if you have problems. If you have ideas for additional features, also let me know.
To use: If you have python installed, then its probably easiest to save this script to the directory you want to use it, and when saving it, rename it something.py so that you can run it simply by doubleclicking. Otherwise, you'll have to run from the command line.
I'll finish this up if there's interest in it. I'll also put up a random monarch generator in a few days. Good luck.
Beta 0_2 update:
Fixed extra space in file extension.
Tested, works fine when substituting for existing leader file.
Beta 0_3 update:
Random number changed from equal weight to standard distribution, max value of 8, minimum of 1.
A warning: This script automatically overwrites the original file. If you tell it to make leaders.fra, it will write over any leaders.fra in the directory that you're running the program.
Another warning: I haven't tested this. If you do test it, let me know if you have problems. If you have ideas for additional features, also let me know.
To use: If you have python installed, then its probably easiest to save this script to the directory you want to use it, and when saving it, rename it something.py so that you can run it simply by doubleclicking. Otherwise, you'll have to run from the command line.
I'll finish this up if there's interest in it. I'll also put up a random monarch generator in a few days. Good luck.
Beta 0_2 update:
Fixed extra space in file extension.
Tested, works fine when substituting for existing leader file.
Beta 0_3 update:
Random number changed from equal weight to standard distribution, max value of 8, minimum of 1.
Attachments
Last edited: