找回密码
 点一下
查看: 3254|回复: 20

Item Group~~感觉WE着实欠缺这方面的GUI啊~~

[复制链接]
发表于 2008-1-7 14:43:48 | 显示全部楼层 |阅读模式
像Unit Group方面的GUI触发就很齐全~~

Item Group就没有~~这样很不方便~~

如果谁没事写几个Item Group方面的函数放到强化we好了~~
发表于 2008-1-7 14:45:12 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2008-1-7 14:45:42 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| 发表于 2008-1-7 14:47:39 | 显示全部楼层
因为本就没这个东西~~所以才有这个帖子~~
回复

使用道具 举报

发表于 2008-1-7 14:57:00 | 显示全部楼层
好像是叫做物品池?ItemPool
回复

使用道具 举报

发表于 2008-1-7 15:00:21 | 显示全部楼层
pool和group还是不太一样的额………………
lz可以搞一个itemgroup的数据结构出来………………
回复

使用道具 举报

发表于 2008-1-7 15:01:20 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2008-1-7 15:03:35 | 显示全部楼层
为什么要是struct呢………………为什么不是union呢………………为什么不是class呢………………为什么不是interface呢………………
貌似越扯越远了………………
回复

使用道具 举报

 楼主| 发表于 2008-1-7 15:11:22 | 显示全部楼层
ItemPool集合的成员是物品类型~~而不是物品本身~~而且它功能比较单一~~是用于随机生成物品的~~
回复

使用道具 举报

发表于 2008-1-7 15:35:10 | 显示全部楼层
ItemGroup和UnitGroup没有什么本质上的区别吧?

都是Weight....仿佛
回复

使用道具 举报

发表于 2008-1-7 15:36:20 | 显示全部楼层
不过按照这么说。。。ItemPool可以用来生成随机特定整数?
回复

使用道具 举报

 楼主| 发表于 2008-1-7 15:42:11 | 显示全部楼层
可以阿~~而且还可以决定每个数出现的概率~~
回复

使用道具 举报

发表于 2008-1-7 15:44:18 | 显示全部楼层
不过我觉得ItemPool会延长地图的读取时间好像。。
回复

使用道具 举报

 楼主| 发表于 2008-1-7 17:10:49 | 显示全部楼层
[codes=jass]
function I2U takes item i returns unit
    return i
endfunction
[/codes]

Unit Group里可以直接沿用到Item Group的CJ函数有以下几个:
[codes=jass]
native CreateGroup                          takes nothing returns group
native DestroyGroup                         takes group whichGroup returns nothing
native GroupAddUnit                         takes group whichGroup, unit whichUnit returns nothing
native GroupRemoveUnit                      takes group whichGroup, unit whichUnit returns nothing
native GroupClear                           takes group whichGroup returns nothing
native ForGroup                 takes group whichGroup, code callback returns nothing
native FirstOfGroup             takes group whichGroup returns unit
[/codes]

其中GroupAddUnit和GroupRemoveUnit需要用I2U进行一次转换才能操作~~

而CJ中唯一一个对物品集合操作的函数是
[codes=jass]
native          EnumItemsInRect     takes rect r, boolexpr filter, code actionFunc returns nothing
[/codes]
回复

使用道具 举报

 楼主| 发表于 2008-1-7 17:26:28 | 显示全部楼层
像这样就会很方便:
[trigger]
Sample
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of (Item carried by (Triggering unit) of type 国王之冠 +5)) Greater than 1
            Then - Actions
                合成一下
            Else - Actions
[/trigger]

或是这样~~
[trigger]
Sample
    Events
    Conditions
    Actions
        Hero - Give (Random item from  (Items in (Playable map area) matching ((Current life of (Matching item)) Greater than or equal to 10.00))) to (Triggering unit)
[/trigger]
回复

使用道具 举报

发表于 2008-1-8 16:00:22 | 显示全部楼层
将item 组成group很厉害亚,不知道选取方法能不能用GroupEnumUnits 因为原来的物品选取只有 EnumItemsInRect一种
回复

使用道具 举报

发表于 2008-1-9 17:16:16 | 显示全部楼层
那个I2U的名字改改
It2U怎样?
回复

使用道具 举报

发表于 2008-1-9 18:06:55 | 显示全部楼层
说说想实现什么样的功能,之后考虑造一个出来.
回复

使用道具 举报

发表于 2008-1-9 19:20:18 | 显示全部楼层
- - IT2U有什么意义嘛。。。

Item需要用的函数有:

SetBundingUnitForItem(item itm,unit u,real MaxBoundingTime)

GetBoundingUnitOfItem(item itm)

SetItemUnDropableTimed(item itm,real time)

....
回复

使用道具 举报

 楼主| 发表于 2008-1-9 21:04:18 | 显示全部楼层
可是这就不是Item Group了~~

It2U当然有意义~~可以利用单位组的很多便利~~比方说随机抽取等等~~选取符合条件的元素等等~~

这是本帖子发出来的主题嘛~~
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-22 16:49 , Processed in 0.033951 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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