找回密码
 点一下
查看: 1612|回复: 2

GroupEnumUnitsInRange如何使用

[复制链接]
发表于 2009-1-11 18:03:06 | 显示全部楼层 |阅读模式
太难了,太难了。。。

学JASS学到现在,就是这个单位组最头疼了

没有一点儿头绪

尤其是要局部变量的时候
发表于 2009-1-11 18:40:29 | 显示全部楼层
native GroupEnumUnitsInRange takes group whichGroup,real x,real y,real radius,boolexpr filter returns nothing
例子:
function FilterFunc takes nothing returns nothing
      return IsUnitEnemy(GetFilterUnit(),Player(0))
endfunction
function TestFunc takes unit u nothing returns nothing
      local group g = CreateGroup()  
      call GroupEnumUnitsInRange(g,GetUnitX(u),GetUnitX(u),1000,function FilterFunc)
      call DestroyGroup(g)
      set g = null
endfunction
回复

使用道具 举报

发表于 2009-1-11 19:35:47 | 显示全部楼层
[jass]function AEfk_C takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit uz = GetFilterUnit()
    local unit ua
    if IsUnitEnemy(uz,GetOwningPlayer(u)) then
        set ua = CreateUnit(GetOwningPlayer(u),'n00E',GetUnitX(u),GetUnitY(u),0.00)
        call UnitApplyTimedLife(ua,'BHwe',1)
        call ShowUnit(ua,false)
        call IssueTargetOrderById(ua,852230,uz)
    endif
    set u = null
    set uz = null
    set ua = null
endfunction

function AEfk_B takes nothing returns nothing
    local unit u = GetTriggerUnit()
    call GroupEnumUnitsInRange(udg_TempGroup,GetUnitX(u),GetUnitY(u),700,Condition(function AEfk_C))
    set u = null
endfunction[/jass]
http://www.islga.org/bbs/read.php?tid=13256
辅助单位的移动不要为0.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-21 14:32 , Processed in 0.065894 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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