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

[JASS] Help with Syntax error

Status
Not open for further replies.
Level 2
Joined
Apr 27, 2008
Messages
29
I keep getting this error with this one line of code in my trigger and I can't seem to find the problem in it. The compile error states "Expected ' " at the line number.

JASS:
    call ForGroupBJ( GetUnitsInRangeOfLocAll(750.00, PlayersShip), function Trig_Fire_Left_Cannons_Func006A(AngleBetweenShips, PlayersShip, FacingAngle, playernum ) )
 
Level 2
Joined
Apr 27, 2008
Messages
29
I have checked all the other lines and they appear to be fine. JassCraft's syntax checker is saying that there is an error on that line as well. Jass Syntax Checker also states that there is an error near 'call' in but neither have told me what exactly it is.

Removing the parameters in the called function and redefining them did not solve the problem. It is still saying that there is an error there.
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Dingo is right, when passing a code parameter to a function (aka ForGroup, ForForce, EnumDestructablesInRect, etc.) the code cannot hold any parameters, it is not like a call, more like a reference to the function. Make the function use Globals for the things you use as parameters now.
 
Level 2
Joined
Apr 27, 2008
Messages
29
Thanks

Ahh, I see what you mean and have fixed it up. The trigger now compiles and works correctly.

Thanks for the help, problem solved. :thumbs_up:
 
Status
Not open for further replies.
Top