Shqype
Shqyptar
This modcomp has been improved, updated, and expanded. It is now called Route Restricter. The development thread is: http://forums.civfanatics.com/showthread.php?t=267632
Spoiler :
Mech Route SDK Mod Component
This was requested by Snafusmith for his upcoming WWI mod, Blood and Iron, but I'm sure others in the community have use for it.
What it does: if a unit is bMechanized, then that unit can only move on plots with existing routes, ie roads or railroads. Zebra 9 has created a similar modcomp in Python which allows an .ini configuration file to set which units can only travel on which routes, but this is simpler and done in C++, effectively eliminating any lag that might ensue from the Python route.
I have enclosed both the source code and the mod itself, which includes the DLL I compiled and the proper XML to make it work: the text file for the new tag I created, and the CIV4UnitInfos.xml file. Note that I have made sure no unit besides the Mech Infantry is Mechanized. This is solely for testing purposes: just keep in mind that no units should have <bMechanized> set to "1" unless you plan on restricting that unit's movement to routes alone (roads and railroads).
To see what I changed in the source code, just search for "Shqype," as I have commented all my additions with either "Shqype Start" and "Shqype End" for multi-line additions, or "Shqype Add" for one-line additions. The <bMechanized> tag is not used by Firaxis, so it shouldn't cause any trouble. This way is convenient because you don't have to alter the schema at all
I'd like to give special thanks to Kael, because his extremely useful tutorial gave me insight and instruction on completing this modcomp, my first ever standalone SDK mod component.
Enjoy, and let me know if there are any problems or criticisms that you may have.
This was requested by Snafusmith for his upcoming WWI mod, Blood and Iron, but I'm sure others in the community have use for it.
What it does: if a unit is bMechanized, then that unit can only move on plots with existing routes, ie roads or railroads. Zebra 9 has created a similar modcomp in Python which allows an .ini configuration file to set which units can only travel on which routes, but this is simpler and done in C++, effectively eliminating any lag that might ensue from the Python route.
I have enclosed both the source code and the mod itself, which includes the DLL I compiled and the proper XML to make it work: the text file for the new tag I created, and the CIV4UnitInfos.xml file. Note that I have made sure no unit besides the Mech Infantry is Mechanized. This is solely for testing purposes: just keep in mind that no units should have <bMechanized> set to "1" unless you plan on restricting that unit's movement to routes alone (roads and railroads).
To see what I changed in the source code, just search for "Shqype," as I have commented all my additions with either "Shqype Start" and "Shqype End" for multi-line additions, or "Shqype Add" for one-line additions. The <bMechanized> tag is not used by Firaxis, so it shouldn't cause any trouble. This way is convenient because you don't have to alter the schema at all

I'd like to give special thanks to Kael, because his extremely useful tutorial gave me insight and instruction on completing this modcomp, my first ever standalone SDK mod component.
Enjoy, and let me know if there are any problems or criticisms that you may have.
