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
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.
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
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
[Solved] Jass comment breakes map
Moderator: Cheaters
-
- Newcomer
- Posts: 4
- Joined: February 11th, 2020, 5:57 pm
[Solved] Jass comment breakes map
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.
-
- Newcomer
- Posts: 4
- Joined: February 11th, 2020, 5:57 pm
Re: Jass comment breakes map
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
-
- Also Not an Admin, but closer than devoltz
- Posts: 1655
- Joined: February 14th, 2018, 5:35 am
- Title: Just Another S.Mod
- Been thanked: 6 times
Re: Jass comment breakes map
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.
-
- Cheater
- Posts: 211
- Joined: August 17th, 2019, 1:50 pm
- Location: Vietnam
Re: Jass comment breakes map
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.
-
- Newcomer
- Posts: 4
- Joined: February 11th, 2020, 5:57 pm
Re: Jass comment breakes map
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 lobbynuzamacuxe 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.
And even if it was inside config func - it just should not matter, it is supposed to be ignored on code transpile!
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 ownertcml wrote:I insert cheats and its works fine, anti-single player removed.
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
-
- Also Not an Admin, but closer than devoltz
- Posts: 1655
- Joined: February 14th, 2018, 5:35 am
- Title: Just Another S.Mod
- Been thanked: 6 times
Re: Jass comment breakes map
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.
-
- Newcomer
- Posts: 4
- Joined: February 11th, 2020, 5:57 pm
Re: Jass comment breakes map
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
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
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
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
-
- Also Not an Admin, but closer than devoltz
- Posts: 1655
- Joined: February 14th, 2018, 5:35 am
- Title: Just Another S.Mod
- Been thanked: 6 times