Roman legion unit conversion

Moderators: Pocus, Pocus

Post Reply
FrenchDude
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 201
Joined: Wed Jan 02, 2019 9:27 pm

Roman legion unit conversion

Post by FrenchDude » Wed Jan 01, 2020 4:39 pm

Hey everyone, i have a little question !

I'd like to make a few modifications to units. I've never been modding before, just starting to understand how to create new units in the Unit files and link them to FOG2 units. I've been looking at the Units.CSV file I created in my new scenario (copied from the main folder), and I don't understand how the Roman Legion unit in FOGE ends up creating both Veteran Hastati/Principes AND Triarii units in FOG 2.
I understand that each FOGE unit is linked to a FOG2 unit during the battle conversion, but I'd like to be able to link a FOGE unit to two FOG2 units or more, just like the Roman legion works ingame. I just can't find a way to do it though ! I keep looking at the Units.CSV files, but I don't get it

Anyone could help a poor newbie modder ?

rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 24399
Joined: Sun Dec 04, 2005 6:25 pm

Re: Roman legion unit conversion

Post by rbodleyscott » Fri Jan 10, 2020 2:39 pm

FrenchDude wrote:
Wed Jan 01, 2020 4:39 pm
Hey everyone, i have a little question !

I'd like to make a few modifications to units. I've never been modding before, just starting to understand how to create new units in the Unit files and link them to FOG2 units. I've been looking at the Units.CSV file I created in my new scenario (copied from the main folder), and I don't understand how the Roman Legion unit in FOGE ends up creating both Veteran Hastati/Principes AND Triarii units in FOG 2.
I understand that each FOGE unit is linked to a FOG2 unit during the battle conversion, but I'd like to be able to link a FOGE unit to two FOG2 units or more, just like the Roman legion works ingame. I just can't find a way to do it though ! I keep looking at the Units.CSV files, but I don't get it

Anyone could help a poor newbie modder ?
The code that does it is in FOG2 in the TranslateLiaisonUnitToFOGCampaignUnits() function in /Data/scripts/LiaisonTools.bsf in FOG2.

All of the unit names in that function refer to FOG2 units names - in the first column in /Data/Squads.xlsx in FOG2

You should not mod this file in its current position, but you can safely copy it to

/Campaigns/Liaison/Data/scripts in FOG2

and mod it there.

The local (modded) version will automatically be used instead of the vanilla version for exported Empires games, and because the vanilla file has not been altered, the mod should not affect FOG2 MP games.
Richard Bodley Scott

Image

FrenchDude
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 201
Joined: Wed Jan 02, 2019 9:27 pm

Re: Roman legion unit conversion

Post by FrenchDude » Fri Jan 10, 2020 5:34 pm

rbodleyscott wrote:
Fri Jan 10, 2020 2:39 pm
FrenchDude wrote:
Wed Jan 01, 2020 4:39 pm
Hey everyone, i have a little question !

I'd like to make a few modifications to units. I've never been modding before, just starting to understand how to create new units in the Unit files and link them to FOG2 units. I've been looking at the Units.CSV file I created in my new scenario (copied from the main folder), and I don't understand how the Roman Legion unit in FOGE ends up creating both Veteran Hastati/Principes AND Triarii units in FOG 2.
I understand that each FOGE unit is linked to a FOG2 unit during the battle conversion, but I'd like to be able to link a FOGE unit to two FOG2 units or more, just like the Roman legion works ingame. I just can't find a way to do it though ! I keep looking at the Units.CSV files, but I don't get it

Anyone could help a poor newbie modder ?
The code that does it is in FOG2 in the TranslateLiaisonUnitToFOGCampaignUnits() function in /Data/scripts/LiaisonTools.bsf in FOG2.

All of the unit names in that function refer to FOG2 units names - in the first column in /Data/Squads.xlsx in FOG2

You should not mod this file in its current position, but you can safely copy it to

/Campaigns/Liaison/Data/scripts in FOG2

and mod it there.

The local (modded) version will automatically be used instead of the vanilla version for exported Empires games, and because the vanilla file has not been altered, the mod should not affect FOG2 MP games.
You recently advised me to create a global mod for FOGE and place my modded version of the LiaisonTools.bsf in it. I proceeded this way, and for now it seems to be working without any side effects

Thanks for your help

rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 24399
Joined: Sun Dec 04, 2005 6:25 pm

Re: Roman legion unit conversion

Post by rbodleyscott » Fri Jan 10, 2020 6:06 pm

FrenchDude wrote:
Fri Jan 10, 2020 5:34 pm
You recently advised me to create a global mod for FOGE and place my modded version of the LiaisonTools.bsf in it. I proceeded this way, and for now it seems to be working without any side effects
True. It only just occurred to me that since the Liaison module is treated as a separate campaign, it can include its own custom versions of the LiaisonTools.BSF file. And as exported Empires battles cannot be played MP, it won't break anything.

So essentially you can either do it as a Global mod, or include the modded script in the Liaison campaign folder.

The first is more in keeping with our usual advice, since it doesn't involve modding the main build, and hence probably breaking MP.

OTOH the other method should also work in this particular case without breaking MP.

The disadvantage of the global mod method being that you can only have one global mod active at a time. So if, for example, you wanted to use the Rise of AI global mod, you could put the modded LiaisonTools.BSF file in the /Campaigns/Liaison/Data/scripts folder, and then you could have both mods active at the same time.

OTOH, if you use the STEAM version, there is a risk that an update might delete the modded LiaisonTools.bsf file from the Liason campaign folder. It certainly overwrites mods to existing files, but I am not sure whether it actively deletes files that are not in its files list. I strongly suspect that a Verify Local Files on STEAM would delete the added file.
Richard Bodley Scott

Image

Post Reply

Return to “MOD”