找回密码
 点一下
查看: 1627|回复: 1

我快郁闷死了,求大大帮忙timer的问题

[复制链接]
发表于 2012-3-5 21:59:28 | 显示全部楼层 |阅读模式
在下jass初学,正在试着做几个技能耍耍,不料突然timer这东西没反应了。。。纠结了一晚上

globals
integer n_FL=0
real n2_FL=0
real n3_FL=0
timer time1=CreateTimer()
endglobals

function FL_Action3 takes nothing returns nothing   (没法执行)
    local unit s=GetTriggerUnit()
    if n_FL <= n2_FL/50 then
    call SetUnitX(s, GetUnitX(s)+ 50*Sin(n3_FL))
    call SetUnitY(s, GetUnitY(s)+ 50*Cos(n3_FL))
    call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\IllidanBlueMissile.mdx",s,"weapon"))
    set n_FL= n_FL+1
    set s=null
    else
    set n_FL=0
    call PauseTimer(time1)
    call SetUnitAnimation(s,"Stand Ready (1.000 s)")
    call PauseUnit(s,false)
    call SetUnitPathing(s,false)
    set s=null
    endif
    endfunction

function FL_Action takes nothing returns nothing
    local unit s=GetTriggerUnit()
    local location p=GetUnitLoc(s)
    local location p2=GetSpellTargetLoc()
    call SetUnitPathing(s,false)
    call CreateNUnitsAtLoc( 1,'hbew', GetOwningPlayer(s),p, bj_UNIT_FACING )
    call SetUnitFacingToFaceLocTimed(GetLastCreatedUnit(),p,0)
    call UnitApplyTimedLife(GetLastCreatedUnit(),'BHwe',2)
    call ShowUnit( GetLastCreatedUnit(), false )
    call SetUnitPathing(GetLastCreatedUnit(),false)
    call IssueNeutralTargetOrderById( GetOwningPlayer(s), GetLastCreatedUnit(), 852274,s )
    call ShowUnit(s,false)
    set n2_FL=DistanceBetweenPoints(p,p2)
    set n3_FL=AngleBetweenPoints(p,p2)
    call TriggerSleepAction(3)
    call TimerStart(time1,0.05,true,function FL_Action3)   (我已经打了没错啊)
    call ShowUnit(s,true)
    call PauseUnit(s,true)
    call SetUnitAnimationWithRarity( s, "attack", RARITY_RARE )
    call RemoveLocation(p)
    call RemoveLocation(p2)
    set p=null
    set p2=null
    set s=null
    endfunction
   
function FL_Condition takes nothing returns boolean
  return GetSpellAbilityId()=='A00E'
  endfunction

function InitTrig_FL_______u takes nothing returns nothing
  local trigger t= CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition(function FL_Condition))
    call TriggerAddAction(t,function FL_Action)
    set t= null
    endfunction


如上,语法检查没有问题,技能已经是次要的了,关键是我想让timerstart给我动起来啊啊啊。。。
请教各位大大 小弟哪里犯错了呢 还是系统问题 我用的YDWE1.21修正版
再次求教
发表于 2013-5-12 17:01:32 | 显示全部楼层
路过 帮你看看

你的那个  FL_Action3   这个函数   第一个动作 就错了  触发单位  是不存在了的  于是乎 你就悲剧了
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-19 23:31 , Processed in 0.203227 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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