Modding guide
Posted: Thu Oct 26, 2017 8:50 am
LAST UPDATE OF THIS THREAD IS : 29 OCTOBER 2017
UPDATE CONCERNS : ADDING INFOS ABOUT :CombatTools.BSF - How to modify fighting cavalery vs elephants
(Search details in the thread)
To try to rationalize knowledges in modding FOG2, I think it would be good to have this tool : I began to complete it, to show what it would be become after completing
I listed all scripts and others misc files that may be used.
Updated by rbodleyscott
________________________________________________________________
/Core
Core.BSF
Various functions performed in every battle
/Core/AI
AI.BSF
The main AI logic
________________________________________________________________
Data/Battle/Scripts (bsf files)
-------------
$DEFAULT
May be used :
To add additional script files to the build
-------------
Assault
May be used :
To modify the functioning of the Charge order
-------------
Callbacks
May be used :
=> to mod formation of units (in combination with Mancount parameter in Squad.csv)
See here post of a specialist for this aspect : http://www.slitherine.com/forum/viewtop ... 92&t=79856
-------------
CloseCombatLogic
May be used :
To modify the close combat logic
-------------
FallBack
May be used :
To modify the Fall Back order
-------------
FightMelee
May be used :
To modify the Fight Melee order
-------------
FormSquare
May be used :
To modify the form square and leave square orders.
-------------
Helpers
May be used :
To modify various tile displays and tooltips
-------------
Init
May be used :
To add additional unit "Attrib" variables that do not need to be in the squads file. Not that the number of these is finite, so if you add many it is possible that your mod will not work with future updates.
-------------
keys
May be used :
To add hotkeys. Use with caution - will cause issues if you try to use a key that is already in use elsewhere.
-------------
Load
May be used :
To allow certain types of units to be carried by others
-------------
MapGenerate
May be used :
To modify the setting up of random map battles
-------------
MapGenerateBattle
May be used :
To modify random map generation
-------------
Move
May be used :
To modify the functioning of the move order
-------------
Move_Command
May be used :
To modify the functioning of the Group movement order
-------------
Move_General
May be used :
To modify the functioning of the Move General (to another unit) order
-------------
MultiBattleCampaign
May be used :
To modify the functioning of multi-battle campaigns
-------------
PassThrough
May be used :
To modify the functioning of the Pass Through order
-------------
QuickBattles
May be used :
To modify the functioning of Quick Battles modules
-------------
Shooting
May be used :
To modify the functioning of the Shoot order
-------------
Shooting_Logic
May be used :
To modify Shooting
-------------
Slith_RandomMap2
May be used :
1°/ => to mod victory conditions
See here a post concerning this aspect : http://www.slitherine.com/forum/viewtop ... 92&t=79828
2°/ To mod the functioning of random map battles
-------------
StartTurn
May be used :
To mod stuff applying to each unit at the start of its turn
-------------
Switch_Command
May be used :
To mod the functioning of the Switch Command order
-------------
trigger
May be used :
To mod how projectile animations work
-------------
Turn
May be used :
To mod how the Turn order works
-------------
Turn_Command
To mod how the group turn order works
-------------
TurnAndShoot
May be used :
To mod how the Turn and Shoot order works
-------------
UI
May be used :
To mod the fundtioning of the unit UI panels at the bottom of the battle screen
-------------
Undo
May be used :
to mod the functioning of the Undo order
________________________________________________________________
Data/scripts (bsf files)
-------------
AITools
To mod the AI, also evades, routs and pursuits.
-------------
AnimationTools
To mod the unit animation logic
-------------
CampaignTools
May be used :
To mod the functioning of campaigns
-------------
CombatTools
May be used :
=>To alter the ranges of different weapons you would need to alter the following functions:
MaximumRange() - used for multiple purposes
OptimumRange() - used by the AI
GetShootingWeaponModifier() - this is what actually determines the effect of each weapon at different ranges
To mod all sorts of other functions affecting shooting and close combat
=> to modify fighting cavalry Vs Elephants
1) Code that disorders cavalry when close to elephants. The PercentDisordered() function in CombatTools.BSF
2) Effect of elephants on the various cavalry capabilities in GetImpactPOA() and GetMeleePOA() in CombatTools.BSF
If you want to disallow cavalry from ever charging elephants you would do it in ChargePermitted() function in CombatTool.BSF
-------------
CustomCampaignTools
May be used :
This is designed to be replaced in custom modules to mod various campaign functions
-------------
ForceSelectionTools
May be used :
To mod force selection
-------------
Functions
May be used :
Assorted functions for use in various places
-------------
GeneralTools
May be used :
To modify how generals work
In particular : allow to modify Generals range command
-------------
Globals
May be used :
To add additional global variables
-------------
HelperTools
May be used :
To mod various tooltip and tutorial functions
-------------
Macros
May be used :
To define new macros, or modify the existing ones. These can only be single integers.
-------------
MapTools
May be used :
To mod various functions used by random map generator.
-------------
MoraleTools
May be used :
To mod the morale rules
In particular : may be used to modify the routing effect of routed elephants on others units
-------------
MoreCampaignTools
May be used :
To mod multi-battle campaigns
-------------
MoreScenarioTools
May be used :
To mod various functions relating to random map and preset scenario battles
-------------
MoveCommandTools
May be used :
To mod the functioning of Group Movement
-------------
MPSShowArmyTools
May be used :
To mod the display of field army and garrison units between campaign battles
-------------
MultiPartSkirmishTools
May be used :
To mod the functioning of multi-battle campaigns
-------------
ObstacleTools
May be used :
To mod the functioning of obstacles
-------------
QuestControlsTools
May be used :
To mod the functioning of the campaign/sencario etc selection UI. Best left alone.
-------------
ScenarioTools
May be used :
NOT USED
-------------
StartTurnPreTools
May be used :
To mod various things that occur at the start of a turn.
-------------
Tools
May be used :
Assorted functions used in various places.
-------------
TournamentTools
Do not mod this!
-------------
TutorialTools
May be used :
To modify the display of tutorial popups
-------------
UITools
May be used :
To modify various UI functions
-------------
UndoTools
May be used :
To modify the functioning of the Undo order.
_____________________________________________________________________
DATA misc files
-------------
Terrain
May be used:
=> to change units move capacities on each terrain
-------------
Mapview
May be used :
=> to mod zoom functions
See here a post about this aspect : http://www.slitherine.com/forum/viewtop ... 92&t=79690
Squads files (Excel and csv)
May be used to modify units stats
See here for the complete units stats listing : http://www.slitherine.com/forum/viewtop ... 92&t=80096
You may work with excel page named Squads (stats are listed with rows and lines), and then, convert your excel page in a excel csv format
Explanations hre : http://www.slitherine.com/forum/viewtop ... 92&t=79680
For french players : les versions française et américaines de Excel étant incompatibles pour les séparateurs, il faut utiliser le processus indiqué ici :
http://www.slitherine.com/forum/viewtop ... 92&t=80110
________________________________________________________________
Other misc files : Data/UI/Textures/Battle files (images)
These files are images and may be edited with adapted program, they concern some aspects of interface of the game
(in particular effects of selections or actions on map : selected units, etc)
Sample : Unit_WaypointSelected.dds is the file that contents the image of the selected unit (gold square when you select one unit)
See this thread : http://www.slitherine.com/forum/viewtop ... 28#p683928
________________________________________________________________
Other misc file :/Documents/My Games/FieldOfGlory2/Options.txt
This file allows to modify some values options in game
In particular : speed of all move animations
Concerned value is :UnitSpeedHack
Min is 0, max is 10
UPDATE CONCERNS : ADDING INFOS ABOUT :CombatTools.BSF - How to modify fighting cavalery vs elephants
(Search details in the thread)
To try to rationalize knowledges in modding FOG2, I think it would be good to have this tool : I began to complete it, to show what it would be become after completing
I listed all scripts and others misc files that may be used.
Updated by rbodleyscott
________________________________________________________________
/Core
Core.BSF
Various functions performed in every battle
/Core/AI
AI.BSF
The main AI logic
________________________________________________________________
Data/Battle/Scripts (bsf files)
-------------
$DEFAULT
May be used :
To add additional script files to the build
-------------
Assault
May be used :
To modify the functioning of the Charge order
-------------
Callbacks
May be used :
=> to mod formation of units (in combination with Mancount parameter in Squad.csv)
See here post of a specialist for this aspect : http://www.slitherine.com/forum/viewtop ... 92&t=79856
-------------
CloseCombatLogic
May be used :
To modify the close combat logic
-------------
FallBack
May be used :
To modify the Fall Back order
-------------
FightMelee
May be used :
To modify the Fight Melee order
-------------
FormSquare
May be used :
To modify the form square and leave square orders.
-------------
Helpers
May be used :
To modify various tile displays and tooltips
-------------
Init
May be used :
To add additional unit "Attrib" variables that do not need to be in the squads file. Not that the number of these is finite, so if you add many it is possible that your mod will not work with future updates.
-------------
keys
May be used :
To add hotkeys. Use with caution - will cause issues if you try to use a key that is already in use elsewhere.
-------------
Load
May be used :
To allow certain types of units to be carried by others
-------------
MapGenerate
May be used :
To modify the setting up of random map battles
-------------
MapGenerateBattle
May be used :
To modify random map generation
-------------
Move
May be used :
To modify the functioning of the move order
-------------
Move_Command
May be used :
To modify the functioning of the Group movement order
-------------
Move_General
May be used :
To modify the functioning of the Move General (to another unit) order
-------------
MultiBattleCampaign
May be used :
To modify the functioning of multi-battle campaigns
-------------
PassThrough
May be used :
To modify the functioning of the Pass Through order
-------------
QuickBattles
May be used :
To modify the functioning of Quick Battles modules
-------------
Shooting
May be used :
To modify the functioning of the Shoot order
-------------
Shooting_Logic
May be used :
To modify Shooting
-------------
Slith_RandomMap2
May be used :
1°/ => to mod victory conditions
See here a post concerning this aspect : http://www.slitherine.com/forum/viewtop ... 92&t=79828
2°/ To mod the functioning of random map battles
-------------
StartTurn
May be used :
To mod stuff applying to each unit at the start of its turn
-------------
Switch_Command
May be used :
To mod the functioning of the Switch Command order
-------------
trigger
May be used :
To mod how projectile animations work
-------------
Turn
May be used :
To mod how the Turn order works
-------------
Turn_Command
To mod how the group turn order works
-------------
TurnAndShoot
May be used :
To mod how the Turn and Shoot order works
-------------
UI
May be used :
To mod the fundtioning of the unit UI panels at the bottom of the battle screen
-------------
Undo
May be used :
to mod the functioning of the Undo order
________________________________________________________________
Data/scripts (bsf files)
-------------
AITools
To mod the AI, also evades, routs and pursuits.
-------------
AnimationTools
To mod the unit animation logic
-------------
CampaignTools
May be used :
To mod the functioning of campaigns
-------------
CombatTools
May be used :
=>To alter the ranges of different weapons you would need to alter the following functions:
MaximumRange() - used for multiple purposes
OptimumRange() - used by the AI
GetShootingWeaponModifier() - this is what actually determines the effect of each weapon at different ranges
To mod all sorts of other functions affecting shooting and close combat
=> to modify fighting cavalry Vs Elephants
1) Code that disorders cavalry when close to elephants. The PercentDisordered() function in CombatTools.BSF
2) Effect of elephants on the various cavalry capabilities in GetImpactPOA() and GetMeleePOA() in CombatTools.BSF
If you want to disallow cavalry from ever charging elephants you would do it in ChargePermitted() function in CombatTool.BSF
-------------
CustomCampaignTools
May be used :
This is designed to be replaced in custom modules to mod various campaign functions
-------------
ForceSelectionTools
May be used :
To mod force selection
-------------
Functions
May be used :
Assorted functions for use in various places
-------------
GeneralTools
May be used :
To modify how generals work
In particular : allow to modify Generals range command
-------------
Globals
May be used :
To add additional global variables
-------------
HelperTools
May be used :
To mod various tooltip and tutorial functions
-------------
Macros
May be used :
To define new macros, or modify the existing ones. These can only be single integers.
-------------
MapTools
May be used :
To mod various functions used by random map generator.
-------------
MoraleTools
May be used :
To mod the morale rules
In particular : may be used to modify the routing effect of routed elephants on others units
-------------
MoreCampaignTools
May be used :
To mod multi-battle campaigns
-------------
MoreScenarioTools
May be used :
To mod various functions relating to random map and preset scenario battles
-------------
MoveCommandTools
May be used :
To mod the functioning of Group Movement
-------------
MPSShowArmyTools
May be used :
To mod the display of field army and garrison units between campaign battles
-------------
MultiPartSkirmishTools
May be used :
To mod the functioning of multi-battle campaigns
-------------
ObstacleTools
May be used :
To mod the functioning of obstacles
-------------
QuestControlsTools
May be used :
To mod the functioning of the campaign/sencario etc selection UI. Best left alone.
-------------
ScenarioTools
May be used :
NOT USED
-------------
StartTurnPreTools
May be used :
To mod various things that occur at the start of a turn.
-------------
Tools
May be used :
Assorted functions used in various places.
-------------
TournamentTools
Do not mod this!
-------------
TutorialTools
May be used :
To modify the display of tutorial popups
-------------
UITools
May be used :
To modify various UI functions
-------------
UndoTools
May be used :
To modify the functioning of the Undo order.
_____________________________________________________________________
DATA misc files
-------------
Terrain
May be used:
=> to change units move capacities on each terrain
-------------
Mapview
May be used :
=> to mod zoom functions
See here a post about this aspect : http://www.slitherine.com/forum/viewtop ... 92&t=79690
Squads files (Excel and csv)
May be used to modify units stats
See here for the complete units stats listing : http://www.slitherine.com/forum/viewtop ... 92&t=80096
You may work with excel page named Squads (stats are listed with rows and lines), and then, convert your excel page in a excel csv format
Explanations hre : http://www.slitherine.com/forum/viewtop ... 92&t=79680
For french players : les versions française et américaines de Excel étant incompatibles pour les séparateurs, il faut utiliser le processus indiqué ici :
http://www.slitherine.com/forum/viewtop ... 92&t=80110
________________________________________________________________
Other misc files : Data/UI/Textures/Battle files (images)
These files are images and may be edited with adapted program, they concern some aspects of interface of the game
(in particular effects of selections or actions on map : selected units, etc)
Sample : Unit_WaypointSelected.dds is the file that contents the image of the selected unit (gold square when you select one unit)
See this thread : http://www.slitherine.com/forum/viewtop ... 28#p683928
________________________________________________________________
Other misc file :/Documents/My Games/FieldOfGlory2/Options.txt
This file allows to modify some values options in game
In particular : speed of all move animations
Concerned value is :UnitSpeedHack
Min is 0, max is 10