• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] why I cannot test this map?

Status
Not open for further replies.
Level 4
Joined
May 21, 2015
Messages
70
again I created a new simple JASS spell and voila ! I cannot test it again, It will just open warcraft then nothing just plainly open warcraft, anyway here's the spell >>>

JASS:
function Trig_Slash_Condition takes nothing returns boolean
    return GetSpellAbilityId = 'A000'

function Trig_Slash_Actions takes nothing returns nothing
    local unit caster = GetSpellAbilityUnit
    local unit target = GetSpellTargetUnit
       call UnitDamageTarget( caster, target, 100.0, true, false, ATTACK_TYPE_PIERCE, DAMAGE_TYPE_COLD, null )
    set caster = null
    set target = null
endfunction

//===========================================================================
function InitTrig_Slash takes nothing returns nothing
    set gg_trg_Slash = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Slash, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition( gg_trg_Slash, conditon(function Trig_Slash_Condition))
    call TriggerAddAction( gg_trg_Slash, function Trig_Slash_Actions )
endfunction
 
Level 4
Joined
May 21, 2015
Messages
70
is everything check except for the endfunction ???

edit: okay I know now whats the missing thing its the "()" damn,, well thank you for pointing that out Pyrogasm +rep
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,036
Oh actually there are lots of little things I didn't initially notice. This one is fixed and compiles on my computer:
JASS:
function Trig_Slash_Condition takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

function Trig_Slash_Actions takes nothing returns nothing
    local unit caster = GetSpellAbilityUnit()
    local unit target = GetSpellTargetUnit()
       call UnitDamageTarget( caster, target, 100.0, true, false, ATTACK_TYPE_PIERCE, DAMAGE_TYPE_COLD, null )
    set caster = null
    set target = null
endfunction

//===========================================================================
function InitTrig_Slash takes nothing returns nothing
    set gg_trg_Slash = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(gg_trg_Slash, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition( gg_trg_Slash, Condition(function Trig_Slash_Condition))
    call TriggerAddAction( gg_trg_Slash, function Trig_Slash_Actions )
endfunction
You were missing the () after GetSpellAbilityId, GetSpellAbilityUnit, GetSpellTargetUnit -- don't forget that even if they take no arguments you need the () when you call the function.

When you compare 2 objects, use == for equal and != for not equal. A single = is a variable declaration/setting to the JASS compiler.

You didn't capitalize Condition in Condition(function Trig_Slash_Condition)
 
Status
Not open for further replies.
Top