There are some UI tweaks I am doing for my own use (and maybe others if they are interested). Basically I want to provide more infomation about combat, terrain, and units in tooltip. My first one I did was to provide details about the calculation in FireLogic_HE--function CalculateDamageHE. I basically just added some tooltip text to show the different values used to calulate the damage. I want this to apply to all my campaigns, so it did the change in the Battle Academy\Data\Battle\Scripts folder (after backinig up a copy of the folder). Then I saw the following steps about modifying the scripts, and how you shouldn't modify the original:
1 – Find a campaign directory (e.g. 3Bulge) from the Campaigns directory in the game install, and copy it into your local My Documents\My Games\BBCBA\Campaigns directory.
2 – Copy the DataSquads.CSV file into the root of your copy of the campaign directory (e.g. My Documents\My Games\BBCBA\Campaigns\3Bulge) .
3 – Copy the Data\Battle\Scripts directory into e.g. My Documents\My Games\BBCBA\Campaigns\3Bulge\Data\Battle\Scripts.
4 – Open the Text1.txt file in your campaign. Change the IDS_CAMPAIGN_NAME string so you can easily pick it out on the campaign list.
So, would the safe way be for me to do the above with all of the stock campaigns and then put my changed files in the copy of the official campaign? Is there a way to just override one, or a couple of the script files without copying all of them. For instance, can I just put my copy of FireLogic_HE in a folder somewhere and the game would pick it up? Or can I have a file called FireLogic_HE, with just the function I modified (CalculateDamageHE) and put that somewhere to just override that one function?
Or is there a better way to modify the UI to include more information that I overlooked?
Here is a thread pertaining to what I am doing: viewtopic.php?t=31615
Thanks
How to override some functions for all campaigns?
Moderators: Slitherine Core, BA Moderators
How to override some functions for all campaigns?
Because I play too much,
One Guy, Too Many Games
One Guy, Too Many Games
-
pipfromslitherine
- Site Admin

- Posts: 9889
- Joined: Wed Mar 23, 2005 10:35 pm
Global overrides are something on my list, and have been for a while. The big issue is compatibility - needing to keep them compatible with the main game, and also with any mods which might make use of them. It's something of a logical pickle.
A solution might be to be able to hook into functions, wrap them if you will, so that the 'official' code always runs, but your code gets called before and after. But it would still be possible for changes to the game to break things. It's the same kind of issue WoW has, with addons falling behind the version changes and turning off.
I'll bring it up the task list a little for once the iPad version is complete. It's definitely something that would be useful even to us during development.
Cheers
Pip
A solution might be to be able to hook into functions, wrap them if you will, so that the 'official' code always runs, but your code gets called before and after. But it would still be possible for changes to the game to break things. It's the same kind of issue WoW has, with addons falling behind the version changes and turning off.
I'll bring it up the task list a little for once the iPad version is complete. It's definitely something that would be useful even to us during development.
Cheers
Pip
Re: How to override some functions for all campaigns?
Hi Rob,robc wrote: Or is there a better way to modify the UI to include more information that I overlooked?
There's the UnitInfoPopup that I was fiddling with for an OpFire addition. This is the popup when you use CTRL-Left-Click on a unit. You'll find the related files in the core folder ;
C:\Program Files\Slitherine\Battlefield Academy\Battlefield Academy\Data\UI
Two files ... UnitInfoPopup.bsf, UnitInfoPopup.txt.
Copy them to your campaign UI folder ;
\Documents\My Games\BBCBA\CAMPAIGNS\My_Campaign\Data\UI
The UnitInfoPopup is a good example of creating something that you can (1) open, (2) move (draggable), (3) and close when needed.
I'm gald to see you're interested in tweaking stuff ... Getting other players to like the changes is the tough part
- Merr
Having before and after events is a good idea that would probably help people in many cases. In my case it wouldn't work because I need to see some of the calculation variables for my tooltip. Now what would be really nice if you added the before and after events, but also exposed any of the interesting internal variables to them. I'm not familiar enough with the scripting, but it would be nice to have an object that represented the last HEAttack calculation and it exposed items like the base accuracy, any movement penelty used, cover damage reduction, etc.pipfromslitherine wrote: A solution might be to be able to hook into functions, wrap them if you will, so that the 'official' code always runs, but your code gets called before and after. But it would still be possible for changes to the game to break things. It's the same kind of issue WoW has, with addons falling behind the version changes and turning off.
Of course for my purpose it would be best just to have the official code log these things and display them in a log window or tooltip.
Because I play too much,
One Guy, Too Many Games
One Guy, Too Many Games
Re: How to override some functions for all campaigns?
Thanks for the info. I was playing with that UnitInfoPopup first and then thought a tooltip would be quicker for me to see. Creating a popup window to display detailed combat results would be interesting though. I'm currently just displaying the data from pre attack calculations. I think there is some extra stuff that occurs when the actual combat takes place.Merr wrote:Hi Rob,robc wrote: Or is there a better way to modify the UI to include more information that I overlooked?
There's the UnitInfoPopup that I was fiddling with for an OpFire addition. This is the popup when you use CTRL-Left-Click on a unit. You'll find the related files in the core folder ;
C:\Program Files\Slitherine\Battlefield Academy\Battlefield Academy\Data\UI
Two files ... UnitInfoPopup.bsf, UnitInfoPopup.txt.
Copy them to your campaign UI folder ;
\Documents\My Games\BBCBA\CAMPAIGNS\My_Campaign\Data\UI
The UnitInfoPopup is a good example of creating something that you can (1) open, (2) move (draggable), (3) and close when needed.
I'm gald to see you're interested in tweaking stuff ... Getting other players to like the changes is the tough part.
- Merr
I am also adding unit details to the tooltip if the user holds down ctrl-shift. Since there is a lot there I didn't want to always show it. It clutters up the precombat calculations tooltip.
Because I play too much,
One Guy, Too Many Games
One Guy, Too Many Games
Re: How to override some functions for all campaigns?
Please Pip,
Data, data, more information ...
Mayor detailed information units, calculations events of combat, etc ...
Please
Data, data, more information ...
Mayor detailed information units, calculations events of combat, etc ...
Please


