How to create a guerilla unit?

VeteranLurker

Warlord
Joined
Nov 8, 2006
Messages
259
Location
Ann Arbor, MI
I've looked through the threads and downloads and haven't found quite what I'm looking for, so I'll ask here. I am working on a mod of the Road To War mod (BTS, 3.17) and want to add a guerilla-type unit for each of the mod's 'religions' (rather, ideologies: fascism, communism, democracy, neutral). Ideally, I want this unit to be much like a privateer -- no-nationality, can attack without DoW -- only on land, with defensive promotions like guerilla/woodsman/etc. This is to represent the guerilla/resistance type units which conducted proxy-like wars, like the International Brigades during the Spanish Civil War, the partisans in Yugoslavia, etc. The unit is otherwise a low-power infantry unit which would not fare well in direct combat until it picks up promotions/upgrades and/or is supported by regular-army units, is more expensive than comparable infantry, and is limited to a certain number of national units.

The problem I am running into, as with privateers, is that EVERYONE attacks the guerilla units whenever they find them, since of course with bHiddenNationality=1 and bAlwaysHostile=1 they are everyone's enemy. What I would like is to have most everyone attack these units EXCEPT for units with the same ideology (such as other guerillas) or regular units from countries with the same ideology. Is there a way to attach ideology to these units, and have other units able to see this and respond accordingly?

In the Spanish Civil War example, the Nationalist units (fascists) would not attack the hidden-nationality fascist guerilla unit, since it considers it an ally. However, the Republican units (communists) would of course attack fascist guerillas if they find any nearby.

A workaround would be to make the guerilla units invisible (and turn off the HiddenNationality), but that isn't really accurate, could become overpowered (though it could be countered by making some regular units able to see invisible), and would likely be a hassle for the AI to handle in a reasonable way.

I am new to modding, and currently am only able to handle manipulating the XMLs, so if the solution is in Python and/or the SDK then I will be out of my element. Perhaps someone has already done something like this and can point me to an example?
 
Top Bottom