Xetanth87's Campaign Splitter - Play Custom Campaigns in Reforged

This bundle is marked as pending. It has not been reviewed by a staff member yet.
Xetanth87's Campaign Splitter


Description:
It can split campaign files (w3n) into separate map files (w3m/w3x) and add all the campaign data inside the map files. It can be used to make Custom Campaigns playable in Reforged. You could even create your own Custom Campaigns in the Reforged World Editor, and the players can split them on their own computer. Everything from the campaign is merged correctly into the map files: custom data (units, items, abilities, upgrades, etc.), gameplay variables, custom interface, imports and strings!


224107-6ac1e8d316b3e6367e778049eb73633a.png

Features:
Maps have their titles changed to campaign button titles and have an added index at the start, so they may appear in order in the Custom Games interface.
223206-212b4258cd23e625144101f7d86310a4.png

There is an option to add a difficulty selector to the extracted maps, since you can't select the difficulty in the Custom Games menu. Selecting the "Default" option is recommended, because it will only add it if the campaign author chose the "Variable Difficulty" setting when making the campaign.
223221-9c758629627552dd2ad4a04b525ce777.png
There is an option to replace the map preview with the campaign preview, hiding the minimap.
223521-f8c0d13f572f19639564c8a432d0d20f.png
223524-b575e4361572fb129af015070e0eafa0.png

There is an option to show the name of the next map upon victory. This is very useful for campaigns with branching paths, because map transitions are not possible in Reforged.
224109-9408daa15a66036afbe38db24fdf10ff.png
There is an option to add Legacy Assets (Reign of Chaos models that were removed in Reforged).

You must place the "legacy.zip" archive in the same folder as the Campaign Splitter jar! Do not extract it!
223860-9eeb48d8ad20ec202b6c58da4d7f174c.png


Reign of Chaos and The Frozen Throne models and icons in 1.31.1 (Classic)
223850-5a3551d0c5bfdebaf8130c7f1efed852.png

Reign of Chaos and The Frozen Throne models and icons in 1.32 (SD Reforged)
223851-a02e54e69e096004fcea30d4aa87e644.png

Reign of Chaos and The Frozen Throne models and icons in 1.32 (SD Reforged) with Legacy Assets enabled
223852-f44a049a56145f1d66e12dae1bb81754.png
There is an option to remove Upkeep from all extracted maps.
223849-df9291de6e34a6cbabd1ee4ec39b8f36.png

Notice:
One thing to note is that splitting the campaign will copy all imported assets, making each map file quite large, so you will need to be careful to delete the map files whenever you don't want to play them, and re-split the campaign when you do. If you have a directory named "temp" inside the folder where the extracted maps are placed, it will be deleted along with all its contents.

Requirements:
Requires Java SE 8 - https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html
Download Java Runtime Envirnoment 8u333 installer for your OS (probably Windows x64) and install it. Now you can run the jar file.

How to use:
You can use "CampaignSplitterGUI.jar" to open the GUI that lets you select a campaign.
If you want to have the legacy models (recommended when playing the campaigns in SD Reforged), place the "legacy.zip" archive in the same folder as the jar file. Do not extract it!

Tutorial video:

unknown.png

unknown.png

WC3ScrnShot_070922_135001_001.png

WC3ScrnShot_070922_134831_001.png


- Does not work on all versions.
- Some classic maps can break if you are playing them in HD.
- Maps played in HD will have mute units if they are using SD models.
- Localization is not treated yet.
- Lua maps can't get script modifications to allow some features.
- Can't split campaigns with readonly/protected maps.

2022-08-02
- Added next level message option.
2022-07-30
- Added legacy assets.
- Added "legacy.zip" archive.
2022-07-29
- Added the exception stacktrace to the UI.
- Added an error message that appears when readonly/protected maps are encountered.
2022-07-24
- Added an option that removes Upkeep from each map.
2022-07-23
- Game is now paused and pitch black during difficulty selection.
- Added an option that allows the campaign preview to replace the minimap preview of each map.
2022-07-21
- No longer shows warnings about files not found as error messages.
- Added map counter messages.
- Difficulty Selector option is now a radio group with 3 options: No (Don't add), Default (Only add if the campaign has the "Variable Difficulty" setting), Yes (Add).
- Added tooltips to explain the radio choices.
2022-07-17
- Campaign skin/interface strings are now offset as well.
- Fixed skin offset method to use any non-numerical delimiter.
- Improved error messages.
- Temporary files are now removed when the splitter is stopped or when an error is encountered.
- Fixed loading screen being changed to melee.
- Script files that appear in the "scripts" folder will now have the difficulty selector added to them as well.
2022-07-16
- Fixed imports with backspace character.
- Campaign files are only extracted once.
- Added progress bar, output display area and time of conversion.
- Fixed a problem when a map imports an asset with the same path as an imported asset from the campaign.
2022-07-14
- Removed CampaignSplitterCLI.jar.
- Added a checkbox that can be used to enable a difficulty selection dialog in each of the extracted maps.
- The splitting process can now be stopped.
- It is now more clear when the splitting process is running. You can tell by the button colors.
- When the splitting process stops, all temporary files are removed.
- Browsing when the path is set to a folder leads to that folder instead of its parent.
2022-07-13
- The title of each map is now changed to match its respective button. An index is also included at the start of the title, so they are shown in order. Zeroes are added at the start of numbers to enforce this order. ("9" would go after "10", but "09" goes before "10").
2022-07-12
- Backspace character in Import files now correctly treated as "\rwar3campImported\\" instead of "\r".
2022-07-09
- Fixed parsing "\u001D" in Import files.
- Fixed some map unit data not being added to the exported map.
2022-07-03
- First Release

Wc3libs MPQ Parser - https://github.com/inwc3/wc3libs
BogdanW3, Water, Rayman.90, StormKnight, william lean/MayDay - Helped me on the HiveWorkshop Discord Server.
Retera - Inspired me to code a Wc3 tool in Java.


YouTube Channel: https://www.youtube.com/channel/UC8flW32H3ocaTlU3bf14BEw
Discord Server: https://discord.gg/J5guv3BHVc
If you want to support this tool, you can help me by becoming my patron on Patreon.
Alternatively, you can donate through BuyMeACoffee: https://www.buymeacoffee.com/xetanth87
Contents

CampaignSplitterGUI.jar (Binary)

Legacy Assets Archive (Binary)

Can this be used for versions lower than 1.31? Asking for a friend.
I have only tested campaigns saved in 1.31.1. The extracted maps worked on both 1.31.1 and 1.32. I'd guess it won't work backwards, but I think it should work forward. If I can play a 1.28 campaign in 1.31.1, I think playing the map extracted from one could work as well.
 
How does your tool react to maps that have custom object data in addition to the campaign object data?

Is it even capable of combining the two or will it overwrite the map data?
It takes the campaign data as a base and applies all map modifications on top of it.

If you create a new unit and name it "George" (unit name field) and in the map you change it to "Steve" (unit name field), the map unit name field will overwrite the campaign unit name field. This also works with map units that are copies of campaign units.

As for strings, it keeps map strings intact, but offsets the campaign strings by the number of map strings, and changes all campaign data strings to be offset by the same amount as well. The reason I have to do this is that maps and campaigns use the same string index for different texts, and keeping 2 of them with the same index makes one of them appear in both places.

You should try it yourself, and tell me if you find any problems with it.
1657370659362.png
 
Last edited:
View attachment 403325
New feature that will be added soon: Automatically adding a difficulty dialog to each map, since Reforged doesn't have an in-game difficulty selector.
And anyways, the in-game campaign difficulty selector was broken in TFT as well, so that it applied the chosen difficulty to the first map only. Map makers had to create this kind of a dialog anyways, if they were aware of the bug.
 
And anyways, the in-game campaign difficulty selector was broken in TFT as well, so that it applied the chosen difficulty to the first map only. Map makers had to create this kind of a dialog anyways, if they were aware of the bug.
There is a fix for that. Maps started from custom campaign buttons use the custom campaign difficulty, but maps started from the "Continue" button after victory use the official campaign difficulty.
 
There is a fix for that. Maps started from custom campaign buttons use the custom campaign difficulty, but maps started from the "Continue" button after victory use the official campaign difficulty.
Very interesting. Thanks for sharing.

But from the point of view of an uninformed player, the difficulty dialogue box is still probably the best option. Please just make it optional in the case the map maker has already made such a box. (Because our Dwarf Campaign and Gnoll Campaign already have such a box. However, Dwarf Campaign can already be downloaded as separate maps, so we would have the issue mostly with the Gnoll Campaign.)
 
Very interesting. Thanks for sharing.

But from the point of view of an uninformed player, the difficulty dialogue box is still probably the best option. Please just make it optional in the case the map maker has already made such a box. (Because our Dwarf Campaign and Gnoll Campaign already have such a box. However, Dwarf Campaign can already be downloaded as separate maps, so we would have the issue mostly with the Gnoll Campaign.)
I know. I already did. You can see it in the preview
 
Can't wait to try this out. But I'm getting this runtime error on clicking "Browse". Tried JRE SE 8 & JRE 18. Any idea why?
View attachment 403802
Since it seems to be started by you clicking "Browse", I think it couldn't find your "Documents" directory (the default directory for the File Chooser window). You could try to type/copy a directory path into the text box and then click browse. Tell me if this helped or didn't help.
 
Last edited:
Level 2
Joined
Sep 4, 2019
Messages
2
Since it seems to be started by you clicking "Browse", I think it couldn't find your "Documents" directory (the default directory for the File Chooser window). You could try to type/copy a directory path into the text box and then click browse. Tell me if this helped or didn't help.
Hey I tried filling in some directory names in the text field but still getting the same error. But I managed to run it by using the following command I found online:
JASS:
java -Djava.util.Arrays.useLegacyMergeSort=true -jar CampaignSplitterGUI.jar
Now I can split w3n files no problem (Playing Mordorks Quest in Reforged 1.32, AMAZING). Great work BTW!!
I think this might be a bug in Swing. Not sure why it only manifests on my machine (My locale is ZH_CN maybe?)
 
Last edited:
Hey I tried filling in some directory names in the text field but still getting the same error. But I managed to run it by using the following command I found online:
JASS:
java -Djava.util.Arrays.useLegacyMergeSort=true -jar CampaignSplitterGUI.jar
Now I can split w3n files no problem (Playing Mordorks Quest in Reforged 1.32, AMAZING). Great work BTW!!
I think this might be a bug in Swing. Not sure why it only manifests on my machine (My locale is ZH_CN maybe?)
Are you running some custom version of Windows? If yes, that could be it. I have no idea about locale, though. I'm glad you found a solution!
 
Level 1
Joined
Oct 8, 2021
Messages
1
Hi, i downloaded everything needed, but when i go to open the programm with java, java flash a black page and then dont do anything, how can i do?
 
Trying to use it now, but the java download is requiring me to make an Oracle account just to download that legacy version. Is there any way to avoid requiring us to sign up to it, or is it a requirement to access the java plugin.
I haven't downloaded it in a while, but I remember needing an account the last time I did. I'll check for another link when I have some time. If you find one without authentication by then, you should tell me.
 
Last edited:
Level 25
Joined
Feb 18, 2014
Messages
3,467
There is an option to show the name of the next map upon victory. This is very useful for campaigns with branching paths, because map transitions are not possible in Reforged.
Interesting. So campaigns that uses map transition like the Founding of Durotar will not let you go back and forth between submaps? It's a shame. I was really hoping to get my custom campaign Legacy of Lordaeron to work on Reforged...
 
Interesting. So campaigns that uses map transition like the Founding of Durotar will not let you go back and forth between submaps? It's a shame. I was really hoping to get my custom campaign Legacy of Lordaeron to work on Reforged...
Sadly those don't work simply because of the lack of map transitions in Reforged. My tool shows the name of the next map only when the game is ended with victory. So it wouldn't help in this case.
 
Top