HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

noob needs help w/ JASS

08-27-2005, 04:48 PM#1
duckduck
i have this trigger i did in JASS, and i THINK i did it right, but when i save the map, it gives me a bunch of errors either saying: Expected ')' or Expected ' for all my lines and i have no idea where to put in the )s or whatevers
here's the jass i did
Quote:
function Trig_asdf_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A003' ) ) then
return false
endif
return true
endfunction

function Trig_asdf_Actions takes nothing returns nothing
local integer i=0
set udg_caster = ( GetSpellAbilityUnit()
set udg_point = ( GetSpellTargetUnit()
set udg_point = ( GetSpellTargetLoc()
call CreateUnitAtLoc( 1, 'h000' Player(0), udg_point, ( GetUnitFacing(udg_caster) + 5) ) )
set udg_dummy[1] = ( GetLastCreatedUnit()
call CreateUnitAtLoc( 1, 'h000' Player(0), udg_point, ( GetUnitFacing(udg_caster) - 5) )
set udg_dummy[2] = ( GetLastCreatedUnit()
call IssuePointOrderLocBJ( udg_dummy[1](), "shockwave", PolarProjectionBJ(GetUnitLoc(udg_dummy[1]()), 800.00, 0) )
call IssuePointOrderLocBJ( udg_dummy[2](), "shockwave", PolarProjectionBJ(GetUnitLoc(udg_dummy[2]()), 800.00, 0) )
call CreateUnitAtLoc(1, 'h000' Player(0), PolarProjectionBJ(GetUnitLoc(udg_dummy[1]()), 800.00, 0) )
set udg_dummy[3] = ( GetLastCreatedUnit()
call CreateUnitAtLoc(1, 'h000' Player(0), PolarProjectionBJ(GetUnitLoc(udg_dummy[1]()), 800.00, 0)
set udg_dummy[4] = (GetLastCreatedUnit()
call CreateUnitAtLoc(1, 'h000' Player(0), PolarProjectionBJ(GetUnitLoc(udg_dummy[2]()), 800.00, 0)
set udg_dummy[5] = (GetLastCreatedUnit()
call CreateUnitAtLoc(1, 'h000' Player(0), PolarProjectionBJ(GetUnitLoc(udg_dummy[2]()), 800.00, 0)
set udg_dummy[6] = (GetLastCreatedUnit()
call IssuePointOrderLocBJ( udg_dummy[3](), "shockwave", PolarProjectionBJ(GetUnitLoc(udg_dummy[3]()), 800.00, 0) )
call IssuePointOrderLocBJ( udg_dummy[4](), "shockwave", PolarProjectionBJ(GetUnitLoc(udg_dummy[4]()), 800.00, 0) )
call IssuePointOrderLocBJ( udg_dummy[5](), "shockwave", PolarProjectionBJ(GetUnitLoc(udg_dummy[5]()), 800.00, 0) )
call IssuePointOrderLocBJ( udg_dummy[6](), "shockwavE", PolarProjectionBJ(GetUnitLoc(udg_dummy[6]()), 800.00, 0) )
loop
exitwhen (i==6)
call RemoveUnit( udg_dummy[i])
set i=i + 1
endloop

endfunction

//===========================================================================
function InitTrig_asdf takes nothing returns nothing
set gg_trg_asdf = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_asdf, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_asdf, Condition( function Trig_asdf_Conditions ) )
call TriggerAddAction( gg_trg_asdf, function Trig_asdf_Actions )
endfunction

08-27-2005, 10:37 PM#2
Vexorian
Quote:
and i THINK i did it right

You didn't.

The condition function has a lot of unneeded code.

But most likelly the errors are because you have an extra ( after each set (variable)= statement
08-28-2005, 07:22 PM#3
duckduck
hm... since i suck at jass, can you do it for me? if you have time?
08-29-2005, 06:07 AM#4
drdlord
on each line count how many "(" you have and how many ")" you have for example:

set udg_caster = ( GetSpellAbilityUnit()

has 2 "(" but only 1 ")". That's a problem. In that line's case you want ether

set udg_caster = ( GetSpellAbilityUnit() )

or better

set udg_caster = GetSpellAbilityUnit()

get the idea?
08-29-2005, 04:09 PM#5
duckduck
for some of the lines they had the same numbers of ( and same numbers of )
it reduce the amount of errors though...
08-29-2005, 04:18 PM#6
Thunder_Eye
or an ) after the ()
like

set udg_caster = ( GetSpellAbilityUnit() )
08-30-2005, 01:08 AM#7
drdlord
these errors are often cause by a previous line having the wrong number of ( or ) check EVERY line for matching numbers of each not just the error lines.

Also make sure you have () after every function and NOT after variables
08-30-2005, 03:15 PM#8
oNdizZ
call IssuePointOrderLocBJ( udg_dummy[6](), "shockwavE", PolarProjectionBJ(GetUnitLoc(udg_dummy[6]()), 800.00, 0) )

im pretty sure its case sensitive.
08-30-2005, 10:55 PM#9
Vexorian
Yes, but it wouldn't give an error for that
08-31-2005, 04:30 PM#10
duckduck
Quote:
Originally Posted by oNdizZ
call IssuePointOrderLocBJ( udg_dummy[6](), "shockwavE", PolarProjectionBJ(GetUnitLoc(udg_dummy[6]()), 800.00, 0) )

im pretty sure its case sensitive.
i alrdy fixed that a while ago, just didn't edit the post