[MODCOMP] Not Allow Specified Professions per Unit

Kailric

Jack of All Trades
Joined
Mar 25, 2008
Messages
3,100
Location
Marooned, Y'isrumgone
This ModComp will make it possible for you to select which Professions you don't want your units to be able to take. I have made it as Mod Friendly as possible. Only three files where moded in the SDK and the source code is included. I named the mod the "Viscos Mod" after the forum member who inspired me to write this up.

For example if you don't want Free Colonist units to be Dragoons or Soldiers then Mod the ViscosMod_CIV4UnitInfos.XML as follows:
Code:
<LeaderPromotion>NONE</LeaderPromotion>
<iLeaderExperience>0</iLeaderExperience>
[COLOR="Blue"]<ProfessionsNotAllowed>
     <ProfessionNotAllowed>
       <VoidProfessionType>PROFESSION_DRAGOON</VoidProfessionType>
       <bIsNotAllowed>1</bIsNotAllowed>
     </ProfessionNotAllowed>
     <ProfessionNotAllowed>
       <VoidProfessionType>PROFESSION_SOLDIER</VoidProfessionType>
       <bIsNotAllowed>1</bIsNotAllowed>
     </ProfessionNotAllowed>
</ProfessionsNotAllowed>
[/COLOR]

You can toggle bIsNotAllowed to 1 or 0 for true or false. True means the Profession will not be allowed. In the default ViscosMod_CIV4UnitInfos.XML the above code for the Free Colonist is set to false and only is there for an example for you to follow. So by default nothing is changed by this mod from the Vanilla game. You have to edit the ViscosMod_CIV4UnitInfos.XML to add any changes you would like to make. The changes in the SDK are all marked with "///TK Viscos Mod" tag.

Q&A

- Each unit in the ViscosMod_CIV4UnitInfos.XML does not have to have any XML code added if you want them to work as normal. But if you want to prevent a unit from doing certain professions the above code needs to then be added and the professions that you want to disallowed added as well.

Download Below:
http://forums.civfanatics.com/downloads.php?do=file&id=13368

Any questions on this please feel free to ask.
 
This ModComp will make it possible for you to select which Professions you don't want your units to be able to take. I have made it as Mod Friendly as possible. Only three files where moded in the SDK and the source code is included. I named the mod the "Viscos Mod" after the forum member who inspired me to write this up.

For example if you don't want Free Colonist units to be Dragoons or Soldiers then Mod the ViscosMod_CIV4UnitInfos.XML as follows:
Code:
<LeaderPromotion>NONE</LeaderPromotion>
<iLeaderExperience>0</iLeaderExperience>
[COLOR="Blue"]<ProfessionsNotAllowed>
     <ProfessionNotAllowed>
       <VoidProfessionType>PROFESSION_DRAGOON</VoidProfessionType>
       <bIsNotAllowed>1</bIsNotAllowed>
     </ProfessionNotAllowed>
     <ProfessionNotAllowed>
       <VoidProfessionType>PROFESSION_SOLDIER</VoidProfessionType>
       <bIsNotAllowed>1</bIsNotAllowed>
     </ProfessionNotAllowed>
</ProfessionsNotAllowed>
[/COLOR]

You can toggle bIsNotAllowed to 1 or 0 for true or false. True means the Profession will not be allowed. In the default ViscosMod_CIV4UnitInfos.XML the above code for the Free Colonist is set to false and only is there for an example for you to follow. So by default nothing is changed by this mod from the Vanilla game. You have to edit the ViscosMod_CIV4UnitInfos.XML to add any changes you would like to make. The changes in the SDK are all marked with "///TK Viscos Mod" tag.


Download Below:
http://forums.civfanatics.com/downloads.php?do=file&id=13368

Any questions on this please feel free to ask.
Does it means that units with bIsNotAllowed=1 couldn't work in some buildings, too?

When I have no sugar, my colonists (in automatic regime) prefer to be Bootleggers and prepare alcohol from food. Such their activity slows down the growth of my city's population.
 
Does it means that units with bIsNotAllowed=1 couldn't work in some buildings, too?

When I have no sugar, my colonists (in automatic regime) prefer to be Bootleggers and prepare alcohol from food. Such their activity slows down the growth of my city's population.

Exactly yes, any profession wether its outdoors, in your buildings, or working a plot can be added as "not allowed". At least thats what this mod is intended to do. I haven't fully tested it yet though.
 
Exactly yes, any profession wether its outdoors, in your buildings, or working a plot can be added as "not allowed". At least thats what this mod is intended to do. I haven't fully tested it yet though.

Great! The quality of alcohol produced by non-professional bootleggers causes the serious worries. Now all shoud be OK. Thank you very much from my citizens. :)
 
I ve got a similar fonction in my mod:
I can prohibited a profession for some units:
Code:
<ClassAlloweds/>
<ClassProhibiteds>
	<ClassProhibited>
		<UnitClassTypeP>UNITCLASS_ECLAIREUR</UnitClassTypeP>
		<bUnitClassP>1</bUnitClassP>
	</ClassProhibited>
	<ClassProhibited>
		<UnitClassTypeP>UNITCLASS_AGRONOME</UnitClassTypeP>
		<bUnitClassP>1</bUnitClassP>
	</ClassProhibited>
	<ClassProhibited>
		<UnitClassTypeP>UNITCLASS_BUILDER_WAGON</UnitClassTypeP>
		<bUnitClassP>1</bUnitClassP>
	</ClassProhibited>
</ClassProhibiteds>
or i can allow a profession for some units too :
Code:
<ClassAlloweds>
	<ClassAllowed>
		<UnitClassTypeA>UNITCLASS_BUILDER_WAGON</UnitClassTypeA>
		<bUnitClassA>1</bUnitClassA>
	</ClassAllowed>
</ClassAlloweds>
<ClassProhibiteds/>
If you need to used this function i can explain how i maked it but even if the kailric method is (for me) less fast than my functions, the result is the same. :)
I think not to allow a profession for some units is necessary in this game.
 
M07, would you happen to know how to make a likewise function that makes it possible for certain professions to be allowed only when the required building is built? If you have played Col1, I mean like was done for Missionaries - colonists could only become a missionary if there was a Church/Cathedral in the colony.

And one for professions to not be available if a certain building is built. My intention is to make it so the Armory/Magazine/Arsenal simulate military technology, so that if an Arsenal is not built, the "Musketeer" profession is available in that city; however, if the Arsenal is built, the Musketeer profession becomes unavailable and the "Regular" one becomes available.
 
I don't need this function, in Doane when I build the "Congress Palace ", the profession "Patriotic" is allow or when I build a "College", I can buy in europe an agromist ( <---- It is only in my mod :p ).
And the other functions I mentioned in my last post ("<ClassAlloweds/> and <ClassProhibiteds/>") worked.
f you have played Col1, I mean like was done for Missionaries - colonists could only become a missionary if there was a Church/Cathedral in the colony.
It is a good idea!! I never played to Col1 I was too younger :).
If i understand what you say, you asked me if i know how to realize your ideas?
(I can do it but i must to sleep :))
 
I don't need this function, in Doane when I build the "Congress Palace ", the profession "Patriotic" is allow or when I build a "College", I can buy in europe an agromist ( <---- It is only in my mod :p ).
And the other functions I mentioned in my last post ("<ClassAlloweds/> and <ClassProhibiteds/>") worked.

I didn't understand exactly what you meant :p

It is a good idea!! I never played to Col1 I was too younger :).
If i understand what you say, you asked me if i know how to realize your ideas?
(I can do it but i must to sleep :))

Oui, c'est exactement ce que je voulais dire. / Yes, that's exactly what I meant. :D
 
In the first part, i give you some example of my functions that look like to your ideas.( I know that I don't speak english very well :p ).
Then, to realize what you want , you need know the C++ language otherwise i will have to do it for you, but it is longer to explain than write it.

Oui, c'est exactement ce que je voulais dire. / Yes, that's exactly what I meant.:D
ps: I don't need translation :mischief:
 
In the first part, i give you some example of my functions that look like to your ideas.( I know that I don't speak english very well :p ).
Then, to realize what you want , you need know the C++ language otherwise i will have to do it for you, but it is longer to explain than write it.

Ok, I know some C++, enough to understand if you explain to me, but not enough that I know yet how to do this myself. Anyway, do the one you prefer (teaching or writing it yourself), I'll be very happy with either :)

ps: I don't need translation :mischief:

I know :p It's for the others.
 
Hey, M07, if you want we can merge the functions of your Mod with this Mod so that people would have two ways to modify Professions and they can use which ever is faster for them. If I am understanding your code correctly you have modified the Professions.XML?

We could also add in code for the functions that Androrc the Orc is requesting. That would be a simple thing to do as well, just adding a check to see if the City has the required building.

I can do the merging but I may not have time for a while as I am going on a two week trip this Friday. Did you add the new Functions to your DOANE mod? If so I should be able to find the code and merge them at some point in time or you can do it which ever is best for you. What you think?
 
if you want we can merge the functions of your Mod with this Mod so that people would have two ways to modify Professions and they can use which ever is faster for them.
Np, I will do it and i will send you my work!
If I am understanding your code correctly you have modified the Professions.XML?
Absolutely, great minds think alike!! :)
We could also add in code for the functions that Androrc the Orc is requesting. That would be a simple thing to do as well, just adding a check to see if the City has the required building.
In DoaNE I have already this function but I need only the specified building in one of my colonies, I don't know what you want!
Did you add the new Functions to your DOANE mod
.
I don't remember how many function I added in my mod, so yes I have new functions :p.
 
In DoaNE I have already this function but I need only the specified building in one of my colonies, I don't know what you want!

We would just need a new XML attribute in the Professions.XML for RequiredBuilding.. much like UnitInfos.XML:

Code:
<PrereqBuilding>NONE</PrereqBuilding>
<PrereqOrBuildings/>
 
Top Bottom