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. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,944
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Mac and Windows use a different new line character? I thought both used \n as the new line but Windows expects a carrage return character afterwards (2 characters instead of 1).

    Adding new keywords or major behaviour revisions is not a good idea once a language is established. If you want them you need to develop in parallel as a new language (like vJASS2.0) to avoid backwards compatibility problems (such as someone naming a variable to). This could be done by a hidden comment (like the scrole position JNGP makes) or a macro command which tells which precompiler is to run on a piece of script. Ofcourse you encourage people to switch over to vJASS2.0 but by doing this you do not break existing code.

    This is the whole problem with standards. Once they are established it is very difficult to make changes, even if they are constructive. OpenGL is a good example of this as it is foreced to remain backwards compatible due to popular demand even though it comes at a heavy performance penalty. Only recently has OpenGL managed to overcome this with the introduction of versions 3 and 4 which were parallel extensions to the standard. Direct3D also suffered this under its 9 version, which is why 10's standard was not backwards compatible (needed new OS and Hardware).
     
  2. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,199
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    JassHelper never made it to version 1.0. I think it's fair to add a couple of keywords on a resource that hasn't even made it past "Beta". Then again, Gold Parser never made it to a 1.0 version, either.
     
  3. Uberplayer.

    Uberplayer.

    Joined:
    Dec 1, 2008
    Messages:
    120
    Resources:
    0
    Resources:
    0
    Getting random runtime errors (Runtime error 216 at 00404146) with this. Sometimes it just freezes whole NewGen, and I have to kill the process.

    With Vexorian's everything works just fine.
     
  4. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    i get them too.. I also believe that this jasshelper leaks... editor memory usage in task manager goes up every time I save. I had it using like 500 megs of ram at one point.
     
  5. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    What runtime errors? when? why? (it cannot be random)
    Any example of code that does it?
    Can someone make a decent bug report?

    And jasshelper cannot leak memory because it is not a resident process,
    it terminates after it saves the map.
    What is leaking is probably TESH, and that is not my problem.
     
  6. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    For me, it's happened only when I've tried to find text with CTRL+F, and only two times out of many (rather random). It only started doing this with your stuff.

    As for the memory leaks, I suppose TESH might leak since my laptop used to always freeze with WE ; ). Well, actually I use horus or w/e, but anyways.
     
  7. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,199
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Earlier today my wc3 crashed when I used "Test Map" on an already-existing map without first saving it.

    Though I have been unable to reproduce that error. It could have been a random page fault of some kind.
     
  8. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    A bug that cannot be reproduced is not a bug.
     
  9. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Every time I type something, this window pops up

    [​IMG]


    Care to elaborate on what it is? ^)^
     

    Attached Files:

  10. Frotty

    Frotty

    Wurst Reviewer

    Joined:
    Jan 1, 2009
    Messages:
    1,478
    Resources:
    11
    Models:
    3
    Tools:
    1
    Maps:
    5
    Tutorials:
    1
    Wurst:
    1
    Resources:
    11
    Grimoire/Tesh error, what does this have to do with JassHelper?
     
  11. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    This doesn't work..

    Code (vJASS):

        globals
            debug private boolean array al
            debug private boolean array alm
            debug private boolean en = true
        endglobals
     


    And this is included with or without debug mode still
    Code (vJASS):

    static if DEBUG_MODE
        globals
            private boolean array al
            private boolean array alm
            private boolean en = true
        endglobals
    endif
     


    This doesn't work as well
    Code (vJASS):

    debug private function Hi takes nothing returns nothing
    debug endfunction
     


    For now, I am doing this
    Code (vJASS):

        static if DEBUG_MODE then
            private struct DEB extends array
                static boolean array al
                static boolean array DEB.alm
                static boolean DEB.en = true
            endstruct
        endif
     


    Quite the annoying workaround ; p


    So what I think needs to be done is
    debug global

    globals in order of appearance with precedence with static if magic


    Then there will be no more weird behavior for static ifs ^^


    edit
    Modules apparently don't work either...

    Attached map does not save when you enable the CTM Not Working trig


    I tested it and it happens when more than 1 of that module is implemented.

    Also, when enabling both trigs, it magically works again...

    edit
    Another error.. apparently I can only implement my CTM module in 45 different structs before jasshelper crashes... at #46, it tells me, unexpected this.. at #47, it just totally freezes.

    looks like these benchmarks I want to do will have to wait until you fix this : (

    edit
    I Have Discovered The Culprit!
    It's structs w/ onInit... and the bug is freaking weird...

    Here is a prime example.. this works
    Code (vJASS):

    //! textmacro TEST takes I, T
    struct Tester$I$ extends array
        private static constant real TIMEOUT = .$T$
        private static integer did = TO_DO
       
        implement CTMExpire
        implement CTMEnd
        private static method run takes nothing returns nothing
            local integer i = did
            set did = did - RATE
            if (0 > did) then
                set did = 0
            endif
            loop
                exitwhen did == i
                call create(TIMEOUT)
                set i = i - 1
            endloop
            if (0 == did) then
                call PauseTimer(GetExpiredTimer())
                call DestroyTimer(GetExpiredTimer())
            endif
        endmethod
        private static method onInit takes nothing returns nothing
            call TimerStart(CreateTimer(), RUN_TIME, true, function thistype.run)
        endmethod
    endstruct

    //! endtextmacro

    //! runtextmacro TEST("0", "10")
    //! runtextmacro TEST("1", "11")
    //! runtextmacro TEST("2", "12")
    //! runtextmacro TEST("3", "13")
    //! runtextmacro TEST("4", "14")
    //! runtextmacro TEST("5", "15")
    //! runtextmacro TEST("6", "16")
    //! runtextmacro TEST("7", "17")
    //! runtextmacro TEST("8", "18")
    //! runtextmacro TEST("9", "19")

    //! runtextmacro TEST("10", "10")
    //! runtextmacro TEST("11", "11")
    //! runtextmacro TEST("12", "12")
    //! runtextmacro TEST("13", "13")
    //! runtextmacro TEST("14", "14")
    //! runtextmacro TEST("15", "15")
    //! runtextmacro TEST("16", "16")
    //! runtextmacro TEST("17", "17")
    //! runtextmacro TEST("18", "18")
    //! runtextmacro TEST("19", "19")

    //! runtextmacro TEST("20", "10")
    //! runtextmacro TEST("21", "11")
    //! runtextmacro TEST("22", "12")
    //! runtextmacro TEST("23", "13")
    //! runtextmacro TEST("24", "14")
    //! runtextmacro TEST("25", "15")
    //! runtextmacro TEST("26", "16")
    //! runtextmacro TEST("27", "17")
    //! runtextmacro TEST("28", "18")
    //! runtextmacro TEST("29", "19")

    //! runtextmacro TEST("30", "10")
    //! runtextmacro TEST("31", "11")
    //! runtextmacro TEST("32", "12")
    //! runtextmacro TEST("33", "13")
    //! runtextmacro TEST("34", "14")
     


    But this does not.. (the only difference is the carriage return yes...)
    Code (vJASS):

    //! textmacro TEST takes I, T
    struct Tester$I$ extends array
        private static constant real TIMEOUT = .$T$
        private static integer did = TO_DO
       
        implement CTMExpire

        implement CTMEnd
        private static method run takes nothing returns nothing
            local integer i = did
            set did = did - RATE
            if (0 > did) then
                set did = 0
            endif
            loop
                exitwhen did == i
                call create(TIMEOUT)
                set i = i - 1
            endloop
            if (0 == did) then
                call PauseTimer(GetExpiredTimer())
                call DestroyTimer(GetExpiredTimer())
            endif
        endmethod
        private static method onInit takes nothing returns nothing
            call TimerStart(CreateTimer(), RUN_TIME, true, function thistype.run)
        endmethod
    endstruct

    //! endtextmacro

    //! runtextmacro TEST("0", "10")
    //! runtextmacro TEST("1", "11")
    //! runtextmacro TEST("2", "12")
    //! runtextmacro TEST("3", "13")
    //! runtextmacro TEST("4", "14")
    //! runtextmacro TEST("5", "15")
    //! runtextmacro TEST("6", "16")
    //! runtextmacro TEST("7", "17")
    //! runtextmacro TEST("8", "18")
    //! runtextmacro TEST("9", "19")

    //! runtextmacro TEST("10", "10")
    //! runtextmacro TEST("11", "11")
    //! runtextmacro TEST("12", "12")
    //! runtextmacro TEST("13", "13")
    //! runtextmacro TEST("14", "14")
    //! runtextmacro TEST("15", "15")
    //! runtextmacro TEST("16", "16")
    //! runtextmacro TEST("17", "17")
    //! runtextmacro TEST("18", "18")
    //! runtextmacro TEST("19", "19")

    //! runtextmacro TEST("20", "10")
    //! runtextmacro TEST("21", "11")
    //! runtextmacro TEST("22", "12")
    //! runtextmacro TEST("23", "13")
    //! runtextmacro TEST("24", "14")
    //! runtextmacro TEST("25", "15")
    //! runtextmacro TEST("26", "16")
    //! runtextmacro TEST("27", "17")
    //! runtextmacro TEST("28", "18")
    //! runtextmacro TEST("29", "19")

    //! runtextmacro TEST("30", "10")
    //! runtextmacro TEST("31", "11")
    //! runtextmacro TEST("32", "12")
    //! runtextmacro TEST("33", "13")
    //! runtextmacro TEST("34", "14")
     


    Also, it magically works if I have a crap load of functions in the map
    Code (vJASS):

    //! textmacro TEST2 takes I
        function A$I$m takes nothing returns nothing
        endfunction
        function B$I$$I$ takes nothing returns nothing
        endfunction
        function C$I$$I$ takes nothing returns nothing
        endfunction
        function D$I$$I$ takes nothing returns nothing
        endfunction
        function E$I$$I$ takes nothing returns nothing
        endfunction
        function F$I$$I$ takes nothing returns nothing
        endfunction
        function G$I$$I$ takes nothing returns nothing
        endfunction
       
        function A$I$0$I$ takes nothing returns nothing
        endfunction
        function A$I$1$I$ takes nothing returns nothing
        endfunction
        function A$I$2$I$ takes nothing returns nothing
        endfunction
        function A$I$3$I$ takes nothing returns nothing
        endfunction
        function A$I$4$I$ takes nothing returns nothing
        endfunction
        function A$I$5$I$ takes nothing returns nothing
        endfunction
        function A$I$6$I$ takes nothing returns nothing
        endfunction
        function A$I$7$I$ takes nothing returns nothing
        endfunction
        function A$I$8$I$ takes nothing returns nothing
        endfunction
        function A$I$9$I$ takes nothing returns nothing
        endfunction
       
        function A$I$10$I$ takes nothing returns nothing
        endfunction
        function A$I$11$I$ takes nothing returns nothing
        endfunction
        function A$I$12$I$ takes nothing returns nothing
        endfunction
        function A$I$13$I$ takes nothing returns nothing
        endfunction
        function A$I$14$I$ takes nothing returns nothing
        endfunction
        function A$I$15$I$ takes nothing returns nothing
        endfunction
        function A$I$16$I$ takes nothing returns nothing
        endfunction
        function A$I$17$I$ takes nothing returns nothing
        endfunction
        function A$I$18$I$ takes nothing returns nothing
        endfunction
        function A$I$19$I$ takes nothing returns nothing
        endfunction
       
        function A$I$20$I$ takes nothing returns nothing
        endfunction
        function A$I$21$I$ takes nothing returns nothing
        endfunction
        function A$I$22$I$ takes nothing returns nothing
        endfunction
        function A$I$23$I$ takes nothing returns nothing
        endfunction
        function A$I$24$I$ takes nothing returns nothing
        endfunction
        function A$I$25$I$ takes nothing returns nothing
        endfunction
        function A$I$26$I$ takes nothing returns nothing
        endfunction
        function A$I$27$I$ takes nothing returns nothing
        endfunction
        function A$I$28$I$ takes nothing returns nothing
        endfunction
        function A$I$29$I$ takes nothing returns nothing
        endfunction
    //! endtextmacro

    //! runtextmacro TEST2("0")
    //! runtextmacro TEST2("1")
    //! runtextmacro TEST2("2")
    //! runtextmacro TEST2("3")
    //! runtextmacro TEST2("4")
    //! runtextmacro TEST2("5")
    //! runtextmacro TEST2("6")
    //! runtextmacro TEST2("7")
    //! runtextmacro TEST2("8")
    //! runtextmacro TEST2("9")

    //! runtextmacro TEST2("10")
    //! runtextmacro TEST2("11")
    //! runtextmacro TEST2("12")
    //! runtextmacro TEST2("13")
    //! runtextmacro TEST2("14")
    //! runtextmacro TEST2("15")
    //! runtextmacro TEST2("16")
    //! runtextmacro TEST2("17")
    //! runtextmacro TEST2("18")
    //! runtextmacro TEST2("19")

    //! runtextmacro TEST2("20")
    //! runtextmacro TEST2("21")
    //! runtextmacro TEST2("22")
    //! runtextmacro TEST2("23")
    //! runtextmacro TEST2("24")
    //! runtextmacro TEST2("25")
    //! runtextmacro TEST2("26")
    //! runtextmacro TEST2("27")
    //! runtextmacro TEST2("28")
    //! runtextmacro TEST2("29")

    //! runtextmacro TEST2("30")
    //! runtextmacro TEST2("31")
    //! runtextmacro TEST2("32")
    //! runtextmacro TEST2("33")
    //! runtextmacro TEST2("34")
    //! runtextmacro TEST2("35")
    //! runtextmacro TEST2("36")
    //! runtextmacro TEST2("37")
    //! runtextmacro TEST2("38")
    //! runtextmacro TEST2("39")

    //! runtextmacro TEST2("40")
    //! runtextmacro TEST2("41")
    //! runtextmacro TEST2("42")
    //! runtextmacro TEST2("43")
    //! runtextmacro TEST2("44")
    //! runtextmacro TEST2("45")
    //! runtextmacro TEST2("46")
    //! runtextmacro TEST2("47")
    //! runtextmacro TEST2("48")
    //! runtextmacro TEST2("49")

    //! runtextmacro TEST2("50")
    //! runtextmacro TEST2("51")
    //! runtextmacro TEST2("52")
    //! runtextmacro TEST2("53")
    //! runtextmacro TEST2("54")
    //! runtextmacro TEST2("55")
    //! runtextmacro TEST2("56")
    //! runtextmacro TEST2("57")
    //! runtextmacro TEST2("58")
    //! runtextmacro TEST2("59")

    //! runtextmacro TEST2("60")
    //! runtextmacro TEST2("61")
    //! runtextmacro TEST2("62")
    //! runtextmacro TEST2("63")
    //! runtextmacro TEST2("64")
    //! runtextmacro TEST2("65")
    //! runtextmacro TEST2("66")
    //! runtextmacro TEST2("67")
    //! runtextmacro TEST2("68")
    //! runtextmacro TEST2("69")

    //! runtextmacro TEST2("70")
    //! runtextmacro TEST2("71")
    //! runtextmacro TEST2("72")
    //! runtextmacro TEST2("73")
    //! runtextmacro TEST2("74")
    //! runtextmacro TEST2("75")
    //! runtextmacro TEST2("76")
    //! runtextmacro TEST2("77")
    //! runtextmacro TEST2("78")
    //! runtextmacro TEST2("79")
     
     

    Attached Files:

    Last edited: Feb 27, 2012
  12. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    Please when you report things make a distinction between old and new jasshelper.

    The static if with globals thing is a problem of old jasshelper,
    so what you are asking there is adding a new feature.

    The rest is a bug report on new jasshelper.

    You can expect the fix on Saturday, I have no time during work days.
     
  13. Garfield1337

    Garfield1337

    Joined:
    Jul 6, 2009
    Messages:
    1,806
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    You should make
    set
    and
    call
    optional, they're annoying :x
     
  14. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Could you, at some point, add the missing comparator operators to structs? They only support < atm.
     
  15. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,199
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    They also support "==" according to some whacky discovery.
     
  16. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    It would also be nice to eventually make it so that a function that takes something like
    Code (vJASS):

    struct Boo extends array
    endstruct

    function Ho takes Boo boo returns nothing
    endfunction
     


    Will fail on this
    call Ho(1)


    And succeed on this
    call Ho(Boo(1))


    And vice versa
    Code (vJASS):

    struct Boo extends array
    endstruct

    function Ho takes integer boo returns nothing
    endfunction
     


    call Ho(Boo(1)) //fail

    call Ho(1) //succeed
     
  17. LeP

    LeP

    Joined:
    Feb 13, 2008
    Messages:
    463
    Resources:
    0
    Resources:
    0
    You mean like written down in the manual.
     
  18. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,199
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    It's not in manual
     
  19. LeP

    LeP

    Joined:
    Feb 13, 2008
    Messages:
    463
    Resources:
    0
    Resources:
    0
    Well it is. It's not much, but it is.

    http://www.wc3c.net/vexorian/jasshelpermanual.html#operover
     
  20. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    New version.
    Fixed an error reported by Nestharus.