[GUIDE] Modifying TWRPG Maps

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

Moderator: Cheaters

ParametersOfAName
Newcomer
Posts: 17
Joined: October 30th, 2018, 5:06 am

[GUIDE] Modifying TWRPG Maps

Post by ParametersOfAName »

Is easy. I figured it out by comparing map scripts from base to that old SHDR map a friend shared on Discord.

Requirements:
~MPQ Editor (the old one, has the zezula prefix, is somewhere in these forums, can't remember exactly).
~~Listfile.txt, is somewhere in these forums.
~WinMerge (to compare old files).
~A text editor, preferably something like Code or if you don't have it, Notepad++ will do.
~An unmodded copy of the TWRPG map version you wish to modify. (I'll refer to this as ^1).
~An unmodded copy of a previous TWRPG map. (^2)
~An SHDR copy of the same version as the above TWRPG map (preferably made by me, is somewhere on Fulfilled Maps). (^3)
~15-45 mins. of spare time.
~A single functional brain cell.

STEPS:
0.) Make sure to backup your copy of the map.

1.) Open the TWRPG map you wish to edit on your MPQ Editor. (Done by running the MPQ Editor, pressing Open MPQ, and selecting the map's file, make sure to import the listfile).

2.) Extract the script by going to the Scripts folder and dragging the war3map.j file to an empty folder outside the MPQ editor.

3.) Do steps 1 and 2 for both the unmodded and SHDR maps of a previous version (make sure to rename these 2 files to something else, like war3map-previousversion-orig.j and war3map-previousversion-SHDR.j)

4.) Open WinMerge and open both the war3map.j (^2 and ^3) files of a previous version to compare them side-by-side.

5.) Open the war3map.j of the version you wish to modify (^1) on your text editor.

6.) In the case of added lines, copy the entire line and paste it on the corresponding region in (^1).

~For adding in the NZCP pack, notice that in my modified map that they have different function names than that from the original thread. That is to avoid function name conflict. You may copy the entire NZCP text region from my modded maps and paste it.

~Also, if you think you can't find the places where you have to paste the thing, you can look at a nearby line (globals, endglobals, function main, etc.).

7.) In the case of modifying existing lines, look at what the conflict is, and modify accordingly. (Do note that all function names change every version, so take care)

~One such case is modifying a very long calculation. Just search for this text "and GetRandomReal(0,'d')<(1." without the quotation marks. There is only one such occurrence of that string.

~Most of what you would modify are the drop rates. Usually they're in the form of "call *three character function name*(*2 char code*, ('*item code*', (('original drop rate')*1.))". It's a bit tricky at the start, but with enough time, you will recognize these patterns instantly.

~Some of what you would modify are the item drop limits (as in the number of items a boss can drop). They're usually in the form "call *three characters*('*boss code, I think*, *limit*, $*2 char code*, *2 char code*, *2 char code*). It's a lot trickier than above, but still manageable once you get the hang of it.

8.) Save your modified file.

9.) Delete the war3map.j file in ^1 and replace it with your modified file. (You can copy by dragging the file onto the MPQ Editor, make sure to delete the original file first tho).

10.) Test the map. If it crashes, it means there is a conflict of some kind. Check your backup file's war3map.j and compare your edits. For the most part, if you followed the edits properly, there won't be any problems.

If you want, you can share the modified map in these forums. Don't mention it in the official Discord tho. Might get you on the banned list.

EDIT: For those who wish to make a MIGRATION map of sorts (that's a latest supported version where saves from a previous version can be loaded to resave to a later version, because version updates sometimes aren't save-compatible with older maps), read this EDIT. To check which version is compatible with which, it says right there on the map description when you start the game. Basically, all you need to do is copy the NZCP edits, you would not need to copy the drop rates or anything. After you add the NZCP, it allows you to load saves from SHDR versions. It also allows you to make your save version compatible with later versions of the map.
User avatar
devoltz
Co-Admin
Posts: 3128
Joined: March 23rd, 2016, 8:06 pm
Has thanked: 10 times
Been thanked: 54 times

Re: [GUIDE] Modifying TWRPG Maps

Post by devoltz »

https://forum.wc3edit.net/tutorials-cheatpacks-f80/shdr-version-for-twrpg-t36350.html