Re: Coming soon :)
« Reply #25 on: May 19, 2019, 10:32:03 AM »
Warcraft II Plugin Interface ( including demo plugins )
This will install a small file called "LC.dll" and make a few modifications to Warcraft II BNE.exe that link it.
A "plugins" folder will be created in the wc2 folder. Plugins can be placed in this folder will be automatically loaded when you run wc2.
This will allow a variety of mods to be easilly installed/uninstalled by users.
If there is nothing in the "plugins" folder, there is no change to how the game functions.
A plugin is simply a dll file that has the extension changed to "w2p".
There are currently only 3 hook points, although I may add more in the future if there is a demand.
The hook points can be accessed by exporting appropriately named functions from a plugin dll.
w2p_init has no arguments and is called when the exe is first started.
create_game will be passed a pointer to the game name and called when the player creates a game.
join_game will be passed a pointer to the game name and called when the player joins a game.
screen_update will be passed a value that describes the current game screen and will be called immediately before each screen update.
... so to make a simple plugin all you need to do is make a dll file that exports one function called "w2p_init" that takes no agruments, then rename it to "MyPlugin.w2p" or whatever and put it into the "plugins" folder. Your plugin will then be injected into the WC2 process when you next run it.
I will try to do some examples later when time allows.
---------There are 4 example plugins included. If you don't want any of them, you can disable/enable them individually just by moving them in or out of the plugins folder (of course exit WC2 first then restart).
The "Lobby Map" plugin
The "lobby map" Plugin gives you a preview of the map in the pre-game lobby.
The "Game Time" plugin
The "Game Time" plugin just adds a small game timer to the in game screen.
The "Chop Bars" plugin
The "Chop Bars" plugin gives you an on-screen progress bar for chopping peons that you own and are selected.
The "Allied Colors" plugin
The "Allied Colors" plugin give you the option of displaying all allies in blue and all enemies in red on the mini-map.
Press F2 to toggle this on/off. It is off by default.
----------------------To install download THIS zip file and copy/replace its contents into a combat43 installation.
This is still in development, but appears to be working and stable for me .... please test!
Note: The plugin framework currently only supports BNE 2.02 (Combat Edition 4.3), it does not support CE 4.4 or the GOG version. If there is a demand it can be ported at a later date.