找回密码
 点一下
查看: 1094|回复: 10

这个刷兵系统为何不工作

[复制链接]
发表于 2010-10-3 16:56:34 | 显示全部楼层 |阅读模式
function sbing takes player id,integer uid,integer bn,rect bd,rect aim returns nothing
    //player ,UnitID,number of soldier,region for create,region for attack
    local location bdp
    local integer bnk=1
    local group bdg
    local unit at
    loop
        exitwhen (bnk > bn)
        set bdp=GetRectCenter(bd)
        set at=CreateUnitAtLoc(id,uid,bdp,0)
        call GroupAddUnit( bdg, at )
        call RemoveLocation(bdp)
        set bnk=bnk+1
    endloop
    call RemoveLocation(bdp)
    set bdp=GetRectCenter(aim)
    call GroupPointOrderLoc( bdg, "AImove", bdp )
    call RemoveLocation(bdp)
    call DestroyGroup(bdg)
    return
endfunction
发表于 2010-10-3 17:01:58 | 显示全部楼层
local group bdg = CreateGroup()
回复

使用道具 举报

发表于 2010-10-3 17:30:20 | 显示全部楼层
GroupPointOrderLoc最多只能对12个单位发布命令
回复

使用道具 举报

发表于 2010-10-3 17:32:47 | 显示全部楼层
突然想不起来楼上是谁家的马甲了
回复

使用道具 举报

发表于 2010-10-3 18:00:21 | 显示全部楼层
[jass]
function sbing takes player id,integer uid,integer bn,rect bd,rect aim returns nothing
    //player ,UnitID,number of soldier,region for create,region for attack
    local location bdp
    local integer bnk=1
    local group bdg=CreateGroup()
    local unit at
    set bdp=GetRectCenter(bd)
    loop
        exitwhen (bnk > bn)
        set at=CreateUnitAtLoc(id,uid,bdp,0)
        call GroupAddUnit( bdg, at )
        set bnk=bnk+1
    endloop
        call RemoveLocation(bdp)
        set bdp=GetRectCenter(aim)
         loop                                                                                
          set at = FirstOfGroup(bdg)
          exitwhen at == null
          call IssuePointOrderLoc( at, "attack", bdp )  
          call GroupRemoveUnit( bdg, at )
         endloop
    //call GroupPointOrderLoc( bdg, "AImove", bdp )
    call RemoveLocation(bdp)
    call DestroyGroup(bdg)
    set bdp=null
    set bdg=null
    set at=null
    return
endfunction
[/jass]

xo.w3x

20 KB, 下载次数: 12

回复

使用道具 举报

发表于 2010-10-3 18:09:55 | 显示全部楼层
记得GroupPointOrderLoc有个很不错的优点来的... 不过忘了是什么了...
回复

使用道具 举报

发表于 2010-10-3 18:32:15 | 显示全部楼层
内可能是队列整齐吧……
回复

使用道具 举报

 楼主| 发表于 2010-10-3 18:34:56 | 显示全部楼层
灰藏好,JASS真实罗嗦,都LOCAL GROUP还要CREATEGROUP。。。。
回复

使用道具 举报

发表于 2010-10-3 18:38:27 | 显示全部楼层
一个是变量,一个是实体的对象...
回复

使用道具 举报

发表于 2010-10-3 20:35:01 | 显示全部楼层
引用第7楼wfr_tc于2010-10-03 18:34发表的 :
灰藏好,JASS真实罗嗦,都LOCAL GROUP还要CREATEGROUP。。。。


....java真是啰嗦

都private ABC a还要 new ABC()...........

LZ就靠你啦 等到什么时候不“啰嗦”了 就是第五代傻瓜语言了诞生的时候了
回复

使用道具 举报

发表于 2010-10-3 20:38:35 | 显示全部楼层
C真是啰嗦……
都结构指针还要malloc……(额,这是队形么)

其实不都一样,除了基本类型,都是需要实例化的,不管在什么语言
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-21 13:38 , Processed in 0.196465 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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