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
    Sure, but you're not allowed to use CreateUnit,Rect and such, sure it's clearly not a big deal.
    Also as said, then you would be allowed to use custom functions instead of just natives one.

    But it's probably too overkilled for the providen feature.
     
  2. Bribe

    Bribe

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

    Global blocks are currently parsed before static if's, so if you want to avoid generating certain globals under certain preprocessor conditions, you have to use struct members.

    Try to compile this, it will still generate the "poop" integer.

    Code (vJASS):
    static if false then
        globals
            integer poop = 'fart'
        endglobals
    endif


    I hope this is an easy one to fix, to just move the parsing precedence of globals lower than static if's.
     
  3. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,944
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Except this makes the pre-compiler start to modify the funcionality of the code. This is not a good idea as it encourages people to script badly and rely on the precompiler to make it work rather than script properly in the first place.
     
  4. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    I consider it more like a bug fix (yes i consider that being unable to use a native function in a global definition is a bug), but meh forget it.
     
  5. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Breaks this map

    Specifically this resource -> http://www.hiveworkshop.com/forums/jass-resources-412/system-timer-tools-201165/


    edit
    this jasshelper generates some weird stuff in my map..
    Code (vJASS):

    function sc__SummonHandler_create takes integer unitTypeId,real x,real y,real facing,real x2,real y2,real facing2,integer owner,integer count,integer checkpoint1,integer checkpoint2 returns integer
    set f__arg_integer1=unitTypeId
    set f__arg_real1=x
    set f__arg_real2=y
    set f__arg_real3=facing
    set f__arg_real4=x2
    set f__arg_real5=y2
    set f__arg_real6=facing2
    set f__arg_integer2=owner
    set f__arg_integer3=count
    set f__arg_integer4=checkpoint1
    set f__arg_integer5=checkpoint2
    call TriggerEvaluate(st__SummonHandler_create)
    return f__result_integer
    endfunction
     


    Note that SummonHandler is a struct that extends an array and that function is not called anywhere in the compiled script. Everything that calls it either uses that library or is not in a library.

    Here are some other weird ones..
    Code (vJASS):

    function sc___prototype38_execute takes integer i,integer a1,integer a2 returns nothing
    set f__arg_integer1=a1
    set f__arg_integer2=a2
    call TriggerExecute(st___prototype38[i])
    endfunction
    function sc___prototype38_evaluate takes integer i,integer a1,integer a2 returns nothing
    set f__arg_integer1=a1
    set f__arg_integer2=a2
    call TriggerEvaluate(st___prototype38[i])
    endfunction
     


    What those are I have absolutely no idea..

    edit
    apparently Warcraft 3 doesn't need new line characters to separate lines out??

    check out war3map.j. That is the script optimized by cjass for my map... my map runs and everything using that script... removing all of the spacing/comments and what not cut my script size down by a little more than 50%.
     

    Attached Files:

    Last edited: Feb 19, 2012
  6. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    That stupidly names library is using variable named to
    Code (vJASS):

    private function CQ takes integer f, real to, code c returns integer
     


    You should know by now that "to" is a keyword


    Those are just .evaluate() and .execute() and similar dynamic function calls you are fond of. (overriden methods perhaps?)

    Apparently you don't know the difference between windows and mac newline characters which is disturbing considering your chosen profession.
     
  7. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    I've like never ever worked with mac >.>.

    0 overwritten methods and 0 .executes/.evaluates, which is where my wth comes in ;D.

    The fact is that this broke previously working scripts and maps ^)^, but I'm sure you don't care about breaking what works with vex's jh.
     
  8. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    Yes yes I know, I am a terrible tyrant.

    I just invalidate a few script to build awesome new loops,
    and you complain when you get a nice error message about it.

    Neron burned down the Rome and you did not even get a warning about it, so stop complaining.
     
  9. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    but shouldn't your thing be backwards compatible with vex's jasshelper?

    You can fix this error.. just do some more intelligent parsing to determine if the to keyword belongs to a for loop or not.
     
  10. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    The question is :

    Does it really worth it ?
    Reserved keywords are not meant to be used as a variable name, even the vJass abuse like that is a really terrible practice :

    Code (vJASS):
    struct S

        integer integer

    endstruct


    Sure, these keywords were introduced later, but it doesn't really make sense to use them anyway and the fix is easy.

    Off-topic :

    Btw is "unix" newline characters '\n' are supported for a mapscript ? (i can test it myself, but if you know it ...)
     
  11. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Is it really worth maintaining backwards compatibility? Yes.


    The big thing about this is that it's supposed to be backwards compatible with regular vjass. If you want to add new keywords, that's your problem. They shouldn't be breaking previously working scripts.


    The for to thing is easy to fix. You can just find out if the line starts with "for " (ignoring comments and space) or not. For while, you can check if the line starts with "while " or not. For all of your other keywords, same deal. It's extremely easy to fix... you should probably be doing for this all keywords. loop is a keyword if line starts with loop, etc.


    Breaking backwards compatibility for a major resource like jasshelper is not cool, and if you can fix it (which you can rather easily), you should.
     
  12. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    Ok, let's rephrase it, how many guys on the earth use such shorts names as "to" for their variable and method names, comparing to the other don't at all ?

    "to,while,endwhile,for,in,endfor" are new reserved keyword, take it and "handle" it.

    Not to mention that even if you don't use the new loops if you want a proper init without the module abuse this jasshelper is already needed.
    I mean the pros are much better than this "con", so take your ego off and change your variable/method/whatever names.
     
  13. adic3x

    adic3x

    Joined:
    Aug 19, 2011
    Messages:
    1
    Resources:
    0
    Resources:
    0
  14. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Breaking backwards compatibility for a major resource is a major no no. If it can be fixed, it should be fixed -.-. I've already provided the very easy solution. With regex, it's a 5-10 minute fix...
     
  15. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    Blablabla.
     
  16. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
  17. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    Blablabla *2, as usually you over-exaggerate a little thing that can be "fixed" easily, and shouldn't even exist in the first place anyway (to is a really poor name).

    You're not going to convince me, neither i will convince you, so end of story for me.
     
  18. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    It is a 5-10 seconds fix if you simply change that variable name.

    You cannot really say compatibility is broken if updating your map takes less than 30 seconds and compiler tells you exactly what you need to do.

    Btw any "suggestions" you make about jasshelper are going to the bottom of priority list until you do some community work.
    Specifically writing tests for //! externalblock directive since it is obviously "your thing"

    Same goes for you Troll-Brain.
    I expect you to make some good Module tests (at least 3) that will test every possible use of Modules.
    (They are obviously one of the most used advanced vjass features so it is paramount that EVERYTHING about them is under proper test)

    @adic3x
    Thank you for nice wishes.
     
  19. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    Sounds a bit childish, i mean the suggestions should be considered only depends on their potential usefulness, no matter who said them.
    Now if you use "" to highlight the stupid suggestions, just ignore them.
    I mean it's not because someone help you by provide test codes or anything else, that he should be rewarded by implementing a dumb feature that no-one-will-ever-use-except-the-guy.

    Hopefully i think you are enough mature to get this obvious fact, but i just found your sentence weird.

    Anyway i've done one test, but i don't think i will post more, i'm an lazy-ass after all. (seriously)
     
  20. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    Working on jasshelper is serious and hard work, also one that demands responsibility because of compatibility issues.
    That is where tests come in.

    I don't care what you think it is childish, and I am serious about priority statement above.
    The amount of work that is needed to do those tests is insignificant compared to the amount of work I spend on jasshelper.

    Right now watermelon_1234, Fledermaus and Bribe have request priority because of their contributions.
    Work is rewarded with virtual coins, there is nothing childish about that, it is simple economy.
     
    Last edited: Feb 19, 2012