找回密码
 点一下
查看: 804|回复: 6

又是我,又是简单的J问题请教

[复制链接]
发表于 2010-1-21 12:31:36 | 显示全部楼层 |阅读模式
我想用TimerStart()来实现等待,但是不理我,我是这样写的。
function Trig_jishu_Conditions takes nothing returns boolean
    if ( not ( udg_boolkanqiang[( GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit())) + 10 )] == 1 ) ) then
        return false
    endif
    if ( not ( GetSpellAbilityId() != 'A004' ) ) then
        return false
    endif
    return true
endfunction

function Trig_jishu_Func003C takes nothing returns boolean
    if ( not ( udg_boolkanqiang[( GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit())) + 10 )] == 1 ) ) then
        return false
    endif
    return true
endfunction

function justforwa takes nothing returns nothing
    if ( Trig_jishu_Func003C() == true) then
        call SetUnitTimeScalePercent( GetTriggerUnit(), 0.00 )
    else
        call DoNothing(  )
    endif
endfunction

function Trig_jishu_Actions takes nothing returns nothing
   local timer t = CreateTimer()
    call SetUnitTimeScalePercent( GetTriggerUnit(), 100 )
    call TimerStart(t,0.01,false,function justforwa)
    set t =null
endfunction

//===========================================================================
function InitTrig_jishu takes nothing returns nothing
    set gg_trg_jishu = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_jishu, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_jishu, Condition( function Trig_jishu_Conditions ) )
    call TriggerAddAction( gg_trg_jishu, function Trig_jishu_Actions )
endfunction
发表于 2010-1-21 14:41:34 | 显示全部楼层
第一你这不纯粹把触发器转成jass而已嘛?~~写的真是乱~~

另外什么叫不理你?~~你等待0.01秒的目的是什么?~~实际结果如何?~~怎么个不理你法?~~函数运行的条件是否满足了?~~

还有不要三连~~
回复

使用道具 举报

 楼主| 发表于 2010-1-21 14:49:00 | 显示全部楼层
老大我就是要把等待改称TimerStart()..
function justforwa takes nothing returns nothing
    if ( Trig_jishu_Func003C() == true) then
        call SetUnitTimeScalePercent( GetTriggerUnit(), 0.00 )
    else
        call DoNothing(  )
    endif
endfunction
这个是我要做的动作就是让动画速度变为0.。
老大别生气。。。
回复

使用道具 举报

发表于 2010-1-21 14:55:36 | 显示全部楼层
Trig_jishu_Func003C 的条件满足没有呢~~
回复

使用道具 举报

发表于 2010-1-21 15:05:47 | 显示全部楼层
其实你的问题很简单,GetTriggerUnit()没法获得触发单位。因为当你用timer来调用函数的时候,已经算是另起一个触发了。

你可以用数组或者hashtable来传递这个触发单位。
回复

使用道具 举报

 楼主| 发表于 2010-1-21 15:06:11 | 显示全部楼层
绝对满足了,难道不能用参数的传递?!貌似有人说过
回复

使用道具 举报

 楼主| 发表于 2010-1-21 15:10:16 | 显示全部楼层
谢谢!明白了这么傻得问题有劳老大!。。。GA的老大还真像老大,GA的小的也够像小的了。。开玩笑绝非往自家门里灌水
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-22 08:25 , Processed in 0.029739 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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