推荐地图:火影无级别混战推荐地图:楚汉争霸推荐地图:魔神推荐地图:人族无敌II
推荐专区:技能创作区推荐专区:WE讨论区推荐专区:模型作区推荐专区:申请公告区
 33 12
发新话题
打印

[教程] 背包切换与物品叠加演示

本主题由 茅山道士 于 2008-12-8 16:57 关闭
我现在出错的函数只能这样写了
COPY JASSCODE
JASS:

function GetBag takes unit u returns nothing
    local integer j=1
    local integer c
    loop
        exitwhen j>6
        if UnitItemInSlot(u,j-1)!=null then
            call RemoveItem(UnitItemInSlot(u,j-1))
        endif
        set c=GetItemId(u,GetBagIndex(u),j)
        if c!=0 then
            call UnitAddItemByIdSwapped(c,u)
            call SetItemCharges(GetLastCreatedItem(),GetItemCount(u,GetBagIndex(u),j))
        else
            call UnitAddItemByIdSwapped('stel',u)
            call SetItemUserData(GetLastCreatedItem(),-1)
        endif
        set j=j+1
    endloop
    set j=0
    loop
        exitwhen j>5
        if GetItemUserData(UnitItemInSlot(u,j))==-1 then
            call RemoveItem(UnitItemInSlot(u,j))
        endif
        set j=j+1
    endloop
endfunction

Shingo Jass Highlighter 0.4


就是用物品占据物品格再创建物品
等下试
我的帖子总索引

求工具以及下载属性领取贴

一切都是浮云``对``就是浮云``
还没检查好么?
因为还没试.
上课去...

ps:最近老游戏```
我的帖子总索引

求工具以及下载属性领取贴

一切都是浮云``对``就是浮云``
最近整个人都愚昧了...
最近要疯了
本帖最近评分记录
  • linzefei 智力 +1 29楼 2008-11-4 13:40

TOP

你那个思路好诡异``
我的帖子总索引

求工具以及下载属性领取贴

一切都是浮云``对``就是浮云``

TOP

好诡异``
COPY JASSCODE
JASS:
function GetBag takes unit u returns nothing 
    local integer j=1 
    local integer c 
    loop 
        exitwhen j>6 
        if UnitItemInSlot(u,j-1)!=null then 
            call RemoveItem(UnitItemInSlot(u,j-1)) 
        endif 
        set c=GetItemId(u,GetBagIndex(u),j) 
        if c!=0 then 
call TriggerSleepAction(1)
            call UnitAddItemToSlotById(u,c,j-1) 
call BJDebugMsg(I2S(H2I(UnitItemInSlot(u,j-1))))
 call BJDebugMsg(I2S(H2I(u))+" "+I2S(c)+" "+I2S(j-1))
call TriggerSleepAction(1)
            call SetItemCharges(GetLastCreatedItem(),GetItemCount(u,GetBagIndex(u),j)) 
        endif 
        set j=j+1 
    endloop 
    set j=0 
endfunction 

Shingo Jass Highlighter 0.4

引用:
COPY JASSCODE
JASS:
call TriggerSleepAction(1)
            call UnitAddItemToSlotById(u,c,j-1) 
call BJDebugMsg(I2S(H2I(UnitItemInSlot(u,j-1))))
 call BJDebugMsg(I2S(H2I(u))+" "+I2S(c)+" "+I2S(j-1))
call TriggerSleepAction(1)

Shingo Jass Highlighter 0.4

这样就不出错了。。。。好诡异
我的帖子总索引

求工具以及下载属性领取贴

一切都是浮云``对``就是浮云``

TOP

COPY JASSCODE
JASS:
function GetBag takes unit u returns nothing 
    local integer j=1 
    local integer c 
    loop 
        exitwhen j>6 
        if UnitItemInSlot(u,j-1)!=null then 
            call RemoveItem(UnitItemInSlot(u,j-1)) 
        endif 
        set c=GetItemId(u,GetBagIndex(u),j) 
        if c!=0 then 
call TriggerSleepAction(0)//这里加个等待。。就不会出错。具体你再去分析把。。我又要游戏了
            call UnitAddItemToSlotById(u,c,j-1) 
            call SetItemCharges(GetLastCreatedItem(),GetItemCount(u,GetBagIndex(u),j)) 
        endif 
        set j=j+1 
    endloop 
    set j=0 
endfunction 

Shingo Jass Highlighter 0.4

本帖最近评分记录
  • cctvfive 力量 +10 这个问题我早发现了...忘了在那个帖子内说过 ... 2008-11-4 14:21
  • cctvfive 敏捷 +10 这个问题我早发现了...忘了在那个帖子内说过 ... 2008-11-4 14:21
  • cctvfive 智力 +10 这个问题我早发现了...忘了在那个帖子内说过 ... 2008-11-4 14:21
我的帖子总索引

求工具以及下载属性领取贴

一切都是浮云``对``就是浮云``

TOP

具体我分析不出来,就算没有物品,它也要等待……

TOP

引用:
这里加个等待。。就不会出错。具体你再去分析把。。我又要游戏了
下午学习下PS...话说,你不去睡觉么?

TOP

不去……

TOP

下午睡觉的话 有很不规律了..

晚上睡的话 明天起..才能恢复正常作息``
我的帖子总索引

求工具以及下载属性领取贴

一切都是浮云``对``就是浮云``

TOP

 33 12
发新话题