What I'd like to do now is to export the ethnicside variable's value plus vanilla's choice of unit type (BattleConn_MapUnit(unitID, squad)) to a function of my own, and in that function setting the value of squad and returning that value to the BattleConn_Export function. Would be much neater and nicer to have all nitty gritty of which faction gets which unit type changed, and to what.
Anybody having an idea of how to export the ethnicside and BattleConn_MapUnit(unitID, squad) values to a new function and returning a squad value from that function? (Until then I can just work on doing the mechanics inside the BattleConn_MapUnit(unitID, squad) function.)
Code: Select all
// MODDING
randomunit = Dice(100);
unitside = side;
if (bSwapSides)
{
unitside = (unitside + 1) % 2;
}
ethnicside = Faction_Ethnic(gBattleDesc.factionID[unitside][0] );
if ( ethnicside == 9 )
{
if (randomunit < 50)
{
squad = "Pike";
}
else
{
squad = "Citizen_Hoplites";
}
}
else if ( ethnicside == 16 )
{
if (randomunit < 50)
{
squad = "Persian_Cav_Jav_Arm";
}
else
{
squad = "Cataphracts";
}
}
else
{
squad = "Elephants";
}
// VANILLA
// BattleConn_MapUnit(unitID, squad);

