• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Whats wrong in this spell? Cant save get an error

Status
Not open for further replies.
Level 19
Joined
Feb 15, 2008
Messages
2,184
JASS:
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BVCond takes nothing returns boolean
    return GetSpellAbilityId() == 'A07T'
endfunction

function BVCast takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit u2 = GetSpellTargetUnit()
    local real a = Atan2(GetUnitY(u2)-GetUnitY(u), GetUnitX(u2)-GetUnitX(u))
    local real x = GetUnitX(u) + ((GetUnitX(u2) - GetUnitX(u)) - (60*Cos(a)))
    local real y = GetUnitY(u) + ((GetUnitY(u2) - GetUnitY(u)) - (60*Sin(a)))
    call UnitDamageTarget(u, u2, GetUnitAbilityLevel(u,'A07T') * 100., false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
    call SetUnitX(u, x)
    call SetUnitY(u, y)
    call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl", u2, "chest"))
    set u = null
    set u2 = null
endfunction

//===========================================================================
function InitTrig_Hyperblade_JASS takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition( function BVCond))
    call TriggerAddAction(t, function BVCast)
    set t = null
endfunction
 
Level 19
Joined
Feb 15, 2008
Messages
2,184
I have 2 same spells but here.

function BVCast takes nothing returns nothing

something with variables.

NEW SPELL STILL DOESENT WORK!

JASS:
//TESH.scrollpos=0
//TESH.alwaysfold=0
function BVCond takes nothing returns boolean
    return GetSpellAbilityId() == 'A07T'
endfunction

function BVCast takes nothing returns nothing
    local unit uu = GetTriggerUnit()
    local unit u3 = GetSpellTargetUnit()
    local real a1 = Atan2(GetUnitY(u3)-GetUnitY(uu), GetUnitX(u3)-GetUnitX(uu))
    local real x1 = GetUnitX(uu) + ((GetUnitX(u3) - GetUnitX(uu)) - (60*Cos(a1)))
    local real y1 = GetUnitY(uu) + ((GetUnitY(u3) - GetUnitY(uu)) - (60*Sin(a1)))
    call UnitDamageTarget(uu, u3, GetUnitAbilityLevel(uu,'A07T') * 100., false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
    call SetUnitX(uu, x1)
    call SetUnitY(uu, y1)
    call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl", u3, "chest"))
    set uu = null
    set u3 = null
endfunction

//===========================================================================
function InitTrig_Hyperblade_JASS takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition( function BVCond))
    call TriggerAddAction(t, function BVCast)
    set t = null
endfunction
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Simple: Save the map and error show up. Make a screen from this error, so we finally know exactly the error and the line.
Else as both other dudes already said, there is no error, so the next question would be
what Editor you use (JNGP?) and which version of JassHelper (0.A.2.B?)? If not update them and see what happen.

Greetings and Peace
Dr. Boom
 
Status
Not open for further replies.
Top