找回密码
 点一下
查看: 2874|回复: 11

PauseTimer()后面加上PolledWait()就什么都不运行了(已解决)

[复制链接]
发表于 2009-9-29 11:05:59 | 显示全部楼层 |阅读模式
[jass]
globals
  gamecache GC = null
  endglobals
 
function CacheValue takes nothing returns gamecache
  if GC == null then
  call FlushGameCache(InitGameCache("wow8"))
  set GC = InitGameCache("wow8")
  endif
  return GC
  endfunction
 
function H2I takes handle h returns integer
  return h
  return 0
  endfunction
 
function I2Tm takes integer i returns timer
  return i
  return null
  endfunction
 
function SetInt takes string s1 , string s2 , integer i returns nothing
  call StoreInteger(CacheValue(),s1,s2,i)
  endfunction
 
function GetInt takes string s1 , string s2 returns integer
  return GetStoredInteger(CacheValue(),s1,s2)
  endfunction





function a takes nothing returns nothing
  local integer t = H2I(GetExpiredTimer())
  local timer time = I2Tm(GetInt(I2S(t),"time"))
  call DisplayTextToPlayer(Player(0),0,0,"function")
  call PauseTimer(time)
  call PolledWait(0.01)
  call DisplayTextToPlayer(Player(0),0,0,"hello world")
  endfunction

function InitTrig_A takes nothing returns nothing
  local integer t = H2I(CreateTimer())
  call SetInt(I2S(t),"time",t)
  call TimerStart(I2Tm(t),5.00,true,function a)
  endfunction
[/jass]

我只是想问问为什么在 PauseTimer()后加上PolledWait()就不会再执行代码了...
除了PolledWait()还有哪些等待呢?

排泄什么什么的其他细节...都省略掉了....
 
  
发表于 2009-9-29 12:18:17 | 显示全部楼层
既然在计时器中干嘛还要用等待呢?
回复

使用道具 举报

发表于 2009-9-29 12:38:59 | 显示全部楼层
而且……
call SetInt(I2S(t),"time",t)
这个你想干啥呢?自己和自己关联………………
回复

使用道具 举报

发表于 2009-9-29 13:16:24 | 显示全部楼层
赞同LS。
为什么不直接用H2I(GetExpiredTimer())
话说一直不清楚PolledWait是哪个GUI的东西…………
应该就是等待吧。
既然会用timer为什么还用等待啊…………
回复

使用道具 举报

 楼主| 发表于 2009-9-29 13:41:20 | 显示全部楼层
因为 可能会在 中途 断开啊
回复

使用道具 举报

 楼主| 发表于 2009-9-29 13:42:29 | 显示全部楼层
如果满足了一定条件 让这个计时器 暂停一段时间- -所以 暂停后 等待- -
绑定- -没注意- -
回复

使用道具 举报

发表于 2009-9-29 13:52:30 | 显示全部楼层
这个要暂停的时候再创建一个计时器出来绑定吧……

你现在这样自己绑自己杀作用都米………………
回复

使用道具 举报

 楼主| 发表于 2009-9-29 14:18:11 | 显示全部楼层
那暂停 timer 5秒后再运行这个 timer应该怎么写呢...求指点
回复

使用道具 举报

发表于 2009-9-29 14:21:04 | 显示全部楼层
不是说了嘛……再创建一个计时器……然后将原来的计时器绑到新的计时器上去
回复

使用道具 举报

 楼主| 发表于 2009-9-29 15:06:05 | 显示全部楼层
通过创建新的timer解决了此问题- -
回复

使用道具 举报

发表于 2009-9-30 15:41:16 | 显示全部楼层
计时器里面不能等待
回复

使用道具 举报

发表于 2009-9-30 16:40:57 | 显示全部楼层
当时忘记了这点……
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-4 09:15 , Processed in 0.049879 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表