HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

I'm back with another (maybe stupid) problem.

07-23-2005, 05:50 AM#1
Guest
Hey Vex everything has been working out lateley for me. But I just ran into a problem when I was trying to copy the "Call In Reinforcements" from the Zepplin spell pack. Anyways I am pretty experienced with copying your spells and stuff now. But now I finally got one complire error when I tried to save when I was done. I can't seem to figure it out. I can tell you the compile error, maybe you might know what's causeing it wand what I should check/ edit/ fix.
Anyways it says

Line 3502: expected a function name
-------------------------------------------------------------------------

call RunSeparated(function Reinforcements_Summon) <---(Highlighted :) )



JUST incase you need the trigger that I'm using here it is. I changed everything to match the rawcodes and so on correctley. I checked that already.



//**********************************************************************************************
//*
//* Reinforcements
//* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//* Requires:
//* - The Caster System 9.5 or greater
//* ( http://www.wc3campaigns.com/forumdisplay.php?f=534 )
//* - The Reinforcements Ability
//* - This Trigger (make sure it points to the right ability rawcodes in your map)
//* Notes:
//* - The Ability's 1st special art field determines the Zeppeling's model
//* - The Ability's 2nd special art field determines the Zeppeling's Height
//* - The Ability's 3rd special art field determines the Zeppeling's scale
//* - The Ability's missile art determines the falling missile effects.
//* - The Ability's target art determines the unit spawn effect.
//*
//**********************************************************************************************

//==============================================================================================
// Reinforcements spell configuration
//
constant function Reinforcements_SpellId takes nothing returns integer
return 'A07V' // Rawcode of the Reinforcements ability
endfunction

function Reinforcements_Unit takes integer level returns integer
if GetRandomInt(0,1)==0 then
return 'h02g' // One of the units to spawn's rawcode
endif
return 'n01q' // The other unit to spawn's rawcode
endfunction

constant function Reinforcements_Duration takes real level returns real
return 20+5*level // Spawned unit duration formula
endfunction

constant function Reinforcements_UnitCount takes integer level returns integer
return 4 // Total number of spawned units.
endfunction

//==============================================================================================
function Trig_Reinforcements_Conditions takes nothing returns boolean
return GetSpellAbilityId() == Reinforcements_SpellId()
endfunction

function Reinforcements_Summon takes nothing returns nothing
local player p=GetOwningPlayer(GetTriggerUnit())
local integer s=bj_forLoopAIndex
local integer l=bj_forLoopBIndex
local real x=GetLocationX(bj_enumDestructableCenter)
local real y=GetLocationY(bj_enumDestructableCenter)
local unit su
call ProjectileLaunchExLoc(p,GetAbilityEffectById(s,EFFECT_TYPE_MISSILE,0),1,255,255,255,255,522,0,udg_so urcehack, udg_castervars[777],bj_enumDestructableCenter,0)
set su=CreateUnit(p,Reinforcements_Unit(l),x,y,0)
call SetUnitAnimation(su,"birth")
call AddSpellEffectTargetById(s,EFFECT_TYPE_TARGET,su,GetAbilityEffectById(s,EFFECT_TYPE_TARGET,1))
call UnitApplyTimedLife(su,'BFig',Reinforcements_Duration(l))
set su=null
set p=null
endfunction

function Trig_Reinforcements_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local unit t
local integer s=GetSpellAbilityId()
local integer l=GetUnitAbilityLevel(u,s)
local location loc=GetSpellTargetLoc()
local real v
local real x=GetLocationX(loc)
local real y=GetLocationY(loc)
local unit b=AddCasterFacing(0)
local rect r=bj_mapInitialPlayableArea
local effect fx
local integer c=Reinforcements_UnitCount(l)
local boolean bol=false

call SetUnitPosition(b,RMinBJ(x,GetRectMinX(r)),y)
call SetUnitFlyHeight(b,S2R(GetAbilityEffectById(s,EFFECT_TYPE_SPECIAL,1)),0)
set fx= AddSpellEffectTargetById(s,EFFECT_TYPE_SPECIAL,b,"origin")
call SetUnitOwner(b,GetOwningPlayer(u),true)
set v=S2R(GetAbilityEffectById(s,EFFECT_TYPE_SPECIAL,2))
call SetUnitScale(b,v,v,v)
set v=GetRectMaxX(r)
call IssuePointOrder(b,"move",v,y)
loop
exitwhen GetUnitCurrentOrder(b)!=OrderId("move")
if (c>0) and (bol or ((GetUnitX(b) <= x+SpecialDelivery_Area(l)-400) and (GetUnitX(b) >= x-SpecialDelivery_Area(l)-400))) then
set c=c-1
set bol=true
set udg_sourcehack=GetUnitLoc(b)
set bj_enumDestructableCenter=Location(GetUnitX(b)+400,y)
set bj_forLoopAIndex=s
set bj_forLoopBIndex=l
set udg_castervars[777]=GetUnitFlyHeight(b)
call RunSeparated(function Reinforcements_Summon)
call RemoveLocation(udg_sourcehack)
call RemoveLocation(bj_enumDestructableCenter)
set udg_sourcehack=null
set bj_enumDestructableCenter=null
endif
call TriggerSleepAction(0)
endloop
call RemoveUnit(b)
call DestroyEffect(fx)
set u=null
set t=null
set r=null
set b=null
set fx=null
call RemoveLocation(loc)
set loc=null
endfunction

//===========================================================================
function InitTrig_Reinforcements takes nothing returns nothing
set gg_trg_Reinforcements = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reinforcements, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Reinforcements, Condition( function Trig_Reinforcements_Conditions ) )
call TriggerAddAction( gg_trg_Reinforcements, function Trig_Reinforcements_Actions )
endfunction



Oooo yea and one last thing. I made this a Hero Ability with 6 levels. I'm sure I converted it right anyway. Maybe it has to be and Item Ability? meh.
07-23-2005, 05:13 PM#2
Vexorian
That's an old and death version of reinforcements, I updated that spell with some others I think you should be able to find it at the spellbook, "Spell map VI?" or something like that
07-23-2005, 07:00 PM#3
Guest
Quote:
Originally Posted by Lord Vexorian
That's an old and death version of reinforcements, I updated that spell with some others I think you should be able to find it at the spellbook, "Spell map VI?" or something like that

Ok I don't get the error anymore but now I got another problem. I made all 3 zepplin skills a Hero skill and gav ethem all to one hero. Now whenever I cast one of the skilsl it mistakenley casts anotehr one instead. :S is there anyway I can fix this>?