• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Map Adapter

The problem with adapting to 1.27 or anything below 1.29 would be the natives that are exclusive to patches above 1.29. Even 1.32 to 1.31 is a challenge to work with.

Not in the near future I'm afraid. Without some utilization of either memhack or some complicated systems, it will take time to work on. Do note Lua maps (and by extension, C# or TS maps) are not available for downgrading.
 
Level 2
Joined
Jul 25, 2021
Messages
11
can this be used on lower version like 1.27 and below? i tried it after deepstrasz recommend me this, checked the import/file formats all are not ruined
by 1.31 ver, except these (prolly) what should i change of these thing on photo below? i don'y know jazz stuff nor confident to experiment it~
1627543685851.png

Long Story-Short, i opened my 1.20+ map on 1.31 and now im getting this error when opening on old w3
1627544036333.png
 
Level 13
Joined
Oct 18, 2013
Messages
690
Interesting concept, but there are some things that have been added that you will not be able to just downgrade without affecting gameplay.
 
Level 11
Joined
Aug 1, 2019
Messages
268
can anyone help i get these two error when i try to lunach any campaign map like sevenblood campaigns i will be grateful if anyone can tell me how to fix these error or maybe the tool owner can make an update to fix this because this happens with any campaign maps not just sevenblood campaign
 

Attachments

  • لقطة الشاشة 2021-09-06 152343.png
    لقطة الشاشة 2021-09-06 152343.png
    1.4 MB · Views: 84
  • لقطة الشاشة 2021-09-15 141323.png
    لقطة الشاشة 2021-09-15 141323.png
    1.4 MB · Views: 104
Level 9
Joined
Dec 29, 2017
Messages
152
Trying to convert sevenblood Path Of Damned Enhanced Campaign to 1.31.

I can't edit these 2 parse error. Is there nothing I can do for this?

These 5 Not named Compatible are the only issues i've found.
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    128.5 KB · Views: 40
Level 18
Joined
Jan 1, 2018
Messages
728
Trying to convert sevenblood Path Of Damned Enhanced Campaign to 1.31.

I can't edit these 2 parse error. Is there nothing I can do for this?

These 5 Not named Compatible are the only issues i've found.
Thanks for reporting this, I have updated the parsers so these two files no longer cause a parse error.

Note that the new version (v0.9.3.1) requires .NET 5.0
 
Level 9
Joined
Dec 29, 2017
Messages
152
Warcraft 1.31.1 still can't play it.

Even after removing the Unknown errors it still is unable to read map file.

Its Undead Campaign x01 Revamp By Seven Blood.

Feels like the Unknown errors are screwing me over.
 

Attachments

  • Untitled1.jpg
    Untitled1.jpg
    470.1 KB · Views: 48
  • Untitled2.jpg
    Untitled2.jpg
    268.7 KB · Views: 40
Level 18
Joined
Jan 1, 2018
Messages
728
Warcraft 1.31.1 still can't play it.

Even after removing the Unknown errors it still is unable to read map file.

Its Undead Campaign x01 Revamp By Seven Blood.

Feels like the Unknown errors are screwing me over.
Unknown status is not an error, it merely indicates a file format that's not supported.

I'm guessing it's the map script that causes it to be unplayable. If you try adapting a map that was already adapted for 1.31 before, the tool assumes the map script is compatible, because it uses a blacklist based on the natives that are available in the map's original patch (which will be 1.31 instead of 1.32 if the map was adapted already), but missing in the target patch (which is also 1.31, so the blacklist is empty).
 
Level 11
Joined
Aug 1, 2019
Messages
268
Unknown status is not an error, it merely indicates a file format that's not supported.

I'm guessing it's the map script that causes it to be unplayable. If you try adapting a map that was already adapted for 1.31 before, the tool assumes the map script is compatible, because it uses a blacklist based on the natives that are available in the map's original patch (which will be 1.31 instead of 1.32 if the map was adapted already), but missing in the target patch (which is also 1.31, so the blacklist is empty).
well can you adapted it and make it work and then upload them here
 
Level 18
Joined
Jan 1, 2018
Messages
728
well can you adapted it and make it work and then upload them here
For BlzCreateUnit/Destructable you can use the functions I provided in the first post.

For the functions in InitSounds, the SoundFacialAnimation functions are a new feature in 1.32, so these can be deleted. The SetDialogueKey functions bind the cinematic scene's title and text to the soundHandle. These two strings are then later retrieved from the sound in the PlayDialogueFromSpeakerEx function, which is a new Blizzard.j function. To fix this you can add this function similar to the way you add the BlzCreate functions, but modify it to take two additional parameters for the title and text:

JASS:
function PlayDialogueFromSpeakerEx takes force toForce, unit speaker, integer speakerType, sound soundHandle, integer timeType, real timeVal, boolean wait, string speakerTitle, string text returns boolean
    call TryInitCinematicBehaviorBJ()

    call AttachSoundToUnit(soundHandle, speaker)

    // Ensure that the time value is non-negative.
    set timeVal = RMaxBJ(timeVal, 0)

    set bj_lastTransmissionDuration = GetTransmissionDuration(soundHandle, timeType, timeVal)
    set bj_lastPlayedSound = soundHandle

    if (IsPlayerInForce(GetLocalPlayer(), toForce)) then
        call SetCinematicSceneBJ(soundHandle, speakerType, GetPlayerColor(GetOwningPlayer(speaker)), speakerTitle, text, bj_lastTransmissionDuration + bj_TRANSMISSION_PORT_HANGTIME, bj_lastTransmissionDuration)
    endif

    if wait and (bj_lastTransmissionDuration > 0) then
        call WaitTransmissionDuration(soundHandle, timeType, timeVal)
    endif

    return true
endfunction

Then change the invocations of PlayDialogueFromSpeakerEx to also pass the title and text strings, for example:

JASS:
call PlayDialogueFromSpeakerEx( udg_APG4_Undead, udg_Arthas, 'Uear', gg_snd_U01Arthas01, bj_TIMETYPE_ADD, 0.00, false, "TRIGSTR_30", "TRIGSTR_31" )

Don't forget to remove SetDialogueSpeakerNameKey and SetDialogueTextKey when you're done.

Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
 
Level 9
Joined
Dec 29, 2017
Messages
152
Ok So I have gotten it to work. I haven't fully played it yet but Instead of doing what you told me to with this

-------

function PlayDialogueFromSpeakerEx takes force toForce, unit speaker, integer speakerType, sound soundHandle, integer timeType, real timeVal, boolean wait, string speakerTitle, string text returns boolean
call TryInitCinematicBehaviorBJ()

call AttachSoundToUnit(soundHandle, speaker)

// Ensure that the time value is non-negative.
set timeVal = RMaxBJ(timeVal, 0)

set bj_lastTransmissionDuration = GetTransmissionDuration(soundHandle, timeType, timeVal)
set bj_lastPlayedSound = soundHandle

if (IsPlayerInForce(GetLocalPlayer(), toForce)) then
call SetCinematicSceneBJ(soundHandle, speakerType, GetPlayerColor(GetOwningPlayer(speaker)), speakerTitle, text, bj_lastTransmissionDuration + bj_TRANSMISSION_PORT_HANGTIME, bj_lastTransmissionDuration)
endif

if wait and (bj_lastTransmissionDuration > 0) then
call WaitTransmissionDuration(soundHandle, timeType, timeVal)
endif

return true
endfunction

------

I wasn't really sure where to add this (I added it at the end global) But I'm more confused about this line

------

call PlayDialogueFromSpeakerEx( udg_APG4_Undead, udg_Arthas, 'Uear', gg_snd_U01Arthas01, bj_TIMETYPE_ADD, 0.00, false, "TRIGSTR_30", "TRIGSTR_31" )

-------

Like what do you Mean I do with this? Originally I replaced all the Playdialoguefromspeakerex with adding lines like Trigster_30 and Trigstr_31 at the end instead. But that didn't seem to work.

After converting the BlzCreateUnitWithSkin with what you mentioned I simply deleted all the lines that were identified as incompatible. It works then. But who knows if there is some sort of problem that will occur.
 
Level 9
Joined
Dec 29, 2017
Messages
152
I have seemed to run into another error. Removing this seems to not fix the problem sadly. So hopefully you can teach me how to fish a little bit more.

The first 2 lines on the left.

EDIT: From further editing it seems removing these specific lines does in fact start the game (I must've accidently removed the wrong lines). However the game doesn't complete either. I'm not actually sure whats wrong with that. Mission 2 the Game did complete as soon as I picked up the Urn of King Terenas. But for mission 3 Even after destrying everything it doesn't seem to work.

Untitled.jpg
 
Last edited:
Level 11
Joined
Aug 1, 2019
Messages
268
For BlzCreateUnit/Destructable you can use the functions I provided in the first post.

For the functions in InitSounds, the SoundFacialAnimation functions are a new feature in 1.32, so these can be deleted. The SetDialogueKey functions bind the cinematic scene's title and text to the soundHandle. These two strings are then later retrieved from the sound in the PlayDialogueFromSpeakerEx function, which is a new Blizzard.j function. To fix this you can add this function similar to the way you add the BlzCreate functions, but modify it to take two additional parameters for the title and text:

JASS:
function PlayDialogueFromSpeakerEx takes force toForce, unit speaker, integer speakerType, sound soundHandle, integer timeType, real timeVal, boolean wait, string speakerTitle, string text returns boolean
    call TryInitCinematicBehaviorBJ()

    call AttachSoundToUnit(soundHandle, speaker)

    // Ensure that the time value is non-negative.
    set timeVal = RMaxBJ(timeVal, 0)

    set bj_lastTransmissionDuration = GetTransmissionDuration(soundHandle, timeType, timeVal)
    set bj_lastPlayedSound = soundHandle

    if (IsPlayerInForce(GetLocalPlayer(), toForce)) then
        call SetCinematicSceneBJ(soundHandle, speakerType, GetPlayerColor(GetOwningPlayer(speaker)), speakerTitle, text, bj_lastTransmissionDuration + bj_TRANSMISSION_PORT_HANGTIME, bj_lastTransmissionDuration)
    endif

    if wait and (bj_lastTransmissionDuration > 0) then
        call WaitTransmissionDuration(soundHandle, timeType, timeVal)
    endif

    return true
endfunction

Then change the invocations of PlayDialogueFromSpeakerEx to also pass the title and text strings, for example:

JASS:
call PlayDialogueFromSpeakerEx( udg_APG4_Undead, udg_Arthas, 'Uear', gg_snd_U01Arthas01, bj_TIMETYPE_ADD, 0.00, false, "TRIGSTR_30", "TRIGSTR_31" )

Don't forget to remove SetDialogueSpeakerNameKey and SetDialogueTextKey when you're done.
i still gets the error can you please make a video as tutorial on how to do it pls
 
Level 18
Joined
Jan 1, 2018
Messages
728
i still gets the error can you please make a video as tutorial on how to do it pls
You mean the error in world editor?
Fixing the map script does not fix the triggers, if you fix the map script it should be possible to play in 1.31 but opening it with 1.31 world editor will still fail.
This is because in order to parse the triggers file, the world editor must know all the GUI functions, but since PlayDialogueFromSpeaker was added in 1.32 it fails to load the file.
The tool currently does not check if the trigger data is compatible with the target patch, so it will show war3map.wtg is compatible even though it's not.
Easiest fix if you want to open the map in 1.31 world editor is to delete this file.
 
Level 11
Joined
Aug 1, 2019
Messages
268
You mean the error in world editor?
Fixing the map script does not fix the triggers, if you fix the map script it should be possible to play in 1.31 but opening it with 1.31 world editor will still fail.
This is because in order to parse the triggers file, the world editor must know all the GUI functions, but since PlayDialogueFromSpeaker was added in 1.32 it fails to load the file.
The tool currently does not check if the trigger data is compatible with the target patch, so it will show war3map.wtg is compatible even though it's not.
Easiest fix if you want to open the map in 1.31 world editor is to delete this file.
no that not what i meant i don t think that I'm doing the replace and delete things in a right way because i don t understand what you mean up there because English in not my main language so i will be thankful if you make a video to teach me how to do it the right way and sorry for annoying you with my problem
 
Level 18
Joined
Jan 1, 2018
Messages
728
no that not what i meant i don t think that I'm doing the replace and delete things in a right way because i don t understand what you mean up there because English in not my main language so i will be thankful if you make a video to teach me how to do it the right way and sorry for annoying you with my problem
I'm not really good at making tutorial video's, sorry if my explanation is not clear enough.

However I'm currently working on improving the tool to use my JASS parser instead of Regex, that way I can also automatically apply fixes to the map script, so you won't have to do this manually anymore.
For this to work you need to have the common.j and blizzard.j files, I'm also planning on utilizing more game files (for example triggerdata.txt) instead of hardcoding all this stuff so it will be easier to target any patch, however you'll have to provide those game files yourself, they won't be included with the tool.
 
Level 18
Joined
Jan 1, 2018
Messages
728
I have updated the tool to v1.0.0, due to the nature of the changes I'll keep the previous version v0.9.3.1 uploaded as well.

This version has removed (almost) all hardcoded stuff (only lua map scripts will still use the old regex approach).
In order to accomplish this the tool will now require you to provide some of the game files.
You should be able to add any target patch now as long as you have the files.
See the updated first post for more details.
 
Level 11
Joined
Aug 1, 2019
Messages
268
I have updated the tool to v1.0.0, due to the nature of the changes I'll keep the previous version v0.9.3.1 uploaded as well.

This version has removed (almost) all hardcoded stuff (only lua map scripts will still use the old regex approach).
In order to accomplish this the tool will now require you to provide some of the game files.
You should be able to add any target patch now as long as you have the files.
See the updated first post for more details.
ok so now i face this error i know i should download a file to fix it but what file should i download and also where should i put it
 

Attachments

  • 20220120_111230.jpg
    20220120_111230.jpg
    794.9 KB · Views: 44
Level 18
Joined
Jan 1, 2018
Messages
728
ok so now i face this error i know i should download a file to fix it but what file should i download and also where should i put it
You need to extract the game files (from CASC or MPQ in earlier versions) of your target patch to a folder, then update the path in appsettings.json to point to that folder.
 
Level 18
Joined
Jan 1, 2018
Messages
728
so my version is 1.31 and i need files from an earlier version and put it in the maps that i want to adopt right or i understand it wrong
If you want to play the map on 1.31 then you need the game files from 1.31
To get the files from 1.31 you need to use a tool that can extract a CASC archive, for example CascView
Then you need to update appsettings.json so the GameDataPath is the location where you extracted the game files
If you do this correctly the tool will no longer give a file not found error
 
Level 11
Joined
Aug 1, 2019
Messages
268
If you want to play the map on 1.31 then you need the game files from 1.31
To get the files from 1.31 you need to use a tool that can extract a CASC archive, for example CascView
Then you need to update appsettings.json so the GameDataPath is the location where you extracted the game files
If you do this correctly the tool will no longer give a file not found error
where can i find these files because i didn t find them in the game folder or the documnts
 
Level 18
Joined
Jan 1, 2018
Messages
728
where can i find these files because i didn t find them in the game folder or the documnts
 
Level 11
Joined
Aug 1, 2019
Messages
268
i found it but it stuck at the extract files how long should it take
 
Level 11
Joined
Aug 1, 2019
Messages
268
hey man it s me again i extracted the files and i changed the but i still get the error maybe I'm doing it in a wrong way that's way i made a video and I'm not good at making videos and don t pay attention to the screen problem and sorry for annoying you again
 

Attachments

  • 20220122_132620.mp4
    1.8 MB
Level 18
Joined
Jan 1, 2018
Messages
728
hey man it s me again i extracted the files and i changed the but i still get the error maybe I'm doing it in a wrong way that's way i made a video and I'm not good at making videos and don t pay attention to the screen problem and sorry for annoying you again
The path is incorrect, you kept "C:\\path\\to\\.." which is only a placeholder, you also need to remove the "scripts" at the end.

So in your case the path should be: "C:\\Users\\orange 2021\\Documents\\Warcraft III\\war3.w3mod"
 
Last edited:
Level 11
Joined
Aug 1, 2019
Messages
268
The path is incorrect, you kept "C:\\path\\to\\.." which is only a placeholder, you also need to remove the "scripts" at the end.

So in your case the path should be: "C:\\Users\\orange 2021\\Documents\\Warcraft III\\war3.w3mod"
i think it works but now i get this error
a new guard page for the stack cannot be created
 

Attachments

  • 20220122_214317.jpg
    20220122_214317.jpg
    491.6 KB · Views: 40
Level 11
Joined
Aug 1, 2019
Messages
268
I mean when does it happen, right after you start the tool or when you try to adapt something? Can you show me what your appsettings.json looks like now?
hi man i know its been about a month now but i was really busy in this month however i will upload the pic in case you want to continue and try to fix that error

and also that error happened when i tried to adopt the campaign
 

Attachments

  • 20220215_105843.jpg
    20220215_105843.jpg
    145.4 KB · Views: 31
Level 18
Joined
Jan 1, 2018
Messages
728
hi man i know its been about a month now but i was really busy in this month however i will upload the pic in case you want to continue and try to fix that error

and also that error happened when i tried to adopt the campaign
Do you get the same error when you try to adapt different maps/campaigns?
If so, can you try to adapt the files manually (right-click the file and select 'Adapt')? Do you get this error then for every file you try to adapt or only war3map.j?
 
Level 11
Joined
Aug 1, 2019
Messages
268
Do you get the same error when you try to adapt different maps/campaigns?
If so, can you try to adapt the files manually (right-click the file and select 'Adapt')? Do you get this error then for every file you try to adapt or only war3map.j?
yeah i tried to adopt different maps and campaigns and i get the same error and also tried to adapt the files manually but didn t work and for the third one i don t which files are war3map.j and which not
 
Level 18
Joined
Jan 1, 2018
Messages
728
You can look at the FileName and FileType columns to see which file is war3map.j.
Have you tried adapting lua maps?
 

Attachments

  • example.png
    example.png
    8.7 KB · Views: 25
Level 18
Joined
Jan 1, 2018
Messages
728
Can you click on one of the files with status "AdapterError"? What message does it show on the left side?
The files which have AdapterError are all Object Data files, which rely on the .slk files in war3.w3mod, so it seems like there is still an issue with the files or the path/settings.
Can you also check if there's an error message for the war3map.wtg files which has status "ParseError"? I'm interested why this file could not be parsed.
 
Level 11
Joined
Aug 1, 2019
Messages
268
Can you click on one of the files with status "AdapterError"? What message does it show on the left side?
The files which have AdapterError are all Object Data files, which rely on the .slk files in war3.w3mod, so it seems like there is still an issue with the files or the path/settings.
Can you also check if there's an error message for the war3map.wtg files which has status "ParseError"? I'm interested why this file could not be parsed.
hey man sorry for me disappearing but i was busy how ever the adapter error dont show me the error when i click on it but the parseError give me this

Could not find a part of the path 'C:\Users\orange 2021\Documents\Warcraft III\war3.w3mod\ui\triggerdata.txt'.
 
Level 18
Joined
Jan 1, 2018
Messages
728
hey man sorry for me disappearing but i was busy how ever the adapter error dont show me the error when i click on it but the parseError give me this

Could not find a part of the path 'C:\Users\orange 2021\Documents\Warcraft III\war3.w3mod\ui\triggerdata.txt'.
For some reason it still can't find the files it needs, I'm guessing it's related to your system language. I have added some additional diagnostic messages, can you try again in the new version?

Also, v1.1.0 changelog:
  • Improved handling of (mpq-)protected maps;
  • Can now select multiple files to adapt or remove them all at once;
  • Added a progress bar when opening and saving maps;
  • Added file exists checks and improved diagnostics before trying to open game files (from the path defined in your appsettings.json).
 
Level 11
Joined
Aug 1, 2019
Messages
268
For some reason it still can't find the files it needs, I'm guessing it's related to your system language. I have added some additional diagnostic messages, can you try again in the new version?

Also, v1.1.0 changelog:
  • Improved handling of (mpq-)protected maps;
  • Can now select multiple files to adapt or remove them all at once;
  • Added a progress bar when opening and saving maps;
  • Added file exists checks and improved diagnostics before trying to open game files (from the path defined in your appsettings.json).
wait my system language is arabic is that really the problem well i will try the new version and tell you if it works or not

edit:eek:k now when i adopt its doesn't crash but still the object files data give me a config error and also when i changed the game path to the war.mod place the adopter didn't start after it and this is what the config error says:
Required file not found: C:\path\to\war3.w3mod\scripts\common.j
Directory not found: C:\path\to\war3.w3mod\scripts
Directory not found: C:\path\to\war3.w3mod
Directory not found: C:\path\to
and the required file is different in every error
 
Last edited:
Level 18
Joined
Jan 1, 2018
Messages
728
wait my system language is arabic is that really the problem well i will try the new version and tell you if it works or not

edit:eek:k now when i adopt its doesn't crash but still the object files data give me a config error and also when i changed the game path to the war.mod place the adopter didn't start after it and this is what the config error says:
Required file not found: C:\path\to\war3.w3mod\scripts\common.j
Directory not found: C:\path\to\war3.w3mod\scripts
Directory not found: C:\path\to\war3.w3mod
Directory not found: C:\path\to
and the required file is different in every error
The default appsettings has overwritten the one you had, you need to change the GameDataPath again.
I wanted to know if your arabic system language could be the cause so now when the file is not found it will also report the folders/directories in the path that it cannot find.
 
Is there a command line version of this? I think it would be pretty useful if we could input specific files to adapt.

EDIT: Another issue I've noticed is that maps saved with 1.32's folder mode will sometimes use forward slashes (/) for models/textures in object editor fields. This is apparently unsupported on earlier patches so being able to automatically convert those would be great.
 
Last edited:
Level 18
Joined
Jan 1, 2018
Messages
728
Is there a command line version of this? I think it would be pretty useful if we could input specific files to adapt.
Haven't done any work on it yet but it's planned: War3App/src/War3App.MapAdapter.Console at master · Drake53/War3App

EDIT: Another issue I've noticed is that maps saved with 1.32's folder mode will sometimes use forward slashes (/) for models/textures in object editor fields. This is apparently unsupported on earlier patches so being able to automatically convert those would be great.
Do you know if this issue exists in 1.31 as well? Since that's when folder mode was introduced.
I assume this issue applies not only to object editor files but also the map script, sounds, etc.
 
Do you know if this issue exists in 1.31 as well? Since that's when folder mode was introduced.
I assume this issue applies not only to object editor files but also the map script, sounds, etc.
I don't think it exists in 1.31 and yeah it also applies to the map script. I would guess anywhere the path is referenced would be affected.
 
Level 2
Joined
Aug 17, 2021
Messages
6
Haven't done any work on it yet but it's planned: War3App/src/War3App.MapAdapter.Console at master · Drake53/War3App


Do you know if this issue exists in 1.31 as well? Since that's when folder mode was introduced.
I assume this issue applies not only to object editor files but also the map script, sounds, etc.
hi bro, please !! :( can you convert this map war reforged to war3 class, i played on war3 1.27 , becaouse of my pc dont run NET 5.0 Runtime , thank you lots of ^^
 

Attachments

  • D map tested.w3x
    8.3 MB · Views: 10
Level 17
Joined
Feb 25, 2013
Messages
303
Can this be used to make old maps playable in Reforged?
Warcraft can always load maps made in an older version aside from 2 specific cases: Maps from the 1.31 PTR and some maps from 2001. You don't need the adapter for them to be playable as long as they don't use hacky methods that can hard-lock them. And if they did, the adapter will most likely not be able to change this, and there are also 2 most promininent cases of that: using functions that broke after the map's release (e.g. a large few of the graphics-only functions like those used to change SFX orientation), and using very questionable methods of storing map data which include SLKs and obfuscated code (note that obfuscated code will very often hardcode the neutral players' numbers which breaks on all versions 1.29+).
 
Top