yeah just started jass today, and im going on a couple tutorials and the code that you get from using convert to custom script in WE :S
I tried to add a variable for spell being cast, and then order the caster to use the spell on a random; so heres what i did
bold parts are what i changed, and i get 3 errors:
line 43: type mismatch in assignment
line 46: invalid arguement type (integer)
line 49: expected a code statement (integer)
I tried to add a variable for spell being cast, and then order the caster to use the spell on a random; so heres what i did
Code:
function Trig_Spell_Transport_Func004C takes nothing returns boolean
if ( not ( GetSpellAbilityUnit() == udg_Spell_Transport_Target ) ) then
return false
endif
if ( not ( IsUnitEnemy(GetSpellTargetUnit(), GetOwningPlayer(GetSpellAbilityUnit())) == true ) ) then
return false
endif
return true
endfunction
function Trig_Spell_Transport_Conditions takes nothing returns boolean
if ( not Trig_Spell_Transport_Func004C() ) then
return false
endif
return true
endfunction
function Trig_Spell_Transport_Func002002001003 takes nothing returns boolean
return ( IsPlayerAlly(GetOwningPlayer(udg_Spell_Transport_Random), GetOwningPlayer(GetSpellAbilityUnit())) == true )
endfunction
function Trig_Spell_Transport_Actions takes nothing returns nothing
(43) [B]set udg_Spell_Transport_Casted = GetSpellAbility()[/B]
set udg_Spell_Transport_Target = GroupPickRandomUnit(GetUnitsInRangeOfLocAll(200.00, GetUnitLoc(GetSpellAbilityUnit())))
set udg_Spell_Transport_Target = GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(200.00, GetUnitLoc(GetSpellAbilityUnit()), Condition(function Trig_Spell_Transport_Func002002001003)))
(46) call IssueTargetOrderBJ( GetSpellAbilityUnit(), [B]udg_Spell_Transport_Casted[/B] , udg_Spell_Transport_Random )
endfunction
(49)//===========================================================================
function InitTrig_Spell_Transport takes nothing returns nothing
set gg_trg_Spell_Transport = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Spell_Transport, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Spell_Transport, Condition( function Trig_Spell_Transport_Conditions ) )
call TriggerAddAction( gg_trg_Spell_Transport, function Trig_Spell_Transport_Actions )
endfunction
bold parts are what i changed, and i get 3 errors:
line 43: type mismatch in assignment
line 46: invalid arguement type (integer)
line 49: expected a code statement (integer)