[MODCOMP] Professions Mod: Journeyman

Kailric

Jack of All Trades
Joined
Mar 25, 2008
Messages
3,100
Location
Marooned, Y'isrumgone
What is this Mod:

Units that are working in your cities or in the field now have a chance to reach Journeyman status and even to become Masters at what they do most. Journeymen have a slight bonus for their profession. As a unit works he gains skill in the profession he is working at. You can see the Progress of all his Professions by holding shift and mousing over the unit.


Download Here

Patches:
None

Version 1.4 Changes
- You no longer have to hold shift to see Journeyman Progress List
- Pioneers and Scouts are now added to list of possible promotions
- Journeyman promotions are no longer effected by the cool down of 10 turns only Masters
- Scouts earn Journeyman Progress by spending all movement points in territory not controlled by the player or by Speak with Chieftan command.
- At the moment Journeyman Scouts have no additional effect other than the possiblity to make Seasoned Scouts

Source Code: View attachment ProfessionsMod 1.4 Source Code.rar

This version needs to be tested for stability. If you experience crashes please post your Saved Game.


Version 1.3 Changes
- When a Colonist is first Promoted to Journeyman status he will continue working his assigned profession
- Text can now be displayed instead of Icons when viewing a Units Journeyman List or Progress


Also note:

-All his Journeyman promotions are displayed in the Unit Help text when you mouse over the unit

-At Journeyman status of 49% the Unit will each turn get a chance to be promoted to a Journeyman of the Profession he is in. This can take between 7 to 13 turns or longer for Criminals and Servants.

-Journeymen who continue to work a Profession have a chance each turn to become Masters.

-Journeymen receive a bonus of 1 extra Yield in a worked plot, 1 extra Bonus Yield in a worked plot, or 50% increased Yield in a worked Building

-A Unit can be a Journeyman of any number of Professions but only Master of one.

-Master and Expert units can not gain another Mastery but can become a Journeyman of all other profession

-When a Unit reaches Journeyman status the first time, his Graphic will be updated and he will be called a "Journeyman Colonist".

-Only Free Colonist, Indentured Servants, and Petty Criminals become "Journeyman Colonist". The time it takes to become a Journeyman is modified by the Unit's Learn Time.

-Each player can only gain one Unit Journeyman/Master Promotion this way once every 10 turns. After a unit is promoted, units will not gain in skill until ten turns have passed.


Customizing this Mod

These attributes can be modded in the GlobalDefinesAlt.xml

TEXT_DESCRIPTIONS - set this to 1 for Text Descriptions when listing Journeyman Professions or 0 to use Icons. Default is currently Text. Note the linked pictures below show Icons.
JOURNEYMAN_PROGRESS_VALUE - how much each turn a Unit gains in Journeyman Skill minus his Learn Time Modifier
JOURNEYMAN_YIELD_MODIFIER - the amount of increased % of Yield in a worked building
JOURNEYMAN_YIELD_CHANGE - amount of increased Yield in a worked plot
JOURNEYMAN_BONUS_YIELD_CHANGE - amount of increased Yield that has a Bonus
PROFESSION_RESET_TIMER - the amount of turns between Unit Journeyman/Master promotions. Set to zero to have no turns to wait.

jlist.jpg jprogress.jpg jscreen.jpg
 
as much as a Col2 mod can be, this is one sexy mod! Thank you, Kailric! This resolves a serious gripe I have with the game!

EDIT
A small glitch in the promotions, I get Converted Natives ( UNIT_CONVERTED_NATIVE / UNITCLASS_CONVERTED_NATIVE ) instead of Master Carpenters ( UNIT_CARPENTER / UNITCLASS_CARPENTER ); the other skills ( Lumberjack, Fisherman, etc ) appear to all work seamlessly and as expected.

I tested it as a stand-alone and as a module in Modular United Mods 1.3 and all seems working as advertised except for the Carpenter promotion.

Great work, Kailric, I will be using this mod frequently!
 
as much as a Col2 mod can be, this is one sexy mod! Thank you, Kailric! This resolves a serious gripe I have with the game!

EDIT
A small glitch in the promotions, I get Converted Natives ( UNIT_CONVERTED_NATIVE / UNITCLASS_CONVERTED_NATIVE ) instead of Master Carpenters ( UNIT_CARPENTER / UNITCLASS_CARPENTER ); the other skills ( Lumberjack, Fisherman, etc ) appear to all work seamlessly and as expected.

I tested it as a stand-alone and as a module in Modular United Mods 1.3 and all seems working as advertised except for the Carpenter promotion.

Great work, Kailric, I will be using this mod frequently!

Thanks I'll look into this. There is one other glitch that I forgot to mention and that is When you use the command to "Change Profession", the bonuses for being a Journeyman are not factored in. I haven't quite figured this one out yet but I'll fix that when I do.
 
Well, hmmm, I just tested turning a Journeyman into a Carpenter and he appeared to me as a Carpenter. The way the code determines Masters is by checking each Units YieldModifiers and or YieldChanges. Simply put if the Unit has a positive modifier for the Journeyman's Profession then the Code knows that this Unit is the Master graphic and converts the journeyman into that unit. So check the Civ4UnitInfos for your Converted Natives it should read as below...

<YieldModifiers/> should look like this and Hammers should be -1 for Converted Native
<YieldChange>
<YieldType>YIELD_HAMMERS</YieldType>
<iChange>-1</iChange>
</YieldChange>

You said you played the Mod as a standalone so somehow you may have changed the Converted Natives in your Vanillla xmls?

The only other thing I can think of at this moment is that your Master Carpenter units where changed somehow to look like Converted Natives? Does the promoted Converted Native act like a Mater Carpenter or a Converted Native? Check those two things for me if you would please.

I plan on adding Hardy Pioneers to the list of possible Master promotions at some point.
 
This is kind of implemented in Age of Discovery II, I know, where it's possible to have your workers become "Master" or "Expert" at whatever they are doing.

Still, it's good to have it expanded on it's own. (For instance AoDII has no "Journeyman status").
 
Ah there's the thing! I hadn't remembered it until you mentioned it, but I did muck about in my vanilla game XMLs trying to figure out how all the parts worked. Now that I think about it, this certainly explains why the other colonists are doing so much better than me LOL

I will remedy that bugaboo by restoring the original XML for units and get back to you.
 
Ah there's the thing! I hadn't remembered it until you mentioned it, but I did muck about in my vanilla game XMLs trying to figure out how all the parts worked. Now that I think about it, this certainly explains why the other colonists are doing so much better than me LOL

I will remedy that bugaboo by restoring the original XML for units and get back to you.

Ok, cool. I forgot to add in the Source Code so I'll do that a little later.
 
K, New version is up. Version 1.1. Get it on first post

-Journeyman Yield increases now show up when you use the command to Change Profession

-Pioneers now added to the list of possible Promotions. They must be working a plot to gain in skill

-added source code

Edit: ha, just uploaded 1.1a. Put the wrong DLL in the zip.
 
Cool! Are you planning to add apprentices later on?

Well, I figured that when you put a colonist to work by default he is considered an "apprentice". But I did think about that. I don't want to make the system to complex. I put in a "wait" between promotions so the Player would not be overwhelmed with "Masters" toward the end of the game. If I added in an apprentice level then it would change up the training times and players would have less amount of Masters at the end game.

The system as it is gives bonus Masters that the player would not normally have. So I figured that is good enough for now. In the next update I'll turn on the AI's use of Journeyman so that the player want have any advantage over the AI and even things out a bit more.

I have thought about adding a bonus to journeyman time to Colonist who works a building if there is a Master in that building working with him. That would give a little more "apprentice" feel to the system as it is. Thats my thoughts on that at the moment.
 
Well, I figured that when you put a colonist to work by default he is considered an "apprentice". But I did think about that. I don't want to make the system to complex. I put in a "wait" between promotions so the Player would not be overwhelmed with "Masters" toward the end of the game. If I added in an apprentice level then it would change up the training times and players would have less amount of Masters at the end game.

The system as it is gives bonus Masters that the player would not normally have. So I figured that is good enough for now. In the next update I'll turn on the AI's use of Journeyman so that the player want have any advantage over the AI and even things out a bit more.

Ok. :)

I have thought about adding a bonus to journeyman time to Colonist who works a building if there is a Master in that building working with him. That would give a little more "apprentice" feel to the system as it is. Thats my thoughts on that at the moment.

This would be great :goodjob:

By the way, one question - where do I change (in the source code or otherwise) in order to restrict the journeyman professions to just the industrial ones (weaving, etc.)?
 
By the way, one question - where do I change (in the source code or otherwise) in order to restrict the journeyman professions to just the industrial ones (weaving, etc.)?

Edit: I just upload v 1.2 so you may want to get it first

Add this line to CvCity.cpp at line 5886 and see what happens. I haven't tested it but it should work. isWorkPlot() checks if the Profession works a plot instead of a building.

Code:
if (isHuman() && GET_PLAYER(getOwnerINLINE()).getProfessionsReset() <= 0 && [B]!GC.getProfessionInfo(eProfession).isWorkPlot[/B]())

Then to remove Journeyman Pioneers delete the below code in CvUnit.cpp between lines 4968 and 5006.
Code:
///tkProfessions
	if (isHuman() && GC.getUnitInfo(getUnitType()).getLearnTime() != -1)
    {
        int iTestTurn = GC.getGameINLINE().getGameTurn() * -1;

        if (getMasterLevel() < 0)
        {

            iTestTurn = (getMasterLevel() * -1) + 1;


            if (iTestTurn == GC.getGameINLINE().getGameTurn())
            {

                if (GC.getUnitInfo(getUnitType()).getLearnTime() == -1)
                {
                    setMasterLevel(2);
                }
                else
                {


                    setMasterLevel(1);
                }
                finishMoves();

                return false;
            }
        }

        changeJourneymanYieldStored(getProfession(), (GC.getDefineINT("JOURNEYMAN_PROGRESS_VALUE") - GC.getUnitInfo(getUnitType()).getLearnTime()));

        if (isDead())
        {
            return false;
        }

    }
	//tkend
 
I finished integrating this into my game, and it works great!

By the way, in line 4788 of CvPlot.cpp, you left a change undocumented.

I'll try now to incorporate the industrial-journeymen only code you posted (thanks!).

EDIT: Incorporated it, and it worked! One thing though: how do I make it so I don't get journeyman preachers, statesmen and ranchers?
 
Does this mod work with the official 1.01f patch? I installed this mod, and I love the enhancement it brings to the gameplay, but now my game is randomly crashing within the first 30 turns or so. I've tried saving the same every few turns to see if it's a random thing, but now I've got a savegame that will load, play one more turn, then crash. the error message says the problem is with the cvgamecoredll.dll, and I've tried using both the default and the one that prevents the AI from using journeymen. anyone know what might be going on?
 
Does this mod work with the official 1.01f patch? I installed this mod, and I love the enhancement it brings to the gameplay, but now my game is randomly crashing within the first 30 turns or so. I've tried saving the same every few turns to see if it's a random thing, but now I've got a savegame that will load, play one more turn, then crash. the error message says the problem is with the cvgamecoredll.dll, and I've tried using both the default and the one that prevents the AI from using journeymen. anyone know what might be going on?

Hmm, does your game work fine without the mod? Is there any chance you can attach your saved game as a zip file to this forum in a post? That way I can better track down the bug if its my code that is the problem.
 
Hmm, does your game work fine without the mod? Is there any chance you can attach your saved game as a zip file to this forum in a post? That way I can better track down the bug if its my code that is the problem.

I never got crashes like that without the mod. Obviously I can't use the same savegame file without loading the mod first, but starting a different game from the same install of the game doesn't have the same problems.

I've got a week off coming up so I'll have some more time to play around, I'll try and come up with something I can post for you. I may also try to reinstall the game from scratch and use the mod without patching the game first, see if it works with the game unpatched on my system.

I'd really like to be able to use this mod, it's a very cool idea :)
 
I never got crashes like that without the mod. Obviously I can't use the same savegame file without loading the mod first, but starting a different game from the same install of the game doesn't have the same problems.

I've got a week off coming up so I'll have some more time to play around, I'll try and come up with something I can post for you. I may also try to reinstall the game from scratch and use the mod without patching the game first, see if it works with the game unpatched on my system.

I'd really like to be able to use this mod, it's a very cool idea :)

If there is a bug its prolly due to the AI using the mod as well and should be an easy fix if I can isolate it. So you say you started a new game and it didn't have any problems?

Also note that you do have to have the latest Col offical patch or the mod want work at all.

If I get the chance this weekend I'll look into the code and turn off the AI's use of it and upload that version and you can test the game that way. If there is no crashes then we know the AI's use is causing the crash.
 
If there is a bug its prolly due to the AI using the mod as well and should be an easy fix if I can isolate it. So you say you started a new game and it didn't have any problems?

Also note that you do have to have the latest Col offical patch or the mod want work at all.

If I get the chance this weekend I'll look into the code and turn off the AI's use of it and upload that version and you can test the game that way. If there is no crashes then we know the AI's use is causing the crash.

What I meant to say was, C4Col works fine without the mod, I only get the crashes when I activate the mod. I'm pretty sure I tried using the version of the .dll where the AI doesn't use journeymen, but I can't be sure. I'll give that another shot to be certain I tried it correctly.
 
What I meant to say was, C4Col works fine without the mod, I only get the crashes when I activate the mod. I'm pretty sure I tried using the version of the .dll where the AI doesn't use journeymen, but I can't be sure. I'll give that another shot to be certain I tried it correctly.

Ah, k I forgot I had added an Extra dll to the download for turning off the AI. I will check this out asap which may be a couple days as I am pretty busy this weekend. I may have uploaded the wrong dll though. Anyway, If you haven't tried playing with the AI turned on try that if you get the chance.
 
Top Bottom