by Crazy Cossack » 10 Oct 2018, 23:37
I need some links to good explanations of hooking code (non-destructive and destructive) in Sup Com / FA / FAF.
When I modded Cossacks 3, the method was to replace one or more whole script file(s) with the modded whole file(s). The scripts are written in object pascal. Even if I was just changing a few parameters in a large file, I had to destructively replace (or hook) that whole file over the vanilla game file. Their mod manager automatically did the file replacements or overwrites during load. This meant I was using the tools Notepad++ for file editing and WinMerge to merge new patch code after a patch or new version release, if the release affected the file in question. So I am familiar with those tools. Each patch or release would break the mod if the patch changed files that the mod had changed. Then I had to use WinMerge to compare files and place the new patch code into my modded file(s). At the same time, I had to be careful to not overwrite or lose any of my modding changes already in that file. So, I guess you could say the modding method provided by Cossacks 3 was destructive hooking at whole of script file level. A new release or patch often broke the mod which led to lots of maintenance.
If I was just changing some parameters of units (in the blueprint files) in FAF (as a learning exercise) how would I go about hooking these changes in? Take the simplest example. Imagine I was changing the health of the UEF ACU (in UEL0001_BP) what would be the simplest, most elegant way to hook that?
Footnote: I got sick of patches always breaking my Cossacks 3 mod and in the end I stopped supporting it. Cossacks 3 was released in a poor state and needed constant patches to fix the multiple problems it had. Every patch broke my mod and it took hours of comparing and merging to fix it each time. That left too little time and energy for new changes.