• 🏆 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!

[JASS] Vjass Structs

Status
Not open for further replies.
Level 7
Joined
Mar 16, 2008
Messages
348
I have began to learn Vjass yesterday, and i know pretty much, but when i tried to apply my knowledge i find i do not know where to insert libraries and structs, if i insert them at the top of trigger it just gives me tons of errors.
For example:
JASS:
struct unitcustomvalues
integer customvalue1 = 0
endstruct
globals
integer unitcount =0
unitcustomvalues array units
endglobals
function Trig_Custom_Values_Assignment_Actions takes nothing returns nothing

call SetUnitUserData(GetEnteringUnit(), unitcount)
set units[unitcount] = unitcustomvalues.create()
set unitcount =unitcount+1
endfunction

//===========================================================================
function InitTrig_Custom_Values_Assignment takes nothing returns nothing

    set gg_trg_Custom_Values_Assignment = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Custom_Values_Assignment, function Trig_Custom_Values_Assignment_Actions )
    call TriggerRegisterEnterRectSimple( gg_trg_Custom_Values_Assignment, GetPlayableMapRect())
endfunction
Does not work and gives about 30 errors(sintax, statement out of function , etc...).
 
Level 7
Joined
Mar 16, 2008
Messages
348
Well Jasshelper is enabled because it has colurfull sintax and those + and - signs which are really useful, wait a sec i'll take a screenie.
How it's enabled and the checker
scrvj1.png


scrvjass2.png
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
That does not mean it is enabled.
Go in the main window of the WE.
In the menus click JassHelper.
Click Enable JassHelper.
There are other options you should explore.
For instance Grimoire->Disable WE syntax checker.
 
Level 7
Joined
Mar 16, 2008
Messages
348
It gives the same errors i think, but ill do it just to check.
Yep it gives same errors, i think the problem is the pjass parser, it is not made for Vjass or maybe it's my computer
And spiwn all those are enabled.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
"Well Jasshelper is enabled because it has colurfull sintax and those + and - signs which are really useful, wait a sec i'll take a screenie."
That does not mean it is enabled.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
I was just backing up my post ;)
This trigger gives no errors here.
So the problem is about some options.
 
Level 7
Joined
Mar 16, 2008
Messages
348
Or my freaking computer that sucks -.-.I HATE MY COMPUTER!I'm gonna make a list of the options i have enabled wait a sec:
UMSWE-Enable UMSWE
Grimoire- All of the second category
Jasshelper- All of the first category
 
Level 7
Joined
Mar 16, 2008
Messages
348
umm sorry to disapoint you but i really tought that was the problem and all, but i didn't try before i gve you rep, now i tried,i enabled it and... it's the same :(
Now i redownloaded and reseted everything to default, and it works!!!!Too bad the syntax checker still doesn't work :(
 
Last edited:
Level 12
Joined
Apr 27, 2008
Messages
1,228
If everything works, than the syntax checker is working(the one from the button "Syntax Check" is rather buggy.
You see structs are only vJass so without JassHelper that code would have given you errors.
Still, the problem was in the options you have enabled/disabled.
To explore them, when enabling something you do not know, enable it one at a time.
 
Level 7
Joined
Mar 16, 2008
Messages
348
Well it works now, and the problem wasn't the WE parser, it was the Pjass parser that wasn't recognizing the vjass sintax since i ahd accidentaly disabled it, but it works now, thanks spiwn!
 
Status
Not open for further replies.
Top