[GUIDE] Advanced Map Editing

Cheatpacks and learning how to use them, as well as other guides for manipulating maps.

Moderator: Cheaters

User avatar
Nuuby
Forum Staff
Posts: 519
Joined: October 18th, 2010, 8:43 am

[GUIDE] Advanced Map Editing

Post by Nuuby »

Note: If there are any questions, please do ask. I can't do a FAQ otherwise!

Stuff Covered:
  1. Cheat Detection
  2. Tools
  3. Fake Version
  4. Loading Screen / Map Preview
  5. Custom Commands
  6. Singleplayer
*Note: still a work in progress. This is also meant for people who have grasp the basics, but do not yet still need help for the above mentioned topics.

Cheat detection
  • All you need to have is a MPQ extractor, a text editor [Jasscraft or Notepad++] and some knowledge about how cheatpacks are generally made. First thing first, scroll quickly through the globals and look for the tell-tale sign of cheats. Basically it's pretty obvious if you can see it at the start globals or at the end. The easiest way to find a hidden cheatpack would be to use the search function and look for known commands, these generally don't change and are not obfuscated by vexorians'. So you should start your search off with stuff like "-gold","-fast","-destroy" and "go.","fe.","us."

    Usually you would have found the cheats by now. IF NOT. There is one more chance to find it, search for "TriggerRegisterPlayerChatEvent" and follow what function it executes from the "TriggerAddAction" line. You should investigate only the ones that sound weird so as to save time.

    Still can't find it? There's a possibility that you've been looking at the war3map.j in the "scripts" folder. If there's a war3map.j in the root folder of the map, Warcraft would load that instead of the one in /scripts. So check the root folder. Ultimately, if you know the types of cheatpacks being used you can find them easily, usually JJ/Fai anyway. If you can't. Post about the problem on this thread, find us on chat or make a PROPER request.

Tools
A list of tools and some notes on them that are relevant to map editing. You should already have Jasscraft or Notepad++ if you're reading this guide. Click them if you don't have it.

  1. MPQ Editor
  2. MPQ Master
  3. MPQ View
  4. W3M Master
  5. RMPQEx
  6. W3MPQFNs - Warcraft 3 MPQ filename detector
  7. Vexorians' Optimizer
  8. Jass NewGen Pack (World Editor)



MPQ Editor
  • There's nothing much to say about this tool, it a general MPQ tool. But when you open a archive in MPQ Editor, Warcraft will be unable to load the map that is currently open in MPQ Editor. Also, MPQ Editor's force open MPQ in v1.0 function is the second best thing you can possibly have, opens spazzled maps and basically anything under the average user sun. A few things to note.
    1. Compact archive requires a full listfile to work. It won't work otherwise, and like MPQ Master. It just doesn't seem to want to work sometimes even then. Restarting MPQ Editor solves this problem.
    2. If there is a (attributes) file inside the MPQ already, you do not need to delete the (attributes) file. MPQ Editor will automatically update it whenever you change/add new files into it.
    3. You can create new MPQ archives with this and copy over the 'user data' AKA map name when you choose the map. Also helps alot in rebuilding
    4. Search function is extremely useful for fake versions
    5. Name breaker is retarded

MPQ Master
  • MPQ Master may be a really old tool, but its compact function and speed are unmatched by other MPQ tools out there. Things to note:
    1. You have to place your listfiles inside the listfiles folder
    2. Really useful if the map isn't protected against MPQ Master. It works fast and you can open the map in Warcraft while the map is loaded in MPQ Master.
    3. The compact function is kickass Image

MPQ View
  • Under MPQ Editor I mentioned that it was the second best at opening 'protected' maps. Guess what, this is the best, nothing can beat this invalid of a MPQ tool. Even though it's ages and ages and... Well really old.
    1. If Warcraft can play the map. MPQ View can open it.
    2. It's really, really slow compared to other MPQ tools
    3. You need to open a 'data file' first aka listfile. Go under the File tab and select open listfile. If you're only taking a peep into the map script I suggest you have a listfile that only includes war3map.j and scripts/war3map.j
    4. When opening archive, you have to put the "Files of type" option to all files.

W3M Master
  • From the same guys that brought you MPQ Master, Quixotic Yawl Studio, presents to you W3M Master! Ok, so it's beaten in speed of opening maps, opening protected maps and day-to-day usage overall. But it has one key point that no other tool I've seen have:
    1. It can edit the units,items,abilities and map information *Map name etc* without even touching the world editor. And without the lag WE brings when dealing with alot of unit info.
    2. The downside is that the plugins for that crash occasionally, but they are still really useful.
    3. Protect map function is useless, don't bother

RMPQEx
  • You absolutely need RMPQEx in your tool folder even if you don't do deprotections. The less unknown files you have, the better MPQ Master will compact the map. Notes:
    1. Select a map using the browse button, then press open. Press autosearch and let it run, once it's done press extract listfile and select your listfile. This will add in paths that it found into your listfile, and it won't leave duplicates while doing that too.
    2. The second most commonly used function is the Dump Object Data function. Select your Warcraft path and you can find out the item/unit/ability codes in any map.
    3. A reliable MPQ tool as well, alot of protections don't work on it.

W3MPQFNs - Warcraft 3 MPQ filename detector
  • W3MpqFNS is an important tool in any deprotection tool folder as well, it's invaluable for finding files that RMPQEx cannot find. Start Warcraft then press the start button in W3MpqFNS play your map and once you're done press the All button underneath the Save filenames to listfile and save it as anything. Notes:
    1. Use MPQ Editor in combination with this so you can see the models with MPQ Editor and if you've played the map for sometime, be able to know where it's used.
    2. Use a map hack in conjunction with this for maximum efficiency.
    3. Do not overwrite your listfile with the saved listfile from this. Use MPQ Editors' listfile merger to join the 2 together

Vexorians' Optimizer
  • A useful tool to not only optimize maps but to shrink the size of your script after you have edited it. Just select your script and uncheck all the boxes except compress names. And press the saved optimized as to start the optimization. Notes:
    1. OPTIMIZING OPTIMIZED MAPS IS NOT A GOOD IDEA! But if you really must, get a full listfile and select it as the auxiliary listfile.
    2. On certain occasions when you're dealing with unoptimized map script, it may actually be a good idea to go ahead and tick the optimize script box. But more then often it breaks the map.
    3. If the map is broken try replacing the script from the original map back into it.
    4. Makes cheatpacks harder to find for n00bs.

Fake version
  • Fake version is basically faking the maps name into another version to disguise the fact that it has been unofficially edited. One of the easiest ways to do this is to use MPQ Editors' search function, alt+f7 or can be found under the Tools tab. Here's an example with DotA.
    Spoiler:
    Image
    The highlighted text is the places where you would want to change the name. So after you've finished changing the names with your text editor in all those places There usually isn't anywhere else the name is stored other than before the header of the MPQ archive. Which is the name that appears here.
    Spoiler:
    Image
    To change this you need to use a hex editor and change the name there, also do note that the name changes do not get reflected until you restart your Warcraft. To do this I'll be using HxD as my hex editor. Open up the map with your hex editor and you will notice 2 things
    Spoiler:
    Image
    The top circle is the maps' name with something else behind it, ignore that extra bit. And on the bottom you can see the start of the MPQ header. Bear in mind the location of it as well, because that has to remain constant throughout the editing or the map won't work. So edit the name to whatever you want and don't touch that little extra bit behind. Also make sure you delete the same amount of blank space. those 0 0s. So that the MPQ Header is still in the same location. Like this:
    Spoiler:
    Image
    With that done all that's left is the Map preview and loading screen. See the sub-guide below.

Loading screen/Map preview
Generally in maps, there are 2 types of loadingscreens. Ones that use 4 .tga files [Top-left/right, Bottom-left/right] and those that use 1 big .blp [Usually named as FullScreen.blp]. Usually when you fake version a map, you only need to edit one of the 4 .tga files or the .blp. This guide will cover both types.

Firstly, the tools of the trade:
  • -An image viewer, use XnView or IrfanView. I'll be using XnView for this guide
    -An image editor. People generally use GIMP or Photoshop. I'll be using GIMP as Photoshop is a pay to use program.
    -Warcraft 3 Viewer

.blp-Type maps
  • I'll be using TKoK 3.0.4 as an example.
    Extract the .blp file anywhere. Then use your XnView to open up the .blp file. Press Ctrl+Shift+S to open up the save as window, and save it as a .png file.
    Spoiler:
    Image
    Then use GIMP to open it. Well... The following part gets rather hands-on and if you don't have experience with this its rather hard, so here's alot of pictures to help. Duplicated the background by right clicking on it's layer and select duplicate, now select this new layer. Zoom in[ctrl+mouse scroll] to the spot where you want to edit~
    Now you have to use a combination of the eyedropper to pick colors from the background then brush/clone tool over the letters you want to replace, then use blur/smudge to make it more 'real'
    Spoiler:
    Image
    ^Eye dropper
    Image
    ^brush
    Result~
    Spoiler:
    Image
    Using the text tool type in a suitable font with around the same size as the other fonts.
    Spoiler:
    Image
    Adding in some more brush/text outline and stuff... And finished in around 3 minutes :p
    Spoiler:
    Image
    Not the best,*The text needs bevel and emboss with a red stroke* but I'm more used to Photoshop so I've got no idea where most stuff in GIMP are so it's not as nice as I would have expected it to be.

    Once all the editing is done, save your work as a .tga file. Open up Warcraft 3 Viewer. Under the Convert Files tab at the top, select BMP,TGA or JPG -> BLP. Select your .tga file and your output file, select compression level *default is fine* and hit OK. Reinsert the outputted .blp file back into your map and you're done.

.tga-Type maps and Map Preview
  • The editing part of .tga type maps is basically the same as .blp-type maps. The main differences are that you can open the .tga files directly with either GIMP or Photoshop and that you can just leave your output from GIMP/Photoshop as .tga and just reinsert back.

    For the map preview, find the war3mapPreview.tga in the root of the MPQ and simply edit > reinsert it back. If it's not there it would mean that the map doesn't have a map preview picture.
Custom Commands
Keep in mind, that custom commands being unique in their nature, this guide cannot cover EVERY aspect of it. Caution, this section may confuse.

You should at least understand what TriggerPlayerChatEvent and integers(If you don't know, you obvious had no form of education before) do. What it does is if a message you type contains a certain string, either exactly the string or a part of the text you typed, it will do something. That something that it does can be found by looking for the TriggerAddAction or TriggerAddCondition of the trigger. And also DisplayTimedTextToPlayer or any other TextTo variant, no explanation needed here. It also helps that you have some knowledge over the game, which is why we're so picky over details on the Custom Command or Single Player requests.
  • The easiest way to create a custom command would be to look for an existing command that displays the value that you want to change, ie. game exp which you can save. Sounds complicated? Here's an example with the map JurassicParkEEv6.3BETA with a command to change your Jurassic Score.

    If you've played JP before, you would know that the command "-show" will display all the players' Jurassic Score. With this in mind, look for the text "-show" in the script. You would arrive to something like this...
    Spoiler:

    Code: Select all

    set dO=CreateTrigger()
    call TriggerRegisterPlayerChatEvent(dO,Player(0),"-show",true)
    call TriggerRegisterPlayerChatEvent(dO,Player(1),"-show",true)
    call TriggerRegisterPlayerChatEvent(dO,Player(2),"-show",true)
    call TriggerRegisterPlayerChatEvent(dO,Player(3),"-show",true)
    call TriggerRegisterPlayerChatEvent(dO,Player(4),"-show",true)
    call TriggerRegisterPlayerChatEvent(dO,Player(5),"-show",true)
    call TriggerRegisterPlayerChatEvent(dO,Player(6),"-show",true)
    call TriggerAddAction(dO,function IT)
    From this, you can see that dO is the trigger and it will register chat messages from player 0~6 when they type the phrase "-show" exactly. The true at the end dictates if or if not the trigger should register messages exactly as the string "-show". And also the TriggerAddAction calls the function IT when the player types "-show". Find the function IT. It should show this function...
    Spoiler:

    Code: Select all

    function IT takes nothing returns nothing
    call ClearTextMessagesBJ(fb(GetTriggerPlayer()))
    set bj_forLoopAIndex=1
    set bj_forLoopAIndexEnd=7
    loop
    exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
    call DisplayTimedTextToForce(fb(GetTriggerPlayer()),10.,((x[bj_forLoopAIndex]+GetPlayerName(Player(-1+(bj_forLoopAIndex))))+((" Jurassic Score is "+I2S(Vx[bj_forLoopAIndex]))+(" , number of dinosaur kills is "+I2S(re[bj_forLoopAIndex])))))
    call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"-----------------------------------------------------")
    set bj_forLoopAIndex=bj_forLoopAIndex+1
    endloop
    endfunction
    If you had remembered, we are looking for the display text to function which in this case would be this line that we're interested in.

    Code: Select all

    call DisplayTimedTextToForce(fb(GetTriggerPlayer()),10.,((x[bj_forLoopAIndex]+GetPlayerName(Player(-1+(bj_forLoopAIndex))))+((" Jurassic Score is "+I2S(Vx[bj_forLoopAIndex]))+(" , number of dinosaur kills is "+I2S(re[bj_forLoopAIndex])))))
    Now we have to look at the string. If you can't see it it's " Jurassic Score is "+I2S(Vx[bj_forLoopAIndex]))+(" , number of dinosaur kills is "+I2S(re[bj_forLoopAIndex])

    As you might be able to guess, I2S(Vx[bj_forLoopAIndex])) , is what shows the score. Here's an explanation of the stuff in this. I2S converts an integer into a string. Naturally Vx[bj_forLoopAIndex] is a integer. Whenever you see those [ ] it would mean that it's an array, in this case an integer array. An integer goes into that [ ]. Which in this case would be 1 = Red 2 = blue so on... How would you know this? When the bj_forLoopAIndex is 1, the player is that minus 1, in other words player 0 aka Red.

    So from this we know that Vx[1] is the Jurassic score for Red. So now we make the command~ The easiest way is to insert this line of code into JJ's cheatpack.

    Code: Select all

    elseif SubString(s2s,0,3)=="-cc"then
    set Vx[Player(GetPlayerId(p2p)+1)]=S2I(SubString(s2s,4,15))
    Below the line

    Code: Select all

    if SubString(s2s,0,6)=="-gold "then
    call SetPlayerState(p2p,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(p2p,PLAYER_STATE_RESOURCE_GOLD)+S2I(SubString(s2s,6,13)))
    What this does is that once you have activated JJ's CP. When you type "-cc 9999" it will set your Jurassic Score to 9999. What the individual stuff do:
    • -Player(GetPlayerId(p2p)+1) what this does is that it gets your player ID, ie if you're red it gives you a number of 0. Then adds 1 to it. So if you're red it gives you a number of 1. Which is what we need
      -S2I(SubString(s2s,4,15)) S2I is the opposite of I2S. The 4,15 is the location in your string that it will check for the integer. In this case it checks from the range more then 4 less then 15.
User avatar
UndeadxAssassin
Grammar King
Posts: 2116
Joined: June 22nd, 2008, 10:11 pm
Title: Worst human for 4eva
Location: Mostly USEast

Re: [Guide] Map Editing

Post by UndeadxAssassin »

Ooh, nice WIP guide. You should consider adding a table of contents or put it in the order that you named it in the beginning. I'mma sticky this.
(20:53:52) Bartimaeus: Thank you, Jen.
(20:53:56) Bartimaeus: Truly, you are wise.
(23:44:12) Bartimaeus: I was in pubic school until middle school...
Learn how to extract and read RAW Codes here!

Need help? Click here and ask your question!
AppleIcon
Newcomer
Posts: 16
Joined: May 3rd, 2011, 2:35 pm

Re: [Guide] Map Editing

Post by AppleIcon »

Wow, nice guide. I am waiting for the custom commands, hoping you can release it asap. Keep up the good work :D
wanit000
Junior Member
Posts: 46
Joined: January 4th, 2011, 5:14 am

Re: [Guide] Map Editing

Post by wanit000 »

:D Nice that is what i wait for longtime

hoping for next step
shamanking80
Newcomer
Posts: 18
Joined: November 7th, 2010, 7:30 am

Re: [Guide] Map Editing

Post by shamanking80 »

I had wondered the Godly Nuuby shared his tool to the public .. It's so amazing xD
Had get it all except W3MPQFNs and JassNewGen because it's seem useless..
haha~.~
Anyway Nubby you did a good job for opened this thread!

Respect to Mr.Nuu @@
Regards,
Thanks ! :lol: :lol: :lol:
User avatar
Nuuby
Forum Staff
Posts: 519
Joined: October 18th, 2010, 8:43 am

Re: [Guide] Map Editing

Post by Nuuby »

^Thanks =p

Update:
-Added CCs
-Some cosmetic changes
sibagariang
Newcomer
Posts: 23
Joined: June 4th, 2011, 8:21 pm

Re: [Guide] Map Editing

Post by sibagariang »

can u please help me, every time i try to open NewGen Warcraft.exe i always get eror ( ongame.dll eror, could not hack game.dll Please post logs/ongame.txt )
User avatar
Nuuby
Forum Staff
Posts: 519
Joined: October 18th, 2010, 8:43 am

Re: [Guide] Map Editing

Post by Nuuby »

Erm why would you need NewGen w3? People normally just use it for the world editor.
sibagariang
Newcomer
Posts: 23
Joined: June 4th, 2011, 8:21 pm

Re: [Guide] Map Editing

Post by sibagariang »

Very-very Nice Guide, help noobs like me, but i have a problem when i replace war3mapPreview.tga and loadingscreentr.tga using mpq master, map grow bigger and i can't play the map. any solution for this bos ?
darkfuryex
Newcomer
Posts: 11
Joined: July 30th, 2007, 6:06 pm

Re: [Guide] Map Editing

Post by darkfuryex »

Hey there i got a few questions...
Nuuby wrote:
As you might be able to guess, I2S(Vx[bj_forLoopAIndex])) , is what shows the score. Here's an explanation of the stuff in this. I2S converts an integer into a string. Naturally Vx[bj_forLoopAIndex] is a integer. Whenever you see those [ ] it would mean that it's an array, in this case an integer array. An integer goes into that [ ]. Which in this case would be 1 = Red 2 = blue so on... How would you know this? When the bj_forLoopAIndex is 1, the player is that minus 1, in other words player 0 aka Red.
about this, if the ID of player red is 1...why did it bother to minus 1 from that to make it 0 again? i know that the default color of red is 0..and blue is 1 etc etc but why did it minus 1?


Nuuby wrote: So from this we know that Vx[1] is the Jurassic score for Red. So now we make the command~ The easiest way is to insert this line of code into JJ's cheatpack.

elseif SubString(s2s,0,3)=="-cc"then
set Vx[Player(GetPlayerId(p2p)+1)]=S2I(SubString(s2s,4,15))
may i ask is "s2s" just the "name" for this trigger? sorry i dont have any basic knowledge of jass x(, and "4,15" just means that it will only take whatever value that appears right after 4 letters which is after "-cc " and the max score we can set to is 11 digits eg "-cc 12312312312"..right?

then how about the "0,3" what is that for?


Nuuby wrote: What this does is that once you have activated JJ's CP. When you type "-cc 9999" it will set your Jurassic Score to 9999. What the individual stuff do:
-Player(GetPlayerId(p2p)+1) what this does is that it gets your player ID, ie if you're red it gives you a number of 0. Then adds 1 to it. So if you're red it gives you a number of 1. Which is what we need
-S2I(SubString(s2s,4,15)) S2I is the opposite of I2S. The 4,15 is the location in your string that it will check for the integer. In this case it checks from the range more then 4 less then 15.
last question, in the 1st question i asked why did the system minus 1 from the ID...why does the system adds 1 value to our ID again after giving you the final code? is it due to some security stuff? i seriously dont understand this minus 1 and plus 1 thingy..can you explain further pls? why is having the value of 1 for generating the final score code important and is what we need as mentioned by you?

sorry im a noob but im willing to learn x( pls help..

anyway u got a very nice guide here...u went in depth with some stuff which is what noobs like me needs :D

P.S i hope you can see the words i specially bolded out..