"Expected end of line"

Dryvnt

New Member
Reaction score
10
So well i got NewGen and now im trying to do some spells using globals, but whenever i try to make globals it says "Expected end of line" when i save or test map... But normally it would fix itself if i copied what Flare wrote in another thread, but now it wont... Ill give you code :thup:. And yes, it's yet ANOTHER war stomp with pushback :rolleyes:...

JASS:
globals
    location tp = GetUnitLoc(GetTriggerUnit())
    group slideg = GetUnitsInRangeOfLocAll(250, tp)
endglobals

function Conditions takes nothing returns boolean
    return (GetSpellAbilityId() == 'Wars')
endfunction

function slide takes nothing returns nothing
    local unit fogu
    local location fogp
    local location movepoint
    local real angle
    loop
        set fogu = FirstOfGroup(slideg)
        exitwhen fogu == null
        set fogp = GetUnitLoc(fogu)
        set angle = AngleBetweenPoints(tp, fogp)
        set movepoint = PolarProjectionBJ(fogp, 15, angle)
        call SetUnitPositionLoc(fogu, movepoint)
        endloop
endfunction

function Actions takes nothing returns nothing
    local timer t = CreateTimer()
    call TimerStart(t, 0.04, true, function slide)
endfunction

//===========================================================================
function InitTrig_Imp_War_Stomp takes nothing returns nothing
    local trigger Imp_War_Stomp = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( Imp_War_Stomp, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( Imp_War_Stomp, Condition( function Conditions ) )
    call TriggerAddAction( Imp_War_Stomp, function Actions )
    set Imp_War_Stomp = null
endfunction


PS: I haven't leak fixed it yet, i wanna do it myself... And also, i got custom ability ID's
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
609
did you add the scope tags?

JASS:

scope TriggerName

globals
    location tp = GetUnitLoc(GetTriggerUnit())
    group slideg = GetUnitsInRangeOfLocAll(250, tp)
endglobals

function Conditions takes nothing returns boolean
    return (GetSpellAbilityId() == 'Wars')
endfunction

function slide takes nothing returns nothing
    local unit fogu
    local location fogp
    local location movepoint
    local real angle
    loop
        set fogu = FirstOfGroup(slideg)
        exitwhen fogu == null
        set fogp = GetUnitLoc(fogu)
        set angle = AngleBetweenPoints(tp, fogp)
        set movepoint = PolarProjectionBJ(fogp, 15, angle)
        call SetUnitPositionLoc(fogu, movepoint)
        endloop
endfunction

function Actions takes nothing returns nothing
    local timer t = CreateTimer()
    call TimerStart(t, 0.04, true, function slide)
endfunction

//===========================================================================
function InitTrig_Imp_War_Stomp takes nothing returns nothing
    local trigger Imp_War_Stomp = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( Imp_War_Stomp, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( Imp_War_Stomp, Condition( function Conditions ) )
    call TriggerAddAction( Imp_War_Stomp, function Actions )
    set Imp_War_Stomp = null
endfunction
endscope
 

Dryvnt

New Member
Reaction score
10


I dont think you can initialize globals like that.
That might not be your problem though.

No that's not my problem :/. I tried doing that, but it didn't work :(... Maybe the vJASS aint installed allright, because even the
JASS:
private constant *vartype* *varname* = *some value*
in the scripts that do work with globals, dont work... I get the error code "Undefined type private"... :banghead:
 

Flare

Stops copies me!
Reaction score
662


I dont think you can initialize globals like that.
That might not be your problem though.

That shouldn't be the problem, from what I know (it'll cause the spell to not work properly in-game, but it shouldn't give a syntax error).

Try remove the '= value' part of those lines, just incase that is the problem. That's the only thing I can see that's wrong
 

Dryvnt

New Member
Reaction score
10
I think my NewGen dont work with vJASS, cause when i create globals in the normal editor, it says the same as in NewGen... But my TESH say's that there aint any syntax errors... So is there anything i have to do from a fresh install of NewGen 1.5 to install/enable vJASS? :confused:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top