• 🏆 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] Compile Error

Status
Not open for further replies.
Level 6
Joined
Mar 27, 2009
Messages
195
hey everyone

WE said it got about 80 compile error caused by my first jass script ever done. is it just a WE bug (whole map got about 460^^) or is it my fault?

JASS:
//===================== Spell Condition ===============================
function SpellCondition takes nothing returns boolean
    return GetSpellAbilityId()=='A001'
endfunction

//===================== Data Initialization ===============================
function Effect1 takes nothing returns string
    return "Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl"
endfunction

function Effect2 takes nothing returns string
    return "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl"
endfunction

function Wait1 takes nothing returns real
    return 0.10
endfunction

function Wait2 takes nothing returns real
    return 0.70
endfunction

function Radius takes nothing returns real
    return 400.00
endfunction

function Damage takes nothing returns real
    return 1000.00
endfunction

//===================== Spell Filter ===============================
function TargetCheck takes nothing returns boolean
    local unit u = GetFilterUnit()
    local boolean b = not(IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) or IsUnitType(u,UNIT_TYPE_STRUCTURE))
    set u = null
    return b
endfunction

//===================== Spell Action ===============================
function Illuminaten_Actions takes nothing returns nothing
    local unit caster = GetTriggerUnit()
    local location target = GetUnitLoc(caster)
    local real x = GetLocationX(target)
    local real y = GetLocationY(target)
    local group g = CreateGroup()
    local unit u

    call DestroyEffect(AddSpecialEffect(Effect1(), x, y))
    call PolledWait(Wait1())
    call DestroyEffect(AddSpecialEffect(Effect1(), x, y))
    call PolledWait(Wait1())
    call DestroyEffect(AddSpecialEffect(Effect1(), x, y))
    call PolledWait(Wait1())
    call DestroyEffect(AddSpecialEffect(Effect1(), x, y))
    call PolledWait(Wait1())
    call DestroyEffect(AddSpecialEffect(Effect1(), x, y))
    call PolledWait(Wait1())
    call DestroyEffect(AddSpecialEffect(Effect1(), x, y))
    call PolledWait(Wait1())
    call DestroyEffect(AddSpecialEffect(Effect1(), x, y))
    call PolledWait(Wait1())
    call DestroyEffect(AddSpecialEffect(Effect1(), x, y))
    call PolledWait(Wait1())
    call DestroyEffect(AddSpecialEffect(Effect1(), x, y))
    call PolledWait(Wait1())
    call DestroyEffect(AddSpecialEffect(Effect1(), x, y))
    call PolledWait(Wait2())
    call DestroyEffect(AddSpecialEffect(Effect2(), x, y))    

    call GroupEnumUnitsInRange(g, x, y, Radius(), Filter(function TargetCheck))

// Issue Unit to deal Damage
loop
        set u = FirstOfGroup(g)
exitwhen u == null
        call GroupRemoveUnit(g, u)
        call UnitDamageTarget(caster, u, Damage(), true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNKNOWN, WEAPON_TYPE_WHOKNOWS)
endloop

// Destroy the Group
call DestroyGroup(g)
    set u = null
    set g = null
endfunction

//===================== Event Setup ===============================
function ReturnTrue takes nothing returns boolean
    return true
endfunction

function InitTrig_Illuminaten takes nothing returns nothing
    set gg_trg_Illuminaten = CreateTrigger( )
    call TriggerRegisterPlayerUnitEvent( gg_trg_Illuminaten, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT, Condition (function ReturnTrue))
    call TriggerRegisterPlayerUnitEvent( gg_trg_Illuminaten, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT, Condition (function ReturnTrue))
    call TriggerRegisterPlayerUnitEvent( gg_trg_Illuminaten, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT, Condition (function ReturnTrue))
    call TriggerRegisterPlayerUnitEvent( gg_trg_Illuminaten, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT, Condition (function ReturnTrue))
    call TriggerRegisterPlayerUnitEvent( gg_trg_Illuminaten, Player(4), EVENT_PLAYER_UNIT_SPELL_EFFECT, Condition (function ReturnTrue))
    call TriggerRegisterPlayerUnitEvent( gg_trg_Illuminaten, Player(5), EVENT_PLAYER_UNIT_SPELL_EFFECT, Condition (function ReturnTrue))
    call TriggerRegisterPlayerUnitEvent( gg_trg_Illuminaten, Player(6), EVENT_PLAYER_UNIT_SPELL_EFFECT, Condition (function ReturnTrue))
    call TriggerRegisterPlayerUnitEvent( gg_trg_Illuminaten, Player(7), EVENT_PLAYER_UNIT_SPELL_EFFECT, Condition (function ReturnTrue))
    call TriggerRegisterPlayerUnitEvent( gg_trg_Illuminaten, Player(8), EVENT_PLAYER_UNIT_SPELL_EFFECT, Condition (function ReturnTrue))
    call TriggerRegisterPlayerUnitEvent( gg_trg_Illuminaten, Player(9), EVENT_PLAYER_UNIT_SPELL_EFFECT, Condition (function ReturnTrue))
    call TriggerAddCondition( gg_trg_Illuminaten, Condition( function SpellCondition ) )
    call TriggerAddAction( gg_trg_Illuminaten, function Illuminaten_Actions )
endfunction
 
Level 12
Joined
Jul 27, 2008
Messages
1,181
1) Get Jasscraft
2) Nix that, just checked and it's bug free. Maybe a missing .j file?
3)
JASS:
function Wait1 takes nothing returns real
    return 0.10
endfunction
There are no waits under 0.27, so this is consdered 0.27.
4) Don't use functions for all the stuff, use locals instead.
5)
JASS:
local location target = GetUnitLoc(caster)
leaks. Add this to the end of the function:
JASS:
call RemoveLocation(target)
 
Level 6
Joined
Mar 27, 2009
Messages
195
1) Get Jasscraft
2) Nix that, just checked and it's bug free. Maybe a missing .j file?
3)
JASS:
function Wait1 takes nothing returns real
    return 0.10
endfunction
There are no waits under 0.27, so this is consdered 0.27.
4) Don't use functions for all the stuff, use locals instead.
5)
JASS:
local location target = GetUnitLoc(caster)
leaks. Add this to the end of the function:
JASS:
call RemoveLocation(target)

ok thanks i think its just a bug or, as you said, a missing .j file. and i remember the editor crashed 2 or more times when i tryed to activate the trigger. thx @ all though.
 
Level 6
Joined
Mar 27, 2009
Messages
195
of course you can open it with both ones (the german and the english editor). but its a great project i started to create about 8 months ago (still unfinished). i will try to open it with another pc and if it won't work i will post the map here.

EDIT2: ok i was too busy to test this map on another computer, so i just uploaded it. pls test it and give me a feedback concerning these (few^^) errors. thx

EDIT3: finally i got it. the 460 errors were caused by some functions of my script; i just had to rename 'em cause another script used the same function names. thx @ all though.
 
Last edited:
Status
Not open for further replies.
Top