So I have got the class system mostly working, I still want to add some extras (like attribute requirements for certain classes), and I need to test out the experience earning system to make sure it is all working, but to give you a little example, here is my DFHack screen showing allowed and unallowed class changes.
[DFHack]# spells/test 0 WARRIOR
Class requirements not met. SQUIRE level 1 needed. Current level is 0
[DFHack]# spells/test 0 KNIGHT
Class requirements not met. WARRIOR level 3 needed. Current level is 0
[DFHack]# spells/test 0 JUGGERNAUT
Class requirements not met. KNIGHT level 3 needed. Current level is 0
[DFHack]# spells/test 0 CLERIC
Class requirements not met. ACOLYTE level 1 needed. Current level is 0
[DFHack]# spells/test 0 PRIEST
Class requirements not met. CLERIC level 3 needed. Current level is 0
[DFHack]# spells/test 0 BISHOP
Class requirements not met. PRIEST level 3 needed. Current level is 0
[DFHack]# spells/test 0 PALADIN
Class requirements not met. KNIGHT level 2 needed. Current level is 0
Class requirements not met. PRIEST level 1 needed. Current level is 0
[DFHack]# spells/test 0 SQUIRE
Already this class
[DFHack]# spells/test 0 ACOLYTE
Class change successful. Changed from SQUIRE to ACOLYTE.
[DFHack]#
Now you might be wondering how the game knows about all your classes and such, well it is really simple! All you need is a file like this;
[CLASS:SQUIRE]
[NAME:squire]
[EXP:1000]
[LEVELS:1]
[CLASS:WARRIOR]
[NAME:warrior]
[EXP:2000:5000:8000]
[LEVELS:3]
[REQUIREMENT_CLASS:SQUIRE:1]
[AUTO_UPGRADE:KNIGHT]
[CLASS:KNIGHT]
[NAME:knight]
[EXP:12000:16000:20000]
[LEVELS:3]
[REQUIREMENT_CLASS:WARRIOR:3]
[AUTO_UPGRADE:JUGGERNAUT]
[CLASS:JUGGERNAUT]
[NAME:juggernaut]
[EXP:25000:30000:35000]
[LEVELS:3]
[REQUIREMENT_CLASS:KNIGHT:3]
[CLASS:ACOLYTE]
[NAME:acolyte]
[EXP:1000]
[LEVELS:1]
[CLASS:CLERIC]
[NAME:cleric]
[EXP:2000:5000:8000]
[LEVELS:3]
[REQUIREMENT_CLASS:ACOLYTE:1]
[AUTO_UPGRADE:PRIEST]
[CLASS:PRIEST]
[NAME:priest]
[EXP:12000:16000:20000]
[LEVELS:3]
[REQUIREMENT_CLASS:CLERIC:3]
[AUTO_UPGRADE:BISHOP]
[CLASS:BISHOP]
[NAME:bishop]
[EXP:25000:30000:35000]
[LEVELS:3]
[REQUIREMENT_CLASS:PRIEST:3]
[CLASS:PALADIN]
[NAME:paladin]
[EXP:5000:10000:15000]
[LEVELS:3]
[REQUIREMENT_CLASS:KNIGHT:2]
[REQUIREMENT_CLASS:PRIEST:1]
This tells the game how the name of the class, how many levels the class has, how much experience it takes to upgrade to the next level of the class, the requirements needed for the class, and if it is eligible for an automatic upgrade (this is basically just saying that a knight is basically a level 4 warrior, but it has a different name).
Additions I have planned for the classes are
[REQUIRED_PHYS:PHYSICAL_ATTR:#] - a certain level of physical attributes is needed
[REQUIRED_MENT:MENTAL_ATTR:#] - a certain level of mental attributes is needed
[BONUS_PHYS:PHYSICAL_ATTR:#] - gives a bonus to a physical attribute for being this class
[BONUS_MENT:MENTAL_ATTR:#] - gives a bonus to a mental attribute for being this class
[SPELLS:INTERACTION_ID:#] - allows for interactions to be learned based on the level of the class
Now unfortunately this current system requires an inorganic with certain syndromes, and some other things, but don't worry I am also working on a python script that will simply read your class file and create all necessary items!