Page 1 of 1

Multi-unit type export to FOG2

Posted: Sun Feb 12, 2023 3:19 pm
by ShadInq
I wanted to try to edit some units to add variety to the army, after completing a Macedon campaign. It bugged me that almost all skirmishers including many provicial skirmishers map to light javelinmen in FOG2. So I wanted the following:

Remap improved javelinmen to a 50:50 mix of light javelinmen and euzonoi
Remap improved medium infantry to mix of thureophoroi and thorakitai.
Greek provincial skirms to mix of light javelinmen and peltasts

and so on,

However, I was not sure how to do this:
I found the line for early roman legion to use as exmple, as it maps to Hastati/Principes + Triarii (437;ROM;ID_UNI_ROM_LEGIO0 in the unit file), but I found no mention of Triarii in there, just:

Code: Select all

;Veteran Hastati/Principes;Hast_Princ_Vet;75;hast_princ_vet;355
What am I missing?

Re: Multi-unit type export to FOG2

Posted: Sun Jul 09, 2023 11:40 am
by azcore
Triarii is a specific case handled on the FoG2 side (Field of Glory II\Data\scripts\LiaisonTools.bsf), here is an excerpt from it:

Code: Select all

                                        // Add a proportion of triarii to pre-Marian legionary units
                                        if (done == 0)
                                                {
                                                        if ((StringCompare(gLiaisonUnitData[liaisonUnitIndex].type, "Hast_Princ") == 1) || (StringCompare(gLiaiso
nUnitData[liaisonUnitIndex].type, "Hast_Princ_Vet") == 1))
                                                                {
                                                                        AddProportionalFOGUnits(liaisonUnitIndex, side, unitType, army, FOGUnits, "Triarii", 2, 1
);
                                                                        done = 1;
                                                                }
                                                }

                                        // Create other unit types normally.
                                        if (done == 0)
                                                {
                                                        LiaisonCreateFOGunits(liaisonUnitIndex, side, unitType, army, FOGUnits);
                                                }
 
To get something like what you're aiming for in Empires, you might want to check out how it's done in some of the Empires mods out there. Usually, you'd have to tinker with the "Data\Scripts\BattleConnection.BSF" file. Here's what you could do:

Code: Select all

        if ( idside == 8 ) // UNIQUE LIST FOR CARTHAGE (ID = 8)
        {
                if ( StringCompare(squadtemp, "Spanish_Scutarii") == 1 )
                {
                        if ( randomunit <= 25 )
                        {
                                squadtemp = "Thureophoroi";
                        }
                        else if ( randomunit <= 50 )
                        {
                                squadtemp = "Spanish_Scutarii";
                        }
                        else if ( randomunit <= 75 )
                        {
                                squadtemp = "poeni_foot";
                        }
                        else
                        {
                                squadtemp = "Italian_Foot";
                        }
                        unitchange = 1; // So that none of these changes for Carthage are again changed further down, under Semitic
                }
While this method comes with some unfortunate limitations, I'm currently testing a potential solution that I believe could be better - and this one is entirely implemented on the FoG2 side.

Re: Multi-unit type export to FOG2

Posted: Fri Sep 01, 2023 3:26 pm
by ShadInq
Thanks! I'll try to adapt the example code you gave.

Let me know if that other solution works out, could be a better option.