Tutorial: Loading a Mod on Warsmash

Retera

Tool Reviewer
Level 27
Joined
Apr 19, 2008
Messages
1,184
Intro
In this tutorial, let's make a simple mod for Warsmash by modding the built-in campaign on the menu to load both the Reign of Chaos and the Frozen Throne missions in a single convenient menu layout. We should not have to do much work because we can already use an existing Warcraft III mod in this case, specifically the one conveniently created by loktar here: Warcraft III: All in One.

Requirements
You will need:
  1. Warsmash installed to your Warcraft III directory
  2. A download of the All in One mod from the tools section
  3. A simple text editor
Steps
Do the following:
  1. For the first step, copy the extracted contents of the All in One mod into your Warsmash directory.
  2. Now you should have "war3g.exe" in the same directory as your runnable Warsmash installation as well as some other files
  3. Open warsmash.ini in a text editor. It should look like this:
INI:
[DataSources]
Count=6
Type00=MPQ
Path00="..\war3.mpq"
Type01=MPQ
Path01="..\War3x.mpq"
Type02=MPQ
Path02="..\War3xlocal.mpq"
Type03=MPQ
Path03="..\War3Patch.mpq"
Type04=MPQ
Path04="resources.mpq"
Type05=Folder
Path05="."

Notice how the count of data sources is 6. This means that Warsmash will look in 6 total MPQs (or folders) to find game assets. Warsmash looks through the items on this list from bottom to top -- so the data source with the highest index (in this case Type05 and Path05) is the data source that has the highest priority and will override all others.

Change the Count value to 7. Then, create a new entry at the bottom of the data sources block that looks like this:
INI:
Type06=MPQ
Path06="war3g.exe"

This specifies that the final data source in our Warsmash load priorities will be the "war3g.exe" SEMPQ. By putting it at the bottom of our list, we give it the highest priority, so all of the custom content in this mod will take priority over other game data and assets loaded by Warsmash. Please note that despite the .exe extension, at no point in this tutorial do we need to actually run nor execute the "war3g.exe" as a Windows application. Instead, we are loading its contents because these kind of SEMPQ files double as MPQ files.

In summary, your warsmash.ini should now look like this:

INI:
[DataSources]
Count=7
Type00=MPQ
Path00="..\war3.mpq"
Type01=MPQ
Path01="..\War3x.mpq"
Type02=MPQ
Path02="..\War3xlocal.mpq"
Type03=MPQ
Path03="..\War3Patch.mpq"
Type04=MPQ
Path04="resources.mpq"
Type05=Folder
Path05="."
Type06=MPQ
Path06="war3g.exe"

Finishing Up
Now, double click your Warsmash.exe to run the mod engine, and you should see that the game will start to a different menu screen than before. You should now see a menu with the All in One mod menu and logos.
It should look something like this:
1617593864081.png

Try going to Single Player and then clicking on Campaign to see the modified campaign configurations.

We can see in the resulting view something very interesting! Warsmash attempts to load this mod, but Warsmash does not render everything exactly in the expected way.

1617594009679.png

So we might ask ourselves, what is going wrong here? Why does Warsmash offer us too many menu options when using this mod?
If you are interested in Warsmash development you can read on. If you are just a player who wants to tinker with launching different maps on Warsmash, what you can do is fight with the inconvenience of all these menu options and click on the lower half of the listed campaigns to load any Reign of Chaos or Frozen Throne campaign.

For Developers (Extra Credit)
The issue that we are seeing above is that Warsmash does not respect the DefaultOpen=1 setting for campaign data. This is because Warsmash does not have a working jass API yet for the ingame experience that would unlock campaign missions in a progressive manner, and so all campaign missions are unlocked by default. It turns out, the All in One mod has all of these campaign options internally but shows and hides them dynamically based on how the mod developer intended you to experience the game. If you are running Warsmash from source, you can do a source mod to see this content in the way that the All in One developer loktar originally intended.

The source mod needed in this case is to add if (campaign.isDefaultOpen()) as a new line above MenuUI.java line 574. This will cause campaign buttons for campaign level items on the menu not to be spawned into the Warsmash Menu UI unless the campaign has specified that it wishes to be open by default. After doing this source mod, if you compile and run your own Warsmash build, you should see something like this:

1617594740744.png

From here, you can click either of the Acts to see their respective data.
For example, here is what I see when I click on the "Act Two: The Frozen Throne" option:

1617594828522.png


If you got this far, then congratulations on testing both a Warcraft III mod on the Warsmash Engine, as well as creating a simple Warsmash engine source mod to support that specific Warcraft III mod!
 
Top