• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Symbol multiply defined?

Status
Not open for further replies.
Level 4
Joined
Jun 7, 2008
Messages
37
What does it mean? I keep getting an error whenever I save my map.
Here are my triggers where I use globals:

JASS:
globals
group udg_Targets
endglobals

function Trig_Mark_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A00I'
endfunction

function Trig_Mark_Actions takes nothing returns nothing
local unit r
local unit c = GetTriggerUnit()
local unit t = GetSpellTargetUnit()
local integer targetamount
local integer amount = 3*GetUnitAbilityLevel(c, 'A00I')
call GroupAddUnit(udg_Targets, t)
set targetamount = CountUnitsInGroup(udg_Targets)
if targetamount > amount then
set r = FirstOfGroup(udg_Targets)
call GroupRemoveUnit(udg_Targets, r)
call UnitRemoveBuffs(r, true, true)
endif
set r = null
set c = null
set t = null
endfunction

//===========================================================================
function InitTrig_Mark takes nothing returns nothing
    set gg_trg_Mark = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Mark, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Mark, Condition( function Trig_Mark_Conditions ) )
    call TriggerAddAction( gg_trg_Mark, function Trig_Mark_Actions )
endfunction

JASS:
globals
group udg_Targets
endglobals

function Trig_Throw_Knives_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A00J'
endfunction

function Trig_Throw_Knives_Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local location l = GetUnitLoc(c)
local real level = 30*GetUnitAbilityLevel(c, 'A00J')
local unit t 
local unit r
local real damage = 60*level
local integer loops = CountUnitsInGroup(udg_Targets)
    loop
        set t = FirstOfGroup(udg_Targets)
        call CreateUnitAtLoc(GetOwningPlayer(c), 'o00A', l, 0.)
        set r = GetLastCreatedUnit()
        call IssueTargetOrder(r, "attackonce", t)
        call UnitDamageTarget(c, t, damage, true, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_DIVINE, WEAPON_TYPE_METAL_LIGHT_SLICE)
        call UnitApplyTimedLife(r, 'B003', 4.)
        set loops = loops - 1
        exitwhen loops == 0
    endloop
endfunction

//===========================================================================
function InitTrig_Throw_Knives takes nothing returns nothing
    set gg_trg_Throw_Knives = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Throw_Knives, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Mark, Condition( function Trig_Throw_Knives_Conditions ) )
    call TriggerAddAction( gg_trg_Throw_Knives, function Trig_Throw_Knives_Actions )
endfunction
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
Hm, normally this error message shows up, when you got 2 variables with the same name and the same kind (local,global), so maybe you could just deactivate one trigger, and see if the error message shows up again, then deactivate the next one until it doesnt anymore...

Is this:
JASS:
globals
group udg_Targets
endglobals
in both triggers or just to show us, which are the globals?
 
Level 4
Joined
Jun 7, 2008
Messages
37
I thought that you had to declare globals at the beginning of a trigger? Although, I tried removing the globals from the trigger, and it seems to work, I'm not getting any errors.

Edit: I just tried the trigger ingame, and it created thousands of dummy units :/ I'm 99% sure it's related to the global unit group, but I have no idea of how to fix it...
 
Status
Not open for further replies.
Top