wc3edit.net
https://forum.wc3edit.net/

Importing global declarations/declaring globals in .j
http://forum.wc3edit.net/deprotection-cheating-f64/importing-global-declarations-declaring-globals-in-j-t35211.html
Page 1 of 1

Author:  BzB [ July 18th, 2018, 2:47 pm ]
Post subject:  Importing global declarations/declaring globals in .j

So, thanks to your help (devoltz and nuzamacuxe), I've made significant progress understanding how to deprotect maps

I believe I'm only 1 step away from getting what I want - an openable, saveable, and runnable map.

(The reason I want all of this is that the debugging tool I found uses the world editor. I really need a debugging tool since the code is obfuscated)

My only current problem is that xdep isn't doing the job - I can't enable the script in world editor due to some code problems.

I've extracted the .j file from the original map, and I wanted to use it, but I have one problem: the global variables.

After using xdep, all the global variables are stored in the .wtg file, it seems, but I can't use that because it seems to change the names of the variables even though I tell it not to in the .ini (it does make a difference, but the names still change)

in the .j file I extracted using Ladik's MPQ editor (without deprotection), all the globals are declared at the beginning of the file, and that won't work. when the world editor compiles everything, the code it shows me in the error message includes and automatically-generated globals declaration, followed by the globals declaration in the .j file.

I'm looking for a way to either import the globals automatically (only option I see atm is doing it by hand...),
or to make the world editor use the declaration in the .j file and not generate it's own
Code:
globals.
...
endglobals
scope in addition to the already existing one

attached is the code I'm trying to fix if you wanna have a look
but I'd love a brief explanation if all it takes is some small changes to it :)

One I got it working I'll publish a tutorial/my journey deprotecting the specific map, and hope that some members of this community would be willing to fix/expand it into something more comprehensive than what's available atm :)

Edit: So I can't delete this thread I think, but I found the problem: all global variables have to have their name begin with udg_ in the script...

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/