1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  4. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  5. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Jasshelper 2011-12-19

Discussion in 'Warcraft Editing Tools' started by cohadar, Dec 19, 2011.

  1. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    I've tried to save the attached map with the newest version and few older ones, but the vJass initializer is never called in the main function.
    Maybe it's because it has "init" in his name, i called it init2, just because init didn't work neither in the first place.
    And yes i've tried with the last "official" jasshelper by Vexorian and the script is compiled as intented.
     

    Attached Files:

  2. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    Bugfix 2012-02-09
    Map was not working because you did not have any structs in it :)

    Border cases always cause problems.
     
  3. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    Ok.

    Btw i'm not sure it's a good idea to rename the generated text files, sure {input/output}_war3map.j seems neater than {input/output}war3map.j
    It's stupid, but i had a hard time to figure that was these files, the first time i wanted to check the generated jass file.
    I mean we all have the habit of the older names (at least the ones who knew them).
    And what about third party tools using them (just a thought).
    Now, i suppose it's fine you don't recreate the current file, since it's supposed to be the same as the output one.
     
  4. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    No tool uses these files directly.
    (It is not possible because they change during compilation)
    //! external directive works on whole map file.

    I made the name change so I can have both old jasshelper and new one compile at same time and not step on each other.

    current file was a temporary storage file but is not used any more because compilation was optimized to be done entirely in memory.
     
  5. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
  6. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,193
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    @Cohadar,

    Do you know if the command-line version of JassHelper will work on Linux? Cause if it does then Ralle has said he might be able to dedicate a partition of the Hive's server to compiling scripts.
     
  7. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    Sorry but it does not, there are explicit references to windows libraries in the source.
     
  8. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,193
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Ugh, would have been nice though.
     
  9. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    Even through wine ?

    At least it is with the "official" jasshelper.
     
  10. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    Wine slows things down, I doubt you would want to install it on hives server.

    NOTE: There are 2 command line versions of jasshelper:
    1. one that processes map .w3x files from command line
    2. one that processes only textual war3map.j script from command line.

    The first one depends on windows.
    The second one could (in theory) be made to work natively on linux.

    If Ralle was thinking about script processing version maybe I could do something.
    I have linux box at home but as always I am short with time.
    Don't expect anything soon.

    //==============================================//

    New Version 2012-02-10

    This version can hopefully be considered stable for the time being.
    There will be no major changes for some time.

    I am planning on some big redesigns so that jasshelper gives better error messages when something goes wrong.
    Messages should tell you the trigger and line number inside the trigger when error happens,
    not a global line number in a half-compiled .j file.

    This will take a while, don't hold your breath.
     
  11. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,193
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Ideally it would be text-based, and from a ".j" file.

    However, he does say he has some .mpq extracting utility on the server, so it's possible that it can grab war3map.j from the map, compile it, then throw the map back at the user, in the best case scenario.
     
  12. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    I've tried to convert the delphi project consolejasser.dpr in a lazarus project with the tool made for that, but there is still windows stuff, and comment it didn't help.
    Ofc i suppose it could still be compiled for linux, but that's not so easy, it requires to edit the code and i have not the knowledge to do it, nor the willing to learn.
     
  13. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    //! include and //! external directives would still not work.
    And //! external is used very often these days (ObjectMerger and LUA)

    If you wanted online compilation of whole maps your best option would be putting it on a windows server.

    The thing I don't understand is why would anyone want to compile maps online?
    If you have a Macintosh it would be both faster and easier to install WMware.
     
  14. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,193
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    The group-for loops work great, however the integer-for loops work a bit awkwardly when compiled.

    Currently they do this:

    Code (vJASS):

            //====== for i = 0 to 7  ======//
            set i = (0) - 1
            loop
                set i = i + 1
                exitwhen i > (7)
                call SetUnitColor(OpenCinematic__warChaser[i], PLAYER_COLOR_RED)
                call SetWidgetLife(OpenCinematic__warChaser[i], 0.406)
            endloop // endfor
     


    I don't know what's the point of adding the "()" wrapper since no optimizer is going to remove that, we're just adding obesity (albeit a small amount). Another problem is, in the beginning, you add 1 for "downto loops" and you subtract 1 for "to loops".

    It would work just fine if the compiler did the following, instead:

    Code (vJASS):

            //====== for i = 0 to 7  ======//
            set i = 0
            loop
                exitwhen i > 7
                call SetUnitColor(OpenCinematic__warChaser[i], PLAYER_COLOR_RED)
                call SetWidgetLife(OpenCinematic__warChaser[i], 0.406)
                set i = i + 1
            endloop // endfor
     


    Looking at the source code (consolejasser/stage2/Structs02) I can see that it is split into two tokens, the "for" and "endfor". While I don't know pascal I can imagine it would be easy enough to set a boolean flag that says whether or not to include the "set i = i +/-1" part when you process a closing "endfor" block.

    Otherwise, great work on this compiler. The loading of blizzard.j/common.j has been the bottleneck of JassHelper parsing for me for the past couple years and you just cut compile time by 3/4 for me.
     
    Last edited: Feb 11, 2012
  15. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    parentheses () are pure semantic elements, they affect only ordering of operations so there is no obesity there.
    The reason they are used is in cases when boundaries of a loop are not simple integers.

    The reason +1/-1 trick is used is to make all closing statements semantically equivalent.
    endloop, endfor, endwhile are all synonyms.

    In general, there are very good reasons for every design decision I make.
    I have experience with this stuff:
    http://sourceforge.net/projects/parapascal/

    Both theory and practice of compilers are known to me so there is no need to worry about the background of jasshelper here.
     
  16. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    I still don't get the need of (), i mean i can't imagine a case where the precedence will be changed if you add () or not.
    Ofc i'm talking about your for loop converted in jass.

    Have you one sample ?
     
  17. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,193
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    @Cohadar, honestly the closing statements don't have to be all identical with how they are parsed. It would honestly just involve a string queue (first in, last out) and if it's a "downto" or a "to" loop you can insert the unique string into the queue, and remove it from the queue when you hit an "endfor" token. You would just store an empty string for things like "for u in group".
     
  18. moyackx

    moyackx

    Joined:
    Feb 15, 2006
    Messages:
    800
    Resources:
    7
    Maps:
    4
    Spells:
    2
    Tutorials:
    1
    Resources:
    7
    @cohadar: I'm now using your software and I have to tell you: IT ROCKS!!!! For this, you've earned a reconnaissance in my map.

    Keep the good work :)
     
  19. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    Tnx moyack.

    @Troll-Brain
    Search for a word "operator" inside jasshelpermanual.
    And than imagine Nestharus doing crazy shit with operator overloading.

    @Bribe
    Compilers are not just about compiling proper code.
    What if you have nested loops but you forgot to close one of them?
    How would you do error reporting there?


    I take great joy in seeing you two reverting to BJism madness.
    It assures me that the latest version is really stable :)
     
  20. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    I'm not sure what you are talking about by "reverting to BJism madness", but it is a while now that i'm no more a speedfreak dude.
    Now, i would still not use your "while not loop", coz of what i've already told you on wc3c.net, but the for loops really cut off verbosity, so i might use them (or not, i'm still not sure).
    At least, i'm already using the "for unit in group" loop.

    I've read the jasshelper documentation again, and even if your for loops are used in a struct where the operator ">" is overloaded, i still can't find a case where the () are needed.