Resource icon

[BTS MODCOMP] Route Restricter 2016-10-05

Route Restricter SDK Mod Component
For BTS 3.13, made with Bhruic's unofficial patch 1.11

This evolved from my first modcomponent, MechRoute, but has been expanded and improved for more versatile application.

What it does: This mod allows you restrict a unit's movement exclusively to routes. Which routes it restricts is up to you: I have added a new <PassableRouteNeededs> tag which will allow you to set which routes a unit is restricted to.



The Mechanized Infantry has been set to be able to move on both roads and railroads:
Spoiler :
Code:
<PassableRouteNeededs>
	<PassableRouteNeeded>
		<RouteType>ROUTE_ROAD</RouteType>
		<bPassableRouteNeeded>1</bPassableRouteNeeded>
	</PassableRouteNeeded>
	<PassableRouteNeeded>
		<RouteType>ROUTE_RAILROAD</RouteType>
		<bPassableRouteNeeded>1</bPassableRouteNeeded>
	</PassableRouteNeeded>
</PassableRouteNeededs>
The above will allow a unit to move on any plot, as long as it contains a road or railroad. (This is essentially what MechRoute did, using the <bMechanized> tag). The difference is that you don't have to change <bMechanized> for any units that you don't want to restrict their movement to routes alone, since that tag might be used for combat formations. Plus, you can actually choose which route you want to restrict a unit's movement to: roads, railroads, or both.

As an example, I have set the catapult to move only on roads:
Spoiler :
Code:
<PassableRouteNeededs>
	<PassableRouteNeeded>
		<RouteType>ROUTE_ROAD</RouteType>
		<bPassableRouteNeeded>1</bPassableRouteNeeded>
	</PassableRouteNeeded>
</PassableRouteNeededs>
And the artillery can only move on railroads:
Spoiler :
Code:
<PassableRouteNeededs>
	<PassableRouteNeeded>
		<RouteType>ROUTE_RAILROAD</RouteType>
		<bPassableRouteNeeded>1</bPassableRouteNeeded>
	</PassableRouteNeeded>
</PassableRouteNeededs>
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 new scheme is also included, and conveniently the new tag I added is not required for the XML to load properly, so you can only apply it to the units you want to restrict movement to.

Thanks again to Kael and Seven05 for supporting me in creating this modcomp. Please let me know what you think of it, any bugs you might encounter, and if there's a reasonable way for me to further expand and improve this modcomp. :)

The original discussion thread is here: http://forums.civfanatics.com/showthread.php?t=267632
  • mechinfroadrailroad_c5j.jpg
    mechinfroadrailroad_c5j.jpg
    120.6 KB · Views: 183
Author
Shqype
Downloads
351
Views
351
First release
Last update
Rating
4.00 star(s) 1 ratings

More resources from Shqype

Top Bottom