• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Create custom campaign archive (*.w3n) with third party tools only (1.27)

Status
Not open for further replies.
Level 3
Joined
Dec 11, 2022
Messages
20
The file format of custom campaign MPQ archives (\.w3n) differs from those of individual map files (\.w3x). I am able to create and patch map files successfully using smpq (based on Ladik's libstorm). However, I couldn't do the same for custom campaign files.

Specifically, I could not override (replace) map files inside a campaign file. When I try to do it with any MPQ editor, the editor completes the task successfully, and then the game cannot load the patched map file warning that it's corrupted. Indeed, it does become corrupted, looking and comparing it with DemoCampaign.w3n in a hexeditor.

I went on a small journey to figure it out but failed. Share scripts among custom campaign maps

So, for 1.27 version of the game, how does one overwrite a map file inside a custom campaign using a third-party MPQ editor? Alternatively, how does one patch a map file by replacing it's scripts, localized strings, unit table, etc., given the map file is appended to a custom campaign file? The best solution will allow to create a custom campaign file completely from scratch using third party tools only. The process must be automatic since it's required for development and packaging.
 
Level 3
Joined
Dec 11, 2022
Messages
20
Map files are added to campaign archives just like any other file, using the same convenient MPQ tools that exist. There is only one single tiny catch. Map files must be added with additional arguments. Specifically, map files must be added as single unit and without compression (map file is already compressed anyway, compressing it again only strips the necessary map header).

Relevant threads:

More needs to be done to produce a campaign archive strictly from scratch, but frankly it's unnecessary anyway. What was most important for me is patching scripts and related metadata automatically. This much can be achieved with just an MPQ tool such as smpq and Batch or Shell scripts. If I ever complete my custom campaign I will share all snippets I used to make it as well.

For now, the point is, the existing tools can already handle modifying custom campaign archives just fine. Use them correctly (unlike me).
 
Status
Not open for further replies.
Top