[MODCOMP] Route Restricter

Shqype

Shqyptar
Joined
Nov 15, 2005
Messages
2,468
Location
New York + Shqypni
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. :)
 
That's cool! But I was thinking, could you make it that a unit would need a route to pass some terrain. Like, mounted units need a road/RR to pass forests. Or ground units need roads/RR to go over peaks?
That would be cool. But anyways, good modcomp. :goodjob:
 
Thanks for the support guys! :)

Grishnash, I'll look further into it. But first I'll wait for Firaxis to release their patch, and see what they add/change.
 
Is this just basically a port of Zebra 9's zRoutes mod, or did you add new things also? Either way I'm sure it will get a lot of use. :thumbsup:
 
I didn't port Zebra 9's mod, I made this from scratch.

I haven't used his mod, but from what I understand it allows you to set route restrictions by an .ini file. Alas, it uses python, so this is much faster and configurable by XML. :)

And I may expand it further ;)
 
With this Mod comp., you could make a "train" Unit.
This is the Unit that really match with this Mod comp.
 
Thanks for the support guys! :)

Grishnash, I'll look further into it. ...

They are very intellingent thinghs ! Do you develop ? Were may I found that for my v3.17 ?
Thanks !!!
 
This component works with 3.13, 3.17 and 3.19.
 
EDIT: Is it possible to limit units to routes based on promotions a unit has as not the unit itself? If so, that would make it possible to have units behave as if there were tunneling under ground.

Great work. Thanks.
 
Top Bottom