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

Status
Not open for further replies.
Level 11
Joined
Jan 17, 2009
Messages
790
Help! syntax error evrywhere!
JASS:
function Trig_BlinkStomp_Actions takes nothing returns nothing
    local unit cast == GetSpellAbilityUnit()
    local real dam == 50.00 * I2R(GetUnitAbilityLevel(unit cast, GetSpellAbilityId() == 'A000'))
    local location targ == GetSpellTargetUnit()
    local real rads == 300.00
    call UnitDamagePointLoc( unit cast, 0, real rads, location targ, real dam, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
    set unit cast == null
    set real dam == null
    set location targ == null
    set local rads == null
endfunction
function Trig_BlinkStomp_Conditions takes nothing returns boolean
    if(not(GetSpellAbilityId()=='A001')) then 
    return false
    endif
    return true
    endfunction
//===========================================================================
function InitTrig_BlinkStomp takes nothing returns nothing
    set gg_Trig_BlinkStomp = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(gg_Trig_BlinkStomp, EVENT_PLAYER_UNIT_SPELL_CAST)
    call TriggerAddCondition(gg_Trig_BlinkStomp, Condition( function Trig_BlinkStomp_Conditions)
    call TriggerAddAction( gg_Trig_BlinkStomp, function Trig_BlinkStomp_Actions )
endfunction
 
Level 8
Joined
Aug 13, 2009
Messages
466
Putting the condition function below the main function may be a bad idea, as functions generally have to be above another function in the script to be able to be called by the lower function. Might be different for conditions, however.

Code:
local real dam [COLOR=RED]==[/COLOR] 50.00 * I2R(GetUnitAbilityLevel([COLOR="Red"]unit [/COLOR]cast,[COLOR=RED] GetSpellAbilityId() == 'A000'[/COLOR]))


These bits seem wrong. == is used to compare boolean terms which either evaluate to true or false. use a single = instead. As for the variable cast, remove the "unit, it shouldn't be there. As for the third part, put the arguments to the GetSpellAbilityId function inside it and not testing if equaling it ( GetSpellAbilityId('A000').

Basically, it should look like

Code:
local real dam = 50.00 * I2R(GetUnitAbilityLevel(cast, GetSpellAbilityId('A000')))

Let's move on to the next line.

JASS:
local location targ == GetSpellTargetUnit()

First of all, GetSpellTargetUnit() returns a unit, not a location. You need to use another function. Second, you're using double = again when you should unly be using one.

As for the rest of the lines, remove the double ='s (It might be needed on some of the null settings, i'm not quite up to speed in this area at the moment), and change how you reference the variables:

Code:
set [COLOR="Red"]unit[/COLOR] cast == null

The word "unit" shouldn't be there, just use the variable's name that you gave it earlier. This goes for all the other variables that you null.
Also, you don't really need to null reals and integers.
 
Level 11
Joined
Jan 17, 2009
Messages
790
JASS:
function Trig_BlinkStomp_Actions takes nothing returns nothing
    local unit cast = GetSpellAbilityUnit()
    local real dam = 50.00 * I2R(GetUnitAbilityLevel( cast, GetSpellAbilityId('A000')))
    local location targ = GetSpellTargetLoc()
    local real rads = 300.00
    call UnitDamagePointLoc( cast, 0, rads, targ, dam, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
    set cast = null
    set targ = null
endfunction
function Trig_BlinkStomp_Conditions takes nothing returns boolean
    if(not(GetSpellAbilityId()=='A000')) then 
    return false
    endif
    return true
    endfunction
//===========================================================================
function InitTrig_BlinkStomp takes nothing returns nothing
    set gg_Trig_BlinkStomp = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(gg_Trig_BlinkStomp, EVENT_PLAYER_UNIT_SPELL_CAST)
    call TriggerAddCondition(gg_Trig_BlinkStomp, Condition( function Trig_BlinkStomp_Conditions)
    call TriggerAddAction( gg_Trig_BlinkStomp, function Trig_BlinkStomp_Actions )
endfunction

LOL still syntax error at line:
3.to many arguments passed to the function
18.undeclared variable gg_Trig_BlinkStomp
21.missing ')'
21.Syntax error
 
Level 8
Joined
Aug 13, 2009
Messages
466
I think I read line 3 a bit lazily ^^

Code:
local real dam = 50.00 * I2R(GetUnitAbilityLevel( cast, [COLOR="Red"]GetSpellAbilityId[/COLOR]('A000')))

You're getting the ID if an ID here, I think. Try just using 'A000' instead.

New code:

Code:
local real dam = 50.00 * I2R(GetUnitAbilityLevel( cast, 'A000'))

EDIT: You've still got the condition function after the other function, by the way.
 
What a mess..

JASS:
function Trig_BlinkStomp_Conditions takes nothing returns boolean
    return GetSpellAbilityId()=='A001'
endfunction

function Trig_BlinkStomp_Actions takes nothing returns nothing
    local unit cast = GetSpellAbilityUnit()
    local real dam = 50.00 * I2R(GetUnitAbilityLevel(cast, GetSpellAbilityId()))
    local location targ = GetUnitLoc(GetSpellTargetUnit())
    local real rads = 300.00
    call UnitDamagePointLoc(cast, 0, rads, targ, dam, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
    call RemoveLocation(targ)
    set cast = null
    set targ = null
endfunction

function InitTrig_BlinkStomp takes nothing returns nothing
    set gg_Trig_BlinkStomp = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(gg_Trig_BlinkStomp, EVENT_PLAYER_UNIT_SPELL_CAST)
    call TriggerAddCondition(gg_Trig_BlinkStomp, Condition(function Trig_BlinkStomp_Conditions))
    call TriggerAddAction(gg_Trig_BlinkStomp, function Trig_BlinkStomp_Actions )
endfunction
 
Level 11
Joined
Jan 17, 2009
Messages
790
LOL that can do it?
trying.....

JASS:
function Trig_BlinkStomp_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
  endfunction
function Trig_BlinkStomp_Actions takes nothing returns nothing
    local unit cast = GetSpellAbilityUnit()
    local real dam = 50.00 * I2R(GetUnitAbilityLevel( cast, GetSpellAbilityId()))
    local location targ = GetSpellTargetLoc()
    local real rads = 300.00
    call UnitDamagePointLoc( cast, 0, rads, targ, dam, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
    set cast = null
    set targ = null
endfunction
//===========================================================================
function InitTrig_BlinkStomp takes nothing returns nothing
    set gg_Trig_BlinkStomp = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(gg_Trig_BlinkStomp, EVENT_PLAYER_UNIT_SPELL_CAST)
    call TriggerAddCondition(gg_Trig_BlinkStomp, Condition( function Trig_BlinkStomp_Conditions)
    call TriggerAddAction( gg_Trig_BlinkStomp, function Trig_BlinkStomp_Actions )
endfunction
syntax error at line 18. missing ')'

EDIT : LOL fixed
line 15 : undeclared variable gg_Trig_BlinkStomp.
 
Status
Not open for further replies.
Top