找回密码
 点一下
查看: 1926|回复: 8

谁看看这段哪有问题?

[复制链接]
发表于 2009-5-7 21:44:33 | 显示全部楼层 |阅读模式
function SelectSecurityTeam takes nothing returns boolean
    return GetUnitTypeId(GetFilterUnit())=='z005'
endfunction

function EngineerAtSiteConditions takes nothing returns boolean
    return GetUnitTypeId(GetTriggerUnit())=='z003'
endfunction

function EngineerAtSite takes nothing returns nothing
    local location l = GetUnitLoc(GetTriggerUnit())
    local group g = AMGetUnitsInRange(600, l, Condition(function SelectSecurityTeam))
    local unit u = FirstOfGroup(g)
    call IssuePointOrder(u,"patrol",GetRectCenterX(gg_rct_Residence41),GetRectCenterY(gg_rct_Residence41))
    set udg_EngineersOnSite = udg_EngineersOnSite + 1
    call MBSet( udg_SquadStatus,1,1,"单位正在到来中 : " + I2S(udg_EngineersOnSite))
    call RemoveUnit(GetTriggerUnit())
    call StartSound(gg_snd_Loading)
    call DestroyGroup(g)
    call RemoveLocation(l)
    set l = null
    set g = null
    set u = null
endfunction

//===========================================================================
function InitTrig_Engineer_Arrives takes nothing returns nothing
    set gg_trg_Engineer_Arrives = CreateTrigger()
    call TriggerAddCondition( gg_trg_Engineer_Arrives, Condition( function EngineerAtSiteConditions ) )
    call TriggerAddAction(gg_trg_Engineer_Arrives,function EngineerAtSite)
endfunction

谁看看这段jass哪有错?
原本是刷单位后移动到指定地点
但是不起作用,单位只原地发呆
另外..求修改方法..
发表于 2009-5-7 22:43:39 | 显示全部楼层
好多函数不认识啊,虽然猜得出…………
你的事件是啥
回复

使用道具 举报

 楼主| 发表于 2009-5-8 06:24:36 | 显示全部楼层
事件其实说白了就是刷单位..
回复

使用道具 举报

发表于 2009-5-8 09:10:09 | 显示全部楼层
local group g = AMGetUnitsInRange(600, l, Condition(function SelectSecurityTeam))<---临时的Condition用完要摧毁
回复

使用道具 举报

发表于 2009-5-8 09:11:28 | 显示全部楼层
另外。。。你没注册事件。。。
回复

使用道具 举报

 楼主| 发表于 2009-5-8 09:48:37 | 显示全部楼层
引用第3楼eff于2009-05-08 09:10发表的  :
local group g = AMGetUnitsInRange(600, l, Condition(function SelectSecurityTeam))<---临时的Condition用完要摧毁

这个不只使用一次.
直到一定条件满足,否则会一直起作用.所以就没管了..
回复

使用道具 举报

发表于 2009-5-8 13:38:37 | 显示全部楼层
Condition(function SelectSecurityTeam)《---这个约等于每次执行创建一个单位然后丢掉不管他

没注册事件自然不会运行了。。
回复

使用道具 举报

 楼主| 发表于 2009-5-8 17:26:25 | 显示全部楼层
已解决,感谢LS~
回复

使用道具 举报

发表于 2009-5-8 17:31:44 | 显示全部楼层
………………我貌似一开始就问事件是啥,我还以为你是动态注册类,原来是根本没注册阿………………
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-6 02:20 , Processed in 0.057901 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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