• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

New jasshelper bug - . -

Status
Not open for further replies.
Level 31
Joined
Jul 10, 2007
Messages
6,306
Syntax error. Struct declared again.

JASS:
scope B
    static if true then
        private struct a extends array
        endstruct
    else
        private struct a extends array
        endstruct
    endif
endscope

The following works

JASS:
scope B
    static if true then
        struct a extends array
        endstruct
    else
        struct a extends array
        endstruct
    endif
endscope

As does the following

JASS:
scope B
    private keyword a
    
    static if true then
        struct a extends array
        endstruct
    else
        struct a extends array
        endstruct
    endif
endscope



What works with static ifs?

fields
methods
functions

What doesn't work with static ifs?

structs (keyword workaround)
scopes (no workaround)
libraries (no workaround)


Scopes and libraries make sense as they generate globals that static ifs depend on, so they need to be run first. However, structs do not ; ).



Relative paths don't work for //! import. Or rather, they are buggy.


folder
folder\normal
folder\normal\data
folder\debug
folder\debug\data

folder\normal\main.j
folder\normal\data\collection.j

folder\debug\main.j
folder\debug\collection.j

folder\main.j

folder\main.j
JASS:
static if DEBUG_MODE then
    //! import "folder\debug\main.j"
else
    //! import "folder\normal\main.j"
endif

folder\debug\main.j
JASS:
    //! import "data\collection.j"

folder\normal\main.j
JASS:
    //! import "data\collection.j"

result
JASS:
BEGIN IMPORT OF "folder\debug\main.j"
    BEGIN IMPORT OF "folder\debug\collection.j"
    END IMPORT OF "folder\debug\collection.j"
END IMPORT OF "folder\debug\main.j"

BEGIN IMPORT OF "folder\normal\main.j"
    IGNORE DOUBLE IMPORT "folder\debug\collection.j"
END IMPORT OF "folder\normal\main.j"
 
Last edited:
Level 31
Joined
Jul 10, 2007
Messages
6,306
They are not relative to the compiled map mate

As of jasshelper 0.9.C.0 , relative paths used by import an already-imported file will be able to also support the file's path as possible container. Notice that the files in the same folder as the current file have priority over files on the configured paths or even the map's location.

Also, another bug. The "." relative thing breaks import completely. If you use it, it'll import the same script over and over again.

JASS:
// BEGIN IMPORT OF E:\projects\JASS\jass\Data Structures\List\HtNt\main.j
library ListHtNt  uses  optional ErrorMessage	 optional MemoryAnalysis	 TableField				 Table					
// BEGIN IMPORT OF E:\projects\JASS\jass\Data Structures\List\HtNt\.\data\Element.j


private struct Element extends array
endstruct


// END IMPORT OF E:\projects\JASS\jass\Data Structures\List\HtNt\.\data\Element.j
// BEGIN IMPORT OF E:\projects\JASS\jass\Data Structures\List\HtNt\.\data\Collection.j

// BEGIN IMPORT OF E:\projects\JASS\jass\Data Structures\List\HtNt\.\data\.\Element.j


private struct Element extends array
endstruct


// END IMPORT OF E:\projects\JASS\jass\Data Structures\List\HtNt\.\data\.\Element.j
 
Level 6
Joined
Jul 30, 2013
Messages
282
guess it only works for me because map is in the search path then..

that or the fact i got up 1 level as the first bit and then go in to a sibling folder. (wonder)
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
While we're at it, here a more informal report:

Jasshelper complains that
"Functions passed to Filter or Condition must return a boolean",
which is not true, wc3 runs smoothly if the function returns nothing and uses false as default return value.
Note that this is not 100% tested with all possible combinations.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
thats pJass tho, if you download the newest pJass from hive(I dont have the link, cause Im lazy motherfucker and I have 1.3k subbed threads and I aint browsing that to find it) this will no longer pop up(JassHelper calls pJass to do Jass checking).

The function can probably return anything, if it aint boolean, it is false
 
Status
Not open for further replies.
Top