• 🏆 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 5
Joined
Mar 6, 2017
Messages
190
I have problem with converting lini return back to object
I attached the lni folder
here the error
eorororororroroororor.PNG
 

Attachments

  • demo_prereforged.rar
    1.1 MB · Views: 49
Level 4
Joined
May 31, 2018
Messages
92
The person reported that no error message was generated when saving the same map as "Obj" and uploading. However this is not ideal for him since he wants to use the "Slk" for its protected properties.

Sorry I have no idea, I use Stormlib to create mpq. The only difference between "Obj" and "Slk" is that when "Remove WE-only files", we changed some flags to prevent generating "(listfile)",
"(attributes)" and "(signature)".

flags: sumneko/w3x2lni
Stormlib: ladislav-zezula/StormLib
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,190
Sorry I have no idea, I use Stormlib to create mpq. The only difference between "Obj" and "Slk" is that when "Remove WE-only files", we changed some flags to prevent generating "(listfile)",
"(attributes)" and "(signature)".
Ralle solved it. It was due to trigger string in-lining that confused the site parser. SLK form should now upload fine.
 
Level 6
Joined
May 1, 2012
Messages
95
w3x2lni.exe is being tagged as a trojan by Windows Defender.

I don't use any anti-virus software, I don't know what happened. But I think w3x2lni is safe, no matter how w3x2lni is completely open source, you can review what it did and even build it yourself. This is an online antivirus scan for reference.There are three antiviruses that think it's not safe, but I think they are wrong.

Antivirus scan for 2e650cb1d65fa62215f9c9f79d121c661bbec858298d6eb461434f57a0e34e06 at 2019-01-08 01:53:45 UTC - VirusTotal
 
Level 16
Joined
Apr 14, 2016
Messages
382
@actboy168 is it possible to make W3X2LNI use data from .wts to fill w3i? Aka, so I don't have to rename the map every time in table\w3i.ini I've tried sending over TRIGSTR, but it just pastes it as plain text.
@Kam older versions did not have that, I guess they forgot to use SSH or some kind of register. Also it is not flagged as Trojan, but as "unknown publisher", at least on Windows 10, possibly due to False Positives as mentioned by @pyf.
 
Level 4
Joined
May 31, 2018
Messages
92
@actboy168 is it possible to make W3X2LNI use data from .wts to fill w3i? Aka, so I don't have to rename the map every time in table\w3i.ini I've tried sending over TRIGSTR, but it just pastes it as plain text.
Do you mean you want to reserve TRIGSTR in war3map.w3i when converting Obj to Lni?
 
Level 16
Joined
Apr 14, 2016
Messages
382
Do you mean you want to reserve TRIGSTR in war3map.w3i when converting Obj to Lni?
Nope, when using LNI to OBJ or LNI to SLK, so I can pass to w3i.ini data from WTS or from some other file. I am most probably using the tool in very unusual way, as I use it to completely bypass using WE, as it is buggy, unstable and slow. So I edit everything with Notepad++, and the only drawback is, that I need to edit w3i.ini separately when assembling the map.

Currently, it just uses text, thus when WTS gets inlined, it is plain text. Technically if you could add an option to Inline or not to Inline strings - that would be helpful as well. But it is better if it gets inlined in w3i as well.

vpZOMQG9.png

iXi34UU2O4.png
 
Level 4
Joined
May 31, 2018
Messages
92
Nope, when using LNI to OBJ or LNI to SLK, so I can pass to w3i.ini data from WTS or from some other file. I am most probably using the tool in very unusual way, as I use it to completely bypass using WE, as it is buggy, unstable and slow. So I edit everything with Notepad++, and the only drawback is, that I need to edit w3i.ini separately when assembling the map.

Currently, it just uses text, thus when WTS gets inlined, it is plain text. Technically if you could add an option to Inline or not to Inline strings - that would be helpful as well. But it is better if it gets inlined in w3i as well.

vpZOMQG9.png

iXi34UU2O4.png

LNI is designed as a human-readable file format, and I don't want content to be escaped.
On the other hand, modifying a map name requires at most two modifications: w3i and a global variable in the script.
Compared with it, checking WTS while reading LNI wastes performance and is not universal.

By the way, the original intention of LNI is to break away from WE as much as possible. You can find many such projects on GitHub.
 
Level 16
Joined
Apr 14, 2016
Messages
382
LNI is designed as a human-readable file format, and I don't want content to be escaped.
On the other hand, modifying a map name requires at most two modifications: w3i and a global variable in the script.
Compared with it, checking WTS while reading LNI wastes performance and is not universal.

By the way, the original intention of LNI is to break away from WE as much as possible. You can find many such projects on GitHub.
Yeah I understand that much, still can you at least add “do not inline WTS” then? That would work out just as good.
 
Level 1
Joined
Dec 27, 2018
Messages
6
Hi! Thank you for working on this great tool. Wanted to report a small bug: After SLK convertion the map works but I am missing a tooltip description for 2 abilities based on the "Frenzy" ability. I will update this if I find the issue with other abilities.

Edit: Got a weird tooltip for an ability based off of Faerie Fire (Neutral Hostile) and Bloodlust (Neutral Hostile 1). Maybe its an issue with auto-castable abilities?
 
Last edited:
Level 4
Joined
May 31, 2018
Messages
92
Error:

JASS syntax error -
Variable [PLAYER_COLOR_MAROON] doesn't exists.



any idea how to fix that?

See the instructions "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."
Now you can drag WC3 folder in to extract data files.
 
Level 4
Joined
May 31, 2018
Messages
92
Yeah I understand that much, still can you at least add “do not inline WTS” then? That would work out just as good.

Unzip this plugin in the root directory(The correct path is `w3x2lni/plugin/.config`), then you could read slk in Jass like this:
Code:
string MAP_NAME = "<?=slk.w3i.map.map_name?>"
real DAMAGE = <?=slk.ability.AHtb.herodur[1]?>
integer BUTTON_Y = <?=slk.ability.AHtb.buttonpos_2?>
integer MAX_LEVEL = <?=slk.misc.Misc.maxherolevel?>

I think this may meet your needs.
 

Attachments

  • plugin.zip
    733 bytes · Views: 45
Level 4
Joined
May 31, 2018
Messages
92
Hi! Thank you for working on this great tool. Wanted to report a small bug: After SLK convertion the map works but I am missing a tooltip description for 2 abilities based on the "Frenzy" ability. I will update this if I find the issue with other abilities.

Edit: Got a weird tooltip for an ability based off of Faerie Fire (Neutral Hostile) and Bloodlust (Neutral Hostile 1). Maybe its an issue with auto-castable abilities?

Sorry, I can't reproduce what you said. Can you provide a demo?
 
Level 1
Joined
Dec 27, 2018
Messages
6
Sorry, I can't reproduce what you said. Can you provide a demo?

Demo before and after optimization attached. In this case, a custom Frenzy based ability loses its tooltip after optimization.

Used the following options:
To SLK
Optimize JASS
Remove WE-only files
Confuse scripts


Thanks for looking into the issue!
 

Attachments

  • OptOptions.png
    OptOptions.png
    18.9 KB · Views: 51
  • frenzytest.w3x
    16.7 KB · Views: 39
  • frenzytest_slk.w3x
    281.5 KB · Views: 37
Level 4
Joined
May 31, 2018
Messages
92
Demo before and after optimization attached. In this case, a custom Frenzy based ability loses its tooltip after optimization.

Used the following options:
To SLK
Optimize JASS
Remove WE-only files
Confuse scripts


Thanks for looking into the issue!

I don't think this problem has anything to do with optimization. In the unoptimized map, tooltip has been lost.
 
Level 1
Joined
Dec 27, 2018
Messages
6
I don't think this problem has anything to do with optimization. In the unoptimized map, tooltip has been lost.

Interesting, from here the regular version still has the tooltip. See the screenshot.


frenzytest_slk.w3x is the optimized version (despite the larger size).

frenzytest.w3x is the regular version.

Did you try comparing both maps? maybe its a language related issue? Also, as I mentioned, it appears to happen only with auto-cast based abilities.
 

Attachments

  • WC3ScrnShot_Unoptimized.png
    WC3ScrnShot_Unoptimized.png
    3 MB · Views: 50
  • WC3ScrnShot_Optimized.png
    WC3ScrnShot_Optimized.png
    2.9 MB · Views: 50
Level 4
Joined
May 31, 2018
Messages
92
Interesting, from here the regular version still has the tooltip. See the screenshot.


frenzytest_slk.w3x is the optimized version (despite the larger size).

frenzytest.w3x is the regular version.

Did you try comparing both maps? maybe its a language related issue? Also, as I mentioned, it appears to happen only with auto-cast based abilities.

I have tried the unoptimized map in 1.24.4-zhcn, 1.27.1-enus and 1.28.0-enus. All of them showed the lost tooltip.
From your screenshot, your WC3 is a higher version, so I think this is a bug of WC3 in lower version, and it has fixed in heiger version, but the fix weren't thorough enough.
 
Level 4
Joined
Jun 19, 2018
Messages
31
See the instructions "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."
Now you can drag WC3 folder in to extract data files.
Thanks, that helped with my localization problem. The description above should be updated with this drag'n'drop method.
 
Level 4
Joined
Jun 19, 2018
Messages
31
Although I do have a problem with my map. Some players instead of trees get pink boxes (warcraft 3 placeholder model) with no collision. Therefore get desynced. It's hard to experiment with settings to find a workaround since the bug is inconsistent.

Edit: It was a weird bug that only happens sometime if you combine this with Vexorian optimizer and play on a hostbot. So it is not really relevant.
 
Last edited:
Level 16
Joined
Apr 14, 2016
Messages
382
Unzip this plugin in the root directory(The correct path is `w3x2lni/plugin/.config`), then you could read slk in Jass like this:
Code:
string MAP_NAME = "<?=slk.w3i.map.map_name?>"
real DAMAGE = <?=slk.ability.AHtb.herodur[1]?>
integer BUTTON_Y = <?=slk.ability.AHtb.buttonpos_2?>
integer MAX_LEVEL = <?=slk.misc.Misc.maxherolevel?>

I think this may meet your needs.
will test it, thank you very much :)

EDIT: not the thing I was talking about, I guess I explained it poorly. Still it is neat.

In the W3i the mapname is the one used in lobby, so I wanted a way for the tool to grab the name from somewhere. Anyways, forget about it, it's fine as it is.

Is there a way to disable WTS inline? I will just use that :p
Although I do have a problem with my map. Some players instead of trees get pink boxes (warcraft 3 placeholder model) with no collision. Therefore get desynced. It's hard to experiment with settings to find a workaround since the bug is inconsistent.
Untick doodad optimization, if you have it ticked.
 
Last edited:
Level 4
Joined
Sep 25, 2017
Messages
56
It barely affects speed at all, can you just please add this option?

If you want proof I can make a side by side map loading and spell test comparison and there will be 0 difference...

1 map wouldn´t really be proof, and wts inline optimization can chunk off 30s+ of load time on maps with several mbs of strings file. If you just have a few hundreds, its possible you don´t notice the difference. As for what you want to do, you can learn a bit of lua, use the libraries W3x2lni provides like stormlib and edit the w3i file as you wish. It might also be possible to do as a plugin.
 
Level 16
Joined
Apr 14, 2016
Messages
382
1 map wouldn´t really be proof, and wts inline optimization can chunk off 30s+ of load time on maps with several mbs of strings file. If you just have a few hundreds, its possible you don´t notice the difference. As for what you want to do, you can learn a bit of lua, use the libraries W3x2lni provides like stormlib and edit the w3i file as you wish. It might also be possible to do as a plugin.
You do realize, I did not mean just one map, right? And I already use this tool to edit different maps, aka commercially.

And giving a choice to the user to inline or not to inline is never a bad choice.

Also again, WTS reading is never and I repeat NEVER THAT SLOW that you will ever notice a difference, heck look at ORPG maps or RPG maps, the reason they lag is never Lack of WTS inline, is simply poor code and effect spam.

And load time is chunked off by slk, where did you even take that 30+sec load time by WTS inline...?

Also I do know lua, but I am more fluent in C++, but should I be the one to “force” the addition of things that are kind of expected to exist? Not really. That is why I simply ask to add the option to enable/disable it, that’s it.
 
Level 4
Joined
Sep 25, 2017
Messages
56
@Unryze Will post map when I have time. This is an optimizer, there is no reason to not optimize string inlining. Your use seems to me too specific, and this tool is quite customizable if you want to edit it, I have edited it to allow external listfile for example. Anyway the decision lies on sumneko, just wanted to point out that if they won´t do it, you could do it yourself and that wts inline is very important.
 
Level 16
Joined
Apr 14, 2016
Messages
382
@Unryze Will post map when I have time. This is an optimizer, there is no reason to not optimize string inlining. Your use seems to me too specific, and this tool is quite customizable if you want to edit it, I have edited it to allow external listfile for example. Anyway the decision lies on sumneko, just wanted to point out that if they won´t do it, you could do it yourself and that wts inline is very important.
I guess it takes experience to notice things, for test purpose make a map with SLK optimization, then just move everything back that utilizes WTS, and you will see 0 difference in load time... anyways, up to you to notice it.

Again, giving more flexibility is never a bad thing, especially when the gains are minimal, again you will notice the non-existent gains yourself soon enough.

I doubt having the "untick inline" which existed even on Verxorian tool be a bad thing, same goes to Wc3SLKOpt, again it also has that. And if I reckon tool that Frotty is making also has this option as well... anyways, as you said it is up to the tool maker to decide.
 
Level 4
Joined
May 31, 2018
Messages
92
I guess it takes experience to notice things, for test purpose make a map with SLK optimization, then just move everything back that utilizes WTS, and you will see 0 difference in load time... anyways, up to you to notice it.

Again, giving more flexibility is never a bad thing, especially when the gains are minimal, again you will notice the non-existent gains yourself soon enough.

I doubt having the "untick inline" which existed even on Verxorian tool be a bad thing, same goes to Wc3SLKOpt, again it also has that. And if I reckon tool that Frotty is making also has this option as well... anyways, as you said it is up to the tool maker to decide.

I need to keep options streamlined, and `Disabling wts-inline'is a meaningless function, so I won't add it to the list of options.

This plugin allows you to disable wts-inline when converting maps, although I don't recommend it.
 

Attachments

  • plugin.zip
    537 bytes · Views: 45
Can we get an update that supports the latest patch?
It's critical for my map to be supported by the latest version, but at the same time i don't want to leave unprotected versions out there for the sake of it.

I think the 1.29.2 dataset should work fine on 1.30.

Also Vexorian's map optimizer still works despite popular belief.
 
Level 24
Joined
Nov 9, 2006
Messages
2,558
It doesn't.
I always wondered why my map had old data sets after protecting and having played it.
I managed to track the cause of the problem down to the optimizer and after that i tried every single option through a process of elimination.
It causes me major problems because i can't edit data fields in the object editor without having it reset to old values.
If i try to set KOTG's Force of Nature to cost 100 mana, the data field doesn't register that as a "changed value" (becoming purple) because 100 mana cost is default value in 1.30.
So after i use the optimizer it reads as if that value was never changed and resets it to 125 mana cost because it uses patch 1.29 for game data.

And i can't use Vexorian's map optimizer because there is no MPQ to be found.
If you know a workaround that doesn't completely fuck up for the most recent patch please do help.
 
Level 2
Joined
Feb 12, 2019
Messages
10
And i can't use Vexorian's map optimizer because there is no MPQ to be found.
If you know a workaround that doesn't completely fuck up for the most recent patch please do help.

I had the same issue. I wanted to use the current war3patch.mpq for Vexorian... unfortunately, new warcraft 3's file formatting is all different.. the old mpq's dont exist.

So i opened an old war3patch.mpq and compiled a list of everything it needed. I then manually extracted everything from current version to replicate a war3patch.mpq to use with Vexorians Optimizer. I might be missing a few things because it started getting late for me and it was taking a long time as you can imagine.. but when i tested it, i didnt seem to have any issues. You can give it a shot.

Its 1.2GB, im uploading it atm. I'll edit this once its done.

Edit:
War3Patch.mpq

Let me know if this works. I feel like it should, at most.. it may have some missing data bits here and there.. If thats the case i can send you the folder of all the files, and you can update it yourself with whatever else it needs then just put it all into an mpq. Attached is a photo of the folders/files inside the war3patch.mpq pulled from latest warcraft files using casc viewer.
 

Attachments

  • Folder.png
    Folder.png
    216.5 KB · Views: 72
Last edited:
Level 2
Joined
Feb 12, 2019
Messages
10
It's a bit too early to tell how many things are affected, but as you can see the shops become purple squares.

Did it fix the other issue at least? lol and that im not sure... that shouldn't be happening from the mpq itself i dont think, maybe a certain setting on the optimizer paired with the mpq is causing that. try playing around with the settings & tweaks.


On another note.. I'm also having issues with this tool sadly, for one it doesn't obfuscate the code at all.. so for now im using vexorians for the code portion then this tool to protect the map.. also other issues are its having weird effects in my map for example.. towers aren't doing any damage, triggers that cause enemy team to give vision, works but then stops working randomly.
 
Last edited:
Level 3
Joined
Dec 30, 2010
Messages
53
You don't need the .mpq, just common.j/blizzard.j
About the purple issue, are the shops changing owner? If so tick "AntiBj" in "Tweaks" -> "Avoid"
 
Level 4
Joined
May 31, 2018
Messages
92
It doesn't.
I always wondered why my map had old data sets after protecting and having played it.
I managed to track the cause of the problem down to the optimizer and after that i tried every single option through a process of elimination.
It causes me major problems because i can't edit data fields in the object editor without having it reset to old values.
If i try to set KOTG's Force of Nature to cost 100 mana, the data field doesn't register that as a "changed value" (becoming purple) because 100 mana cost is default value in 1.30.
So after i use the optimizer it reads as if that value was never changed and resets it to 125 mana cost because it uses patch 1.29 for game data.

And i can't use Vexorian's map optimizer because there is no MPQ to be found.
If you know a workaround that doesn't completely fuck up for the most recent patch please do help.

If you don't have any special needs, you can use version 1.29 to make maps. After SLK, the data is determined and no longer changes with the runtime version.
 
Top