|
发表于 2006-4-15 18:29:26
|
显示全部楼层
那么这么说吧,
[jass]loop
exitwhen i>max
call DisplayTimedTextToPlayer(Player(0),0,0,30,\"循环次数\"+I2S(i))
set i=i+1
endloop[/jass]
将其中的 call DisplayTimedTextToPlayer换成别的一行什么,如set x=0,最后结果i会一样吗?
ps:顺便作了一下Trigger Sleep在循环中能容许的最小值,发现它是波动的比较奇怪..而且用来量度时间单位的timer又和游戏速度挂钩的.
[jass]local integer i=1
local integer max =S2I(SubString(GetEventPlayerChatString(),8,16))
local timer count_t=CreateTimer()
call DisplayTimedTextToPlayer(Player(0),0,0,10,\"计时开始!\")
call TimerStart(count_t,240,false,null)
loop
exitwhen i>max
call TriggerSleepAction(0)
set i=i+1
endloop
call DisplayTimedTextToPlayer(Player(0),0,0,10,\"循环次数\"+I2S(i))
call DisplayTimedTextToPlayer(Player(0),0,0,60,\"总计停止时间\"+R2S(TimerGetElapsed(count_t)))
//call BJDebugMsg(\"循环次数\"+I2S(i))
set udg_count=0
call TriggerSleepAction(1)
call DestroyTimer(count_t)
set count_t=null[/jass]
总的说来,在\"快\"的速度下0.20-0.21\"游戏秒\";\"慢\"时0.12左右.在处理数据增加时还呈下降趋势.嗯
[ 本帖最后由 kook 于 2006-4-15 18:45 编辑 ] |
|