• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Wierd Problem I can't Find

Status
Not open for further replies.
Ok, Im making a spell in JASS (obviously) and when i do the JASS syntax check the only errors i get are for the spell and the unit, the undeclared vars that you always get. I get no other type of error.

When i put the spell into We (I use WeU) I get this error: Line (w/e) expecting function name.

I cannot make heads or tails of this shit (pardon my language) and i was wondering if anyone could tell me what the problem is.

The line of code it doesnt like is the AoE damage part, I could just make it in GuI then convert it, but i would like to do it with mainly JASS.

I posted the trigger.

All help is appreciated
 

Attachments

  • Psionic Storm.j
    5.2 KB · Views: 90
Level 13
Joined
Nov 22, 2006
Messages
1,260
JASS:
set i = 0
loop
    exitwhen i == 3
    call BJDebugMsg("OMG! BJs! Locations! Leaks! GUI > JASS!!")
    set i = i + 1
endloop


First, lets clean this up a bit:

JASS:
function Trig_Psionic_Storm_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A054' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Psionic_Storm_Actions takes nothing returns nothing
    local location q = GetSpellTargetLoc()
    local unit a //1
    local unit b //2
    local unit c //3
    local unit d //4
    local unit e //5
    local unit f //6
    local unit g //7
    local unit h //8
    local unit i //9
    local unit j //10
    local unit k //11
    local unit l //12
    local unit m //13
    local unit n //14
    local unit o //15
    local unit p //16
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 500.00, 0), bj_UNIT_FACING )
    set a = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 500.00, 45.00), bj_UNIT_FACING )
    set b = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 500.00, 90.00), bj_UNIT_FACING )
    set c = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 500.00, 135.00), bj_UNIT_FACING )
    set d = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 500.00, 180.00), bj_UNIT_FACING )
    set e = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 500.00, 225.00), bj_UNIT_FACING )
    set f = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 500.00, 270.00), bj_UNIT_FACING )
    set g = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 500.00, 315.00), bj_UNIT_FACING )
    set h = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 250.00, 0), bj_UNIT_FACING )
    set i = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 250.00, 45.00), bj_UNIT_FACING )
    set j = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 250.00, 90.00), bj_UNIT_FACING )
    set k = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 250.00, 135.00), bj_UNIT_FACING )
    set l = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 250.00, 180.00), bj_UNIT_FACING )
    set m = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 250.00, 225.00), bj_UNIT_FACING )
    set n = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 250.00, 270.00), bj_UNIT_FACING )
    set o = GetLastCreatedUnit ()
    call CreateNUnitsAtLoc( 1, 'h002', GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetSpellTargetLoc(), 250.00, 315.00), bj_UNIT_FACING )
    set p = GetLastCreatedUnit ()
    call IssueTargetOrderBJ( a, "drain", b )
    call IssueTargetOrderBJ( b, "drain", c )
    call IssueTargetOrderBJ( c, "drain", d )
    call IssueTargetOrderBJ( d, "drain", e )
    call IssueTargetOrderBJ( e, "drain", f )
    call IssueTargetOrderBJ( f, "drain", g )
    call IssueTargetOrderBJ( g, "drain", h )
    call IssueTargetOrderBJ( h, "drain", a )
    call IssueTargetOrderBJ( i, "drain", j ) 
    call IssueTargetOrderBJ( j, "drain", k )
    call IssueTargetOrderBJ( k, "drain", l )
    call IssueTargetOrderBJ( l, "drain", m )
    call IssueTargetOrderBJ( m, "drain", n )
    call IssueTargetOrderBJ( n, "drain", o )
    call IssueTargetOrderBJ( o, "drain", p )
    call IssueTargetOrderBJ( p, "drain", i )
    call DamageUnitsInAOEEx (gg_unit_H001_1025, GetUnitAbilityLevel (gg_unit_H001_1025, A054)* I2R(50), GetLocationX(q), GetLocationY(q), 500, false ,0)   
    
    set a = null
    set b = null
    set c = null
    set d = null
    set e = null
    set f = null
    set g = null
    set h = null
    set i = null
    set j = null
    set k = null
    set l = null
    set m = null
    set n = null
    set o = null
    set p = null   
    call RemoveLocation(q)
endfunction


Now.....watch and learn:

JASS:
function Trig_Psionic_Storm_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A054'
endfunction

function Trig_Psionic_Storm_Actions takes nothing returns nothing
    local location q = GetSpellTargetLoc()
    local unit c = GetTriggerUnit()
    local real x = GetLocationX(q)
    local real y = GetLocationY(q)
    local real x1
    local real y1
    local unit u1 = null
    local unit u2 = null
    local player p = GetOwningPlayer(c)
    local integer i = 0
    call RemoveLocation(q)
    loop
        exitwhen i == 8
        set x1 = x + 500 * Cos((45 * i - 45) * bj_DEGTORAD)
        set x1 = y + 500 * Sin((45 * i - 45) * bj_DEGTORAD)
        set u2 = CreateUnit(p, 'h002', x1, y1, bj_UNIT_FACING) // instead of bj_UNIT_FACING you can put 0 (it's faster to type)
        if u1 != null then
            call IssueTargetOrder(u1, "drain", u2)
        endif
        set u1 = u2
    endloop
    set u1 = null
    set u2 = null
    set i = 0
    loop
        exitwhen i == 8
        set x1 = x + 250 * Cos((45 * i - 45) * bj_DEGTORAD)
        set x1 = y + 250 * Sin((45 * i - 45) * bj_DEGTORAD)
        set u2 = CreateUnit(p, 'h002', x1, y1, bj_UNIT_FACING) // instead of bj_UNIT_FACING you can put 0 (it's faster to type)
        call IssueTargetOrder(u1, "drain", u2)
        set u1 = u2
    endloop
    call DamageUnitsInAOEEx(gg_unit_H001_1025, GetUnitAbilityLevel(gg_unit_H001_1025, A054) * I2R(50), x, y, 500, false ,0)
    set q = null
    set c = null
    set u1 = null
    set u2 = null
    set p = null
endfunction


Doesn't this look better? I don't know why the sintax checker returns the error, nor do I know if this code is rightly fixed. I want Pooty to check it (I don't know much about var1 = var2 side effects).
 
JASS:
call DamageUnitsInAOEEx (gg_unit_H001_1025, GetUnitAbilityLevel (gg_unit_H001_1025, A054)* I2R(50), GetLocationX(q), GetLocationY(q), 500, false ,0)
is the line that makes We give an error, it isnt JASScraft giving the error (JASScraft likes my spell xD)

About how the spell sucks so much ass: still learning JASS so I thought I'd try a spell.

EDIT: Silvenon I tried your spell in JASScraft and it works there, although I think your forgot to increase the value of i inside your loops, when I imported yours it didnt work either, I got the same error message: Line 968: Expected a funtion name.
I use WeU, could that be messing it up somehow?
 
Last edited:
Level 5
Joined
Jan 15, 2007
Messages
199
Code:
call DamageUnitsInAOEEx (gg_unit_H001_1025, GetUnitAbilityLevel (gg_unit_H001_1025, A054)* I2R(50), GetLocationX(q), GetLocationY(q), 500, false ,0)
that function is from the vexorian's caster system or sumthing, you would have to implement that system into your map or use a different function
 
Level 3
Joined
Sep 14, 2007
Messages
43
also if you have 2 functions in different triggers but with the same name you get an expecting function name error.
so check that out it might be the problem
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
I use WeU, could that be messing it up somehow?

WEU is crap, any WEU function can be made with normal JASS.

My suggestion, get Jass NewGen Pack from wc3campaigns.net (tools), it has an improved sintax checker (meaning a much better than the normal WE one), it prevents many kind of crashes (never-ending loops, missing 'endfunction'/'endloop'/'endif'......).

Another suggestion that goes with NewGen is TESH (also from wc3c, tools), that's something that improves your trigger editor, it has many features, highlights, sintax checks (though NewGen already has one), function folding...........Anyways NewGen + TESH = no JassCraft needed, no crashes, vJass (a new jass generation) etc.
 
Level 5
Joined
May 22, 2006
Messages
150
@Silvenon:
Mmh, maybe I am just blind, but apparently something with the name or contraction "TESH" can nether be found at wc3campaigns nor by Google search...
(thinking about, I guess, both possibilities are more or less equal... ^^)
 
I likez WeU, its never cause me any problems and I like being able to give my map 16 tilesets if I need to. If it currupted a map of yours its prolly cause you used the Adv Triggers (I don't use adv triggers, each one you use adds an absurd ammount to your map's size), I just use it cause I like the object editor layout, the terraining capabilities and that it shows alot of the hidden units/effects/doodads
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
WeU is nice for adding the tilesets. However, you don't even need to use the WE. Just use the 'edit map' feature from the main console.

And there are plenty of tutorials listing the hidden material, including stuff WeU missed.

And you can open them in the normal WE if you only mod the tileset, silvenon. It's the triggers that cause problems.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
And you can open them in the normal WE if you only mod the tileset, silvenon. It's the triggers that cause problems.

How dare you not capitalize my name?? I have never been so offended in my life :p (imitating those rich english people)

Oh, I didn't know that. Yeah, I hate WEU triggers......I remember when I actually loved WEU, though I never figured out how to use advanced functions (and when I stopped using it, I found out how :p)
 
Status
Not open for further replies.
Top