• 🏆 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!

W3x2Lni v2.7.2

W3x2Lni is a wc3 map management tool. It helps you to manage your maps when developing or publishing.We defined 3 formats for a wc3 map, and w3x2Lni allows you to convert your maps amongst these 3 formats which are `Lni`, `Obj` and `Slk`.

> Lni
`Lni` is a VCS (like git, svn) friendly format. It looks like a directory. Most binary files in w3x will be converted into plain text files (yes! human-readable) by w3x2Lni which will also organize and categorize these text files.

> Obj
`Obj` is a wc3-readable and WE-readable format. If you want to open your map with WE, convert your map into this format.

> Slk
`Slk` is only readable by wc3 and should be used for final distribution. W3x2Lni enables multiple optimization for this format, including:

* Objects converted to slk
* Removed unreferenced objects
* Removed WE-only files
* Inlined WTS strings
* Compressed mdx
* Removed comments and unncessary white spaces in the script
* obfuscated variable and function name

W3x2Lni comes with war3 1.27.1 English data files. But it may not meet everyone's needs, you can use `w2l mpq <war3_path>` to extract data files.


For more information see the documentation.


W3x2Lni is a open source project.We welcome any pull request, e.g. improving the English text or writing English documents.
Contents

W3x2Lni v2.7.2 (Binary)

Reviews
eejin
The tool works as one would expect. The UI is nice and to the point. Only thing I am missing is a back button wen you have chosen a conversion mode. You also cannot scroll horizontally when viewing the log when converting to Lni. I am looking...
Level 4
Joined
May 31, 2018
Messages
92
Hello! First, I'd like to really thank you guys for this tool, it is beyond awesome and has allowed me to do create some really useful scripts by parsing the .ini files. However, I have a small concern with the JASS optimization performed by the tool.

It appears that, when I declare a
constant key
, the tool correctly inlines the variable as a constant. However, when I delcare a key as non-constant, those keys are not inlined correctly. When I check the script inside the SLK map, those keys are not
constant integer
, just
integer
. However, in the OBJ version of the map (converted from LNI), all these non-constant keys are constant integers.

Missing `constant` is a bug, i will fix it in next version. And I guess there is an other tool inlined constant variable, is it?
 
Level 4
Joined
May 31, 2018
Messages
92
Seems this warning is causing an issue in version 2.5.1 that I did not experience with version 2.4.4. The issue causes the hero to change to mountain king, and has default MK abilties from what i've heard.

I've attached two photos labeled 2.4.4 and 2.5.1, that show the unit(s) that are affected due to doubled up unit id, and being not case sensitive as you've mentioned.

• 2.4.4 - Correct unit and abilities are as they should be
• 2.5.1 - Incorrect unit and abilities when selected

This was tested on the same version of the map, and using 2.4.4 results in it not being an issue. Also note, that I did manage to get the complete listfile to work with w3x2lni and that error shouldn't be an issue or connected.

Thank you, I will fix it in next version.
 
Level 12
Joined
Jun 12, 2010
Messages
413
@_Guhun_ @Unitil Plz help me check the new version AppVeyor
Because of some deep-seated changes, I'm worried about other problems.

I check it out, using the maps I sent you and 2 custom maps with over 3000 custom objects, and everything seems to be working.

I did have a weird warning:
Spell Book 'Aspb' [Spell Book] will be merged - Base order ID 'spellbook' invalid

This showed up on a map that has no custom objects at all.

The constant variables are no longer converted to normal variables. They still aren't inlined, but now I can use Vexorian's optimizer to inline them without having to set everything back to constant. Thank you!
 
Level 12
Joined
Jun 12, 2010
Messages
413
I've run into a strange little issue. Whenever I convert a map to .obj (from LNI), all .wav sound files are being imported with the "resource\" suffix in their name.

For example, a file I want to import into:
"units\Human\HeroRanger\HeroRangerWhat5.wav"

Is instead imported into:
"resource\units\Human\HeroRanger\HeroRangerWhat5.wav"

This means I have to manually fix the files when releasing a new version of the map, so that the sounds play correctly inside of the game. Also it's pretty annoying when I have to build from github in a new PC :S
 
Level 4
Joined
May 31, 2018
Messages
92
Sorry for my late response, I have tried your slked map with WC3-1.24 and it worked fine. What is the version of your WC3?

I have manually modified some of the "Dark Portal" data. Please help me confirm if using this ability will cause WC3 to crash.
 

Attachments

  • crashoptimizer_slk_L350.w3x
    28.2 KB · Views: 177
Level 4
Joined
May 31, 2018
Messages
92
Will you guys be updating w3x2lni for 1.31? I think the folder format you offer is still better than the new one by blizzard :S
WC3 has a new data format since 1.30, I don't think I'll have time to try and support his new format.
 
Level 12
Joined
Jun 12, 2010
Messages
413
@_Guhun_ not sure what you mean by "updating w3x2lni for 1.31" but you can just use casc viewer to extract new patch data manually and keep working with w3x2lni

I haven't tested it yet, but I doubt w3x2lni would be able to work with new Lua maps and with the new trigger editor features (like variables inside of categories and categories inside of categories). I intend to convert my map to Lua as soon as I have a good VCS (looking at Ceres right now, but it still doesn't handle object data).
 
Level 12
Joined
Jun 12, 2010
Messages
413
@_Guhun_ w3x2lni is part of actboy168/YDWE which is what chinese devs use and it has handled lua for years, not sure how far is that from working for 1.31.

I have to admit my ignorance on how Lua functionality is implemented for YDWE, but I don't think it uses a war3map.lua file, does it? Since w3x2lni seems to require a war3map.j file to optimize maps. It probably requires some tweaking to work with 1.31, so I just wanted to know if the devs would have time for it :S
 
Hello,

I have the error "Function [BlzSetUnitBaseDamage] no exists".
If I'm not mistaken this is a function from patch 1.29. Do you have any idea of what files I should update to take it into account ?

Use the attached data files and update your config.ini.
 

Attachments

  • enUS-1.31.0.zip
    1.9 MB · Views: 127
  • Like
Reactions: pyf
Level 4
Joined
May 31, 2018
Messages
92
It seems that the version of 'war3map.w3i' has been updated to '28' in WC3-1.31.1 (it is '25' in WC3-1.24 and '18' in WC3-1.20), so 'W3x2lni' can not parse these maps.
Is anyone knows the new format of 'war3map.w3i' ?
 
Level 4
Joined
May 31, 2018
Messages
92
16 bytes are the game version, and the byte right before player count is a flag for JASS/Lua.
Thank you. Do you know what these values mean (see: sumneko/w3x2lni) ?
In one test map, they are `1` `31` `1` `0.0`.
However, it seems that the versions of other files also have changed, and I don't have time to study this at present, so it may be necessary to wait until someone summarizes the new file format parsing methods before `W3x2lni` supporting the new version of the map.
 
Thank you. Do you know what these values mean (see: sumneko/w3x2lni) ?
In one test map, they are `1` `31` `1` `0.0`.
However, it seems that the versions of other files also have changed, and I don't have time to study this at present, so it may be necessary to wait until someone summarizes the new file format parsing methods before `W3x2lni` supporting the new version of the map.

They are the build version of the game client. 1.31.0.
 
Sorry for my late response, I have tried your slked map with WC3-1.24 and it worked fine. What is the version of your WC3?

I have manually modified some of the "Dark Portal" data. Please help me confirm if using this ability will cause WC3 to crash.
Doesn't crash, what'd you change? Tried in 1.31 and 1.30.1.
 
Level 12
Joined
Feb 27, 2019
Messages
399
Use the attached data files and update your config.ini.

Amazing, with this data it works fine for map created with Warcraft III 1.30.4. Just by curiosity, how did you get or create this data package ? :)

However it doesn't work for maps created with 1.31.1 (latest), I got the rror below.
But I guess it is normal that the update is too recent and so W3x2Lni is not fit for it yet, no ?
upload_2019-6-29_12-9-34.png
 
Amazing, with this data it works fine for map created with Warcraft III 1.30.4. Just by curiosity, how did you get or create this data package ? :)

However it doesn't work for maps created with 1.31.1 (latest), I got the rror below.
But I guess it is normal that the update is too recent and so W3x2Lni is not fit for it yet, no ?

I extracted the files manually from the CASC. I think 1.31 maps might work if you build w3x2lni from the source, or wait for it to be updated here.
 
Level 1
Joined
Dec 17, 2012
Messages
2
Will the download be updated? I updated the data and config but still get error so i was wondering if the download could just be updated for use on current patch.
 
Level 4
Joined
May 14, 2007
Messages
35
Appreciate the update. The latest version 2.5.2 with 1.31.1 data files (or default ones) now doesn't give the error when processing the map but the game doesn't see the optimized map.

Edit: The problem is the corruption of w3i file after using the tool. Importing from the original map doesn't work.
 
Last edited:
Level 4
Joined
May 31, 2018
Messages
92
Appreciate the update. The latest version 2.5.2 with 1.31.1 data files (or default ones) now doesn't give the error when processing the map but the game doesn't see the optimized map.

Edit: The problem is the corruption of w3i file after using the tool. Importing from the original map doesn't work.

Dose not support 1.31 now.
 
Level 4
Joined
May 14, 2007
Messages
35
I was able to use this program with 1.31.1 patch, so I would like to share.

First, download the latest version and extract 1.31.1 Data File. (refer to a few posts back for a way to extract yours.) Then, export war3map.w3i and war3map.wts from your original, unprotected map using MPQMaster or any similar program. Use this program to optimize your map. Lastly, import back those two files you exported earlier. Voila!
 
Level 12
Joined
Feb 27, 2019
Messages
399
I was able to use this program with 1.31.1 patch, so I would like to share.

First, download the latest version and extract 1.31.1 Data File. (refer to a few posts back for a way to extract yours.) Then, export war3map.w3i and war3map.wts from your original, unprotected map using MPQMaster or any similar program. Use this program to optimize your map. Lastly, import back those two files you exported earlier. Voila!

Amazing ! Did you experience any issue with your protected map since then ? Or it seems to work without any countereffect ?
 
Level 4
Joined
May 14, 2007
Messages
35
Amazing ! Did you experience any issue with your protected map since then ? Or it seems to work without any countereffect ?
There is one minor downside with my map. I use custom gameplay constants and there are a lot of edited values. One of the values is Hide Enemy Inventory which is set to TRUE, meaning that players shouldn't be able to see other player's unit inventory. However, after using this method, unit inventory wasn't hidden as it was supposed to. All other edited constants so far worked fine though. Only this one didn't work but it was relatively minor so I let it pass. You might want to try importing war3mapMisc.txt back if you want to make sure everything works.
 
Last edited:
Level 4
Joined
May 31, 2018
Messages
92

W3x2lni will build the full data of objects before converting a map, .
This map has some objects with a level of 999999 (1M).
To build the full data of them (expand data at each level), it takes up a lot of time and memory.
At present, W3x2lni is compiled in arch x86, the upper limit of memory that can be used after testing is about 1.3G, so it crashed due to not enough memory.
We will compile it in arch x64 in the next version, then this problem will be resolved.
 
Level 5
Joined
Mar 6, 2017
Messages
190
W3x2lni will build the full data of objects before converting a map, .
This map has some objects with a level of 999999 (1M).
To build the full data of them (expand data at each level), it takes up a lot of time and memory.
At present, W3x2lni is compiled in arch x86, the upper limit of memory that can be used after testing is about 1.3G, so it crashed due to not enough memory.
We will compile it in arch x64 in the next version, then this problem will be resolved.
Thanks
 
Level 16
Joined
Apr 14, 2016
Messages
382
Reporting 2 bugs, one I found long time ago, but it was not so important, until I actually had to deal with maps that suffer from it.

1) Using W3X2LNI to slk completely kills any data of unit level, thus making ChooseRandomCreep/ChooseRandomCreepBJ ignore inputted value of level.
2) W3X2LNI fails to read GlobalExperience from war3mapMisc.txt, thus it does not put it back, thus breaking any map that you convert back from LNI to OBJ or SLK.

Thanks.
 
Last edited:
Level 4
Joined
May 31, 2018
Messages
92
1) Using W3X2LNI to slk completely kills any data of unit level, thus making ChooseRandomCreep/ChooseRandomCreepBJ ignore inputted value of level.
I did some tests, but I didn't find this problem. Could you please provide a demo map, maybe there is something changed in the latest version of WC3.
 
Top