|
楼主 |
发表于 2008-3-10 19:12:03
|
显示全部楼层
谢谢。那么是不是下面的代码有问题?
[jass]
function Trig_Change_Actions takes nothing returns nothing
local integer I
local integer J
set I = 1
set J = 1
loop
exitwhen I> 20
if ( RectContainsUnit(udg_Location[I], GetTriggerUnit()) == true ) then
loop
exitwhen J>5
if ( GetOwningPlayer(GetTriggerUnit()) == Player(J-1) ) then
if ( Conditions(J-1,I)) then
call RemoveUnit( GetTriggerUnit() )
call CreateNUnitsAtLoc( 1, String2UnitIdBJ(udg_Hero_name[I]), Player(J-1), GetRectCenter(gg_rct_Location021), bj_UNIT_FACING )
call PanCameraToTimedLocForPlayer( Player(J-1), GetRectCenter(gg_rct_Location021), 0.50 )
else
call Directions(Player(J-1),I)
endif
endif
set J = J + 1
endloop
endif
set I = I + 1
endloop
endfunction
[/jass]
其中Conditions()和Directions()都是自定义函数,udg_Hero_name[]和udg_Location数组已经定义。 |
|