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. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  4. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  5. 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. Bribe

    Bribe

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

    Do you think JassHelper would rune on WINE? WINE is used for a lot of windows-only programs.
     
  2. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    I have a friend which is using jasshelper in command line through wine on linux. (at least the "official" one)
     
  3. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,190
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Too bad WINE doesn't support high-end graphics with SC2, otherwise I would save my money and not buy Windows.
     
  4. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    Oh so you're the guy on the earth which has bought a windows licence ?
     
  5. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,190
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    I'd rather get a legit Windows. WINE has issues even running WC3 videos from what I have read, and since Crossover by CodeWeavers seems to be just a GUI for WINE, I don't see it faring much better (and have seen pretty bad feedback for StarCraft 2 on both virtualizations).
     
  6. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,944
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Or you could re-engineer JASShelper for the GNU compilers.

    The main program would have to be done in C/C++.
    Parsing could be done using YACC (Yet Another Compiler Compiler).
    Some routines could be exported to other cross platform languages like Java, Python or Pearl.

    As long as platform dependencies in the C part are kept low by using GNU specified libraries it should compile and run on the three major platforms. The native based implementation should also give great speedups.
    Of course for the macro scripts you would probably want some other interpreted language which would act as a bottleneck performance wise.

    Libraries like the one used to interact with MPQs are already open source and provided in C/C++ so should be easy to compile cross platform.

    The largest problem would be the amount of work required to port existing functionality to a new implementation which could instead be used to add new functionality to the existing implementation. The lack of man-power available probably renders this idea implausible.
     
  7. moyackx

    moyackx

    Joined:
    Feb 15, 2006
    Messages:
    800
    Resources:
    7
    Maps:
    4
    Spells:
    2
    Tutorials:
    1
    Resources:
    7
    Actually Crossover has better implementation of graphics and performance, and it creates a "windows installer" per game, which is very convenient and safe for playing.

    I don't know, even Vexorian who claimed to be a linux freak wasn't motivated to do something for this platform which made me sad, for taht reason I have a windows partition just to play and mod the game without problems. Let's accept the fact that the games' market is windows and mac and we should be working in those platforms too.

    If it serves as words of support, jasscraft runs nicely in vanilla wine :)
     
  8. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Found a bug

    local unit = target


    outputs
    local unit target


    when it should be a syntax error


    edit
    this bugs too
    local unit = target = source


    turns into
    local unit target = source
     
    Last edited: Mar 27, 2012
  9. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    Ok, noted, will be fixed.
    But not serious enough for a new version.
    (will have to wait some upgrade)
     
  10. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    This crashes jasshelper when it should display a syntax error

    Code (vJASS):

    method operator accuracy takes nothing returns real
    endmethod
     
     
  11. Bribe

    Bribe

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

    What do you think about readonly "global" variables? Currently it only works in structs, but if readonly could allow scope-wide variables to set it and not limit it to just structs, we could see some pretty nice syntax.

    For example, if you want a "constant" reference variable which can't be set from an init block, you have to use ugly "get" syntax or ugly "struct" syntax if you want to prevent the variable from being able to be set by the user from outside the scope.
     
  12. cohadar

    cohadar

    Joined:
    Jun 16, 2007
    Messages:
    234
    Resources:
    0
    Resources:
    0
    Never thought of it, I use get syntax subconsciously (due to java background)
    It is a nice idea, I am just out of time atm, so this goes under "maybe one day" category.
     
  13. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    edit
    Bribe pointed out that Vex's jasshelper bugs up with this stuff too. Libraries like AIDS and UnitIndexer rely on inlining working properly, otherwise the lookups turn into trigger evaluations /cry.
    end edit

    Inlining bug

    Code (vJASS):

    globals
        integer hohoho = 0
    endglobals

    function Ho takes nothing returns nothing
        set hohoho = 5
    endfunction

    struct Hi extends array
        static method sets takes nothing returns nothing
            call setH()
        endmethod
       
        static method setH takes nothing returns nothing
            call Ho()
        endmethod
    endstruct
     


    Turns into
    Code (vJASS):

    function Ho takes nothing returns nothing
        set hohoho=5
    endfunction

        function s__Hi_sets takes nothing returns nothing
            call TriggerEvaluate(st__Hi_setH) // INLINED!!
        endfunction
       
        function s__Hi_setH takes nothing returns nothing
            set hohoho=5 // INLINED!!
        endfunction
     


    Please fix asap ;o

    edit
    Another example of the bug
    Code (vJASS):

    struct Hi extends array
        static method sets takes nothing returns nothing
            local integer i = thistype(5).h
        endmethod
       
        method operator h takes nothing returns integer
            return GetUnitUserData(null)
        endmethod
    endstruct
     


    Turns into
    Code (vJASS):

        function s__Hi_sets takes nothing returns nothing
            local integer i= sc__Hi__get_h((5)) //function that evaluates a trigger
        endfunction
       
        function s__Hi__get_h takes integer this returns integer
            return GetUnitUserData(null)
        endfunction
     
     
    Last edited: Apr 2, 2012
  14. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    edit
    nvm, Tukki pointed out my error ^)^
    end edit

    [] operators a bit buggy

    This does no syntax error
    Code (vJASS):

                if (incoming) then
                    set node = this.incoming[damageType][damageSource].add(priority)
                else
                    set node = this.outgoing[damageType][damageSource].add(priority)
                endif
     


    where incoming/outgoing are structs that have [] operators

    This does do a syntax error
    Code (vJASS):

                if (incoming) then
                    set node = incoming[damageType][damageSource].add(priority)
                else
                    set node = outgoing[damageType][damageSource].add(priority)
                endif
     


    Tells me incoming/outgoing are not arrays.
     
    Last edited: Apr 2, 2012
  15. Tukki

    Tukki

    Joined:
    Feb 10, 2008
    Messages:
    247
    Resources:
    2
    Maps:
    1
    JASS:
    1
    Resources:
    2
    Code (vJASS):

    if (/*incoming*/) then
        set node = /*incoming*/[damageType][damageSource].add(priority)
    else
        set node = outgoing[damageType][damageSource].add(priority)
    endif
     


    Possible that you've done the same with outgoing.
     
  16. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    Yea, I see that now =o
     
  17. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    That means you don't use the tag [forcemethodevaluate] in jasshelper.conf, else you would have a message on save.
    I highly recommend you to use it, to avoid any unwanted auto TriggerEvaluate.

    I suppose it worked in older jasshelper versions, because the optimizer wasn't used in the same process order, but really that makes sense to run in at the end.
    So for your feature it requires to change again the order, that's unlikey Cohadar will do that.

    Plus, what's the point of that, any real code to show ?
     
  18. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    AIDS, Unit Indexer, Timer Tools, Constant Timer Loop 32, and any other module that calls user methods and has methods to be called in it.
     
  19. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    Is it possible to change the color scheme on the editor? or do I have to live with it? ^_^
     
  20. Troll-Brain

    Troll-Brain

    Joined:
    Apr 27, 2008
    Messages:
    2,372
    Resources:
    1
    JASS:
    1
    Resources:
    1
    That's why placing module correctly does matter.
    For the average user, it would be better to use the tag [forcemethodevaluate]
    I mean have you any real example with this recursive call ?

    Plz highlight the code, since i suppose you know where to find it.
    If it's not for me, do it for Cohadar.