wc3edit.net

United Warcraft 3 map hacking!
It is currently February 25th, 2020, 10:19 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: February 11th, 2020, 10:27 pm 
Offline
Newcomer

Joined: February 11th, 2020, 5:57 pm
Posts: 4
Hello everyone!

I've started studying jass recently and tryed to play with one russian protected RPG map. So I've learned how to get war3map.j out of it, could modify the script, put it back and all is good... except one weird thing. If I add any comment to .j file the map wont load, actually wc3 reforged wont even create lobby for that map, and if i remove comment it works :shock:

I've been googling for 2 days now, searching documentations or any similar cases but found nothing. Every man/doc says i can safely use single line comments "//", but i've also tryed "/* */" and "#" syntax from other languages, just in case, but neither did work, the map just wont work. Also I've tryed to narrow the problem by adding comments outside function bodies, inside, trying different spacings etc. It just seems if there is any comment at all in script, even trailing :!: , the map just wont work. :mad:

Afaik to create lobby game launches only config func, but even if the comment is in main func it wont create lobby, that fact suggests that the problem arises when jass is compiled into machine code. Btw you might say "well, weird, but just dont use comments" - you might be right, but the jass code is obfuscated and 22k lines long, takes time to understand it, and comments would really help a lot! :)

I've also created new map in WE, added simple trigger with comment, saved it, checked .j file - it had lots of comments and the map worked fine. I've tryed to copy comment from that new map but it didn't work either >_<
I've searched docs on w3x format, trying to find is there any kind of binary flag that disallows jass comments or enables some other "strict" mode but found none...

So I am a bit lost right now, if someone has any ideas whats the problem is I will be really glad to hear them :D
I've attached the map itself and listfile i used (i got it by scaninng map with ladik's mpq editor scan)

--edit
fixed typos


You do not have the required permissions to view the files attached to this post.


Last edited by Orbry on February 13th, 2020, 8:49 pm, edited 2 times in total.

Top
 Profile  
 
PostPosted: February 12th, 2020, 7:03 pm 
Offline
Newcomer

Joined: February 11th, 2020, 5:57 pm
Posts: 4
Well, if someone would just check whether you can add any comment to jass code in .j file and make the map work - that would already help a lot! At least I will know whether it's map issue or something is wrong with my environment


Top
 Profile  
 
PostPosted: February 12th, 2020, 9:20 pm 
Offline
Also Not an Admin, but closer than devoltz
User avatar

Joined: February 14th, 2018, 5:35 am
Posts: 1201
Title: Just Another S.Mod
That's really weird... probably whenever you try to comment something it auto broke the script because the map can't load the configs in function config. It's just a bet.


Top
 Profile  
 
PostPosted: February 13th, 2020, 5:35 am 
Offline
Cheater
User avatar

Joined: August 17th, 2019, 1:50 pm
Posts: 213
Location: Vietnam
I don't know anything about jass, cannot help you this case


Last edited by tcml on February 15th, 2020, 3:17 am, edited 3 times in total.

Top
 Profile  
 
PostPosted: February 13th, 2020, 7:19 am 
Offline
Newcomer

Joined: February 11th, 2020, 5:57 pm
Posts: 4
nuzamacuxe wrote:
That's really weird... probably whenever you try to comment something it auto broke the script because the map can't load the configs in function config. It's just a bet.

I had that same thought, but why would that happen? To make it more clear - I do not comment out any existing code, i just add new line with simple comment like "// test" and map refuses to make lobby. And it does not matter where comment is located - it can be outside of any function called in config func, but it still wont make lobby :roll:
And even if it was inside config func - it just should not matter, it is supposed to be ignored on code transpile! :mad:

tcml wrote:
I insert cheats and its works fine, anti-single player removed.

Uhm, thank you I guess, but that's not what I want. I actually want to deobfuscate map code and try to improve or add new features and propose them to map owner :D
Also I've checked the code of the map you have attached - not a single comment inside jass code, does not really help my question :)


Top
 Profile  
 
PostPosted: February 13th, 2020, 9:44 am 
Offline
Also Not an Admin, but closer than devoltz
User avatar

Joined: February 14th, 2018, 5:35 am
Posts: 1201
Title: Just Another S.Mod
As I said, that's weird but I already saw maps acting like that. I just tried what I said and now I at least could create the map but it still broke. Why don't you just do a second war3map.j commented and let the original one "untouched" (you'll do the edits of course but won't comment anything on that one)? It's better since you would be able to do the edits without breaking the code.


Top
 Profile  
 
PostPosted: February 13th, 2020, 10:08 am 
Offline
Newcomer

Joined: February 11th, 2020, 5:57 pm
Posts: 4
Yep, that's one way to avoid this problem but not the most comfortable and if I won't find solution guess I will take it.
But I am not done yet and really curious now why comments breake code :)
I have a couple ideas, will test them out when I have some free time ;-)

-- SOLVED --

Well, the reason for this glitch turned out to be quite trivial :lol:
After opening the script in hex i've noticed that instead of common \r\n or \n it had weird \r line endings, and after converting file to \r\n everything worked like a charm, can paste comments all over my face now :D


Top
 Profile  
 
PostPosted: February 14th, 2020, 12:50 am 
Offline
Also Not an Admin, but closer than devoltz
User avatar

Joined: February 14th, 2018, 5:35 am
Posts: 1201
Title: Just Another S.Mod
Nice! Little details which make difference. Good job.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)