Restoring protected old map

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

Tsaras
Newcomer
Posts: 2
Joined: November 1st, 2025, 1:00 pm
Has thanked: 1 time

Restoring protected old map

Post by Tsaras »

Old time mapper here, I am in the process of restoring an old map of mine that was protected with Vexorian's optimizer.
After using XDep I got it in a working state, however some editor-only files were missing: war3mapUnits.doo (units/items), war3map.w3r (regions) and possibly others I have not yet stumbled upon.

The .j script file is there but it has all variables and functions renamed to meaningless 2-letter names and all of the initialization functions were moved within the main function. For example, all CreateUnit and Rect functions (for units and regions respectively) are in there.

Using these function calls and this awsome guide I was able to recreate the war3mapUnits.doo and war3map.w3r files so that the units and regions now show in WE. However, when the map is saved, the units and regions are created twice since WE inserts generated initialization code which creates the units and the old main function is still there.

The issue is that in the old main function, the units are assigned to global variables that I was using in triggers, for example:

Code: Select all

set udg_unit42 = CreateUnit(p , 'ncp2' , 6752. , 6816. , 270.)
I tried setting the variables in the generated code and removing them from the old main function but after saving the map in WE, this got overwritten.

Is there anyone who could help me make this work so that I do not lose my variable assignment and I don't have double units/regions while also having the restored units/regions in WE?