|
没有什么方向性,纯粹是测试而已~
不保证我的测试过程中有什么其他变量没有控制……
事先说明一下,我这是在最低配置窗口模式下测试的,可能会影响到我的结论。
以下触发大约看一下就行。
[trigger]
Test1
Events
Game - Player Any Player types a chat message containing "test", matching Partially
Local Variables
Conditions
Actions
Debug - Display (Text((Game play time for player 1)) with Any Precision decimal places) as debug output using Type 1, and Do display it in the game window
Timer - Start TheTimer as a One Shot timer that will expire in 0.0 Game Time seconds
[/trigger]
[trigger]
Test2
Events
Game - Player Any Player types a chat message containing "test", matching Partially
Local Variables
Conditions
Actions
Debug - Display (Text((Game play time for player 1)) with Any Precision decimal places) as debug output using Type 1, and Do display it in the game window
General - Wait 0.0 Game Time seconds
Debug - Display ("Wait" + (Text((Game play time for player 1)) with Any Precision decimal places)) as debug output using Type 1, and Do display it in the game window
[/trigger]
[trigger]
Timer
Events
Timer - TheTimer expires
Local Variables
Conditions
Actions
Debug - Display ("Timer" + (Text((Game play time for player 1)) with Any Precision decimal places)) as debug output using Type 1, and Do display it in the game window
[/trigger]
结果显示貌似Wait0.0之后打印的游戏时间和Wait之前打印的一样,而Timer打印则会比Wait慢0.06s左右。
其中一组数据
186.938
186.938
Wait186.938
Timer187
而如果把时间0.0换成0.0001和1.0时,Timer比Wait还是慢约0.06s。
于是把Wait换成
General - Wait for TheTimer to have 0.0 seconds Remaining
发现此时Wait打印的时间和Timer相同。
打印一下Timer的ElapsedTime,与设置的倒计时时间分秒不差。
再换一种测试方式,Timer循环3次,间隔1s,打印时间。
TimerStart之前打印的和Timer第一次循环结束打印的时间差了1.0625s……
但是之后循环结束打印的时间和之前的时间都间隔1s。
于是猜测影响timer计时不准确的原因在于TimerStart那一部分。
在TimerStart之后加了Wait0.0625s并打印Timer的ElapsedTime的动作,打印的时候显示ElapsedTimer为0……
[trigger]
Test1
Events
Game - Player Any Player types a chat message containing "test", matching Partially
Local Variables
Conditions
Actions
Debug - Display (Text((Game play time for player 1)) with Any Precision decimal places) as debug output using Type 1, and Do display it in the game window
Variable - Set Count = 0
Timer - Start TheTimer as a Repeating timer that will expire in 1.0 Game Time seconds
General - Wait 0.0624 Game Time seconds
General - Pick each integer from 1 to 3, and do (Actions)
Actions
General - Wait 0.0001 Game Time seconds
Debug - Display ("Wait" + (Text((Game play time for player 1)) with Any Precision decimal places)) as debug output using Type 1, and Do display it in the game window
Debug - Display ("Wait Timer" + (Text((Elapsed time of TheTimer)) with Any Precision decimal places)) as debug output using Type 1, and Do display it in the game window
[/trigger]
这回貌似ElapsedTime显示0;0.0625;0.0625。
而打印的GameTime第一次显示t,第二三次就显示t+0.0625……(后来把精度改为10000000输出了一次,数值没有变化)
难道Sc II的时间单位是0.0625s嘛?……还是说我输出时可能有问题?
16*0.0625=1.0s……
好吧…………只是很无聊的测试而已,配置比较好的同学可以把设置调高一点再测试~
————————————————————————————————————
感觉应该是输出或者是其他原因导致显示出来的时间有问题,要不然怎么还能Wait0.0001s呢…… |
|