- Joined
- Jun 17, 2007
- Messages
- 1,433
I always seem to attain the error "Expected a name" by WE as a try to save my map .
Is the line with the error
Note: I know this hasn't been optimized in the least bit, I like to have all my triggers working before optimization.
JASS:
function Trig_Upgrade_Item_Func001Func003001 takes nothing returns boolean
return ( udg_ItemY > 10 )
endfunction
function Trig_Upgrade_Item_Func001C takes nothing returns boolean
return( GetItemTypeId(UnitItemInSlot(udg_UpgradeWeaponHero, 1))==udg_weapons[udg_ItemX])
endfunction
function Trig_Upgrade_Item_Actions takes nothing returns nothing
if ( Trig_Upgrade_Item_Func001C() ) then
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())), ( "|cffffff00You have upgraded your weapon to level " + ( I2S(udg_ItemY) + "|r" ) ) )
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl",GetUnitLoc(udg_UpgradeWeaponHero)))
call RemoveItem( UnitItemInSlotBJ(udg_UpgradeWeaponHero, 1) )
call UnitAddItemById( udg_UpgradeWeaponHero, udg_Items[(udg_ItemX + 1)] )
else
if ( Trig_Upgrade_Item_Func001Func003001() ) then
set udg_ItemY = 1
endif
set udg_ItemX = ( udg_ItemX + 1 )
set udg_ItemY = ( udg_ItemY + 1 )
call TriggerExecute( gg_trg_Upgrade_Item )
endif
endfunction
//===========================================================================
function InitTrig_Upgrade_Item takes nothing returns nothing
set gg_trg_Upgrade_Item = CreateTrigger( )
call TriggerAddAction( gg_trg_Upgrade_Item, function Trig_Upgrade_Item_Actions )
endfunction
JASS:
call UnitAddItemById( udg_UpgradeWeaponHero, udg_Items[(udg_ItemX + 1)] )
Note: I know this hasn't been optimized in the least bit, I like to have all my triggers working before optimization.