![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|||||||||
|
|
Thread Tools | Display Modes |
07-18-13, 03:11 PM
|
#11 |
|
Black Magic
![]() |
Time for an update. I had some severe limitations with my 'infrastructure' that I had coded into SH5 with my Generic Patcher. I could not easily add additional timers or commands to the game. Thus something had to be done about it.
I basically rewrote my entire infrastructure and framework to make it behave like a plug-in architecture. With a plug-in architecture it's very easy to add additions, add new code, etc. to the supporting framework. And I have accomplished this (totally coded in assembly!) ![]() With my new framework and architecture adding new timers, code for the new timers, adding new commands to the game, new code for those new commands, etc. is just a simple matter of telling the framework where to find the new code and 'plugging-in' the offsets needed so the framework can find the needed strings and code. The other great thing about my new architecture and framework is expandability and scalability. I'm no longer 'hard-coded' to certain things, I am free to do whatever my mind comes up with. If other people decide to add new items/commands/etc. to the game via assembly they can use my plug-in architecture to easily add their new additions. If one could view the code I wrote for all of this as a painting it would be the Mona Lisa. Currently I have added six new commands to the game: Independent engine controls: Both_engines_for_speed Port_engine_only Stbd_engine_only Electric engines on surface: Enable_electrics_surfaced Disable_electrics_surfaced Toggle_electrics_surfaced Currently these commands can only be accessed by using the script engine the devs included with the game. By using this command: Game.SubmarineCommands.ExecuteCommand() You can invoke the new commands above. Here is an example: Game.SubmarineCommands.ExecuteCommand( "Toggle_electrics_surfaced" ) I'll be releasing a test version here very soon so you all can test all the changes. I've been testing it for the last 2 days and haven't noticed any problems. I'm hoping for none but to think I wrote 100% perfect code would be foolish thinking (it hardly ever happens!). Thus by releasing a test version there will be many people testing the new framework and architecture for bugs/CTDs. One thing you will notice is the addition of a new section to the SH5.exe: TDWMisc. This new section basically contains all the new command strings but I've made it readable, writable, and executable so that it's very flexible and can be used as I see fit. The next version of the Generic Patcher has two new groups added to the sh5.exe: Hydrophone and Advanced Users. Currently the two patches dealing with the hydrophone are grouped under the Hydrophone group. Those functions I see fit for advanced users have been placed under the Advanced Users group (Orbit listener patches, Render patches, and some others). This should make it really easy for newbies to quit enabling every single patch since they don't care to read/investigate the patches (Files= and Notes=). If one enables the patches under Advanced Users they do it under their own risk. I've added the Advanced Users group to other patch files as necessary/needed. Last edited by TheDarkWraith; 07-18-13 at 03:26 PM. |
|
|
|
|
