發新話題
打印

如何(有新問題)

[Close]
引用:
原帖由 Frayja 於 2014-6-20 21:35 發表
未定義t函數初始化
咁要點搞
係唔係要用t黎set左d變數先

TOP

好簡單
自訂文本d野唔好刪
原先的InitTrig_intz call intz function就行
當然
要有觸發條件

TOP

引用:
原帖由 Frayja 於 2014-6-21 09:43 發表
好簡單
自訂文本d野唔好刪
原先的InitTrig_intz call intz function就行
當然
要有觸發條件
我諗我明既
(今次顯出我係個JASS白癡 )

TOP

呢下又咩事
附件: 您所在的用戶組無法下載或查看附件

TOP

沒有定義觸發器?
要定義為null

TOP

引用:
原帖由 Frayja 於 2014-7-1 08:55 發表
沒有定義觸發器?
要定義為null
即係應該點寫

TOP

function格式錯誤
function裡面還再開一個function

TOP

引用:
原帖由 Frayja 於 2014-7-2 20:59 發表
function格式錯誤
function裡面還再開一個function
短短的兩句
卻包含了深懊的意思(即係話我唔明 )

TOP

function gg_tri_intz takes nothing returns nothing
   //.................
function buy_item takes nothing returns nothing
endfunction

endfunction

以上格式是錯誤的

function ... takes nothing returns nothing
...
endfunction   為一個完整的function

而一個完整的function中不能再建構一個function
只能call一個function

TOP

引用:
原帖由 Frayja 於 2014-7-2 22:55 發表
function gg_tri_intz takes nothing returns nothing
   //.................
function buy_item takes nothing returns nothing
endfunction

endfunction

以上格式是錯誤的

function ... takes nothing returns ...
即係唔要1個?
如果係既話都係唔得

TOP

function buy_item2 takes nothing returns nothing
if ((IsUnitType(GetBuyingUnit(), UNIT_TYPE_HERO) == true)) then
         set bj_forLoopAIndex = 1
         set bj_forLoopAIndexEnd = 16
         loop
             exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
             if ((GetUnitTypeId(GetSoldUnit()) == T[bj_forLoopAIndex])) then
                 if ((bj_forLoopAIndex < 2)) then
                     if ((I[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] == false)) then
                         call UnitAddItemByIdSwapped( P[bj_forLoopAIndex], GetBuyingUnit() )
                         set I[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] = true
                     else
                     endif
                 else
                     if ((bj_forLoopAIndex < 4)) then
                         if ((II[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] == false)) then
                             call UnitAddItemByIdSwapped( P[bj_forLoopAIndex], GetBuyingUnit() )
                             set II[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] = true
                         else
                           
                         endif
                     else
                         if ((bj_forLoopAIndex < 6)) then
                             if ((III[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] == false)) then
                                 call UnitAddItemByIdSwapped( P[bj_forLoopAIndex], GetBuyingUnit() )
                                 set III[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] = true
                             else
                              
                             endif
                         else
                             if ((bj_forLoopAIndex < 8)) then
                                 if ((IIII[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] == false)) then
                                     call UnitAddItemByIdSwapped( P[bj_forLoopAIndex], GetBuyingUnit() )
                                     set IIII[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] = true
                                 else
                                    
                                 endif
                             else
                                 if ((bj_forLoopAIndex < 10)) then
                                     if ((IIIII[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] == false)) then
                                         call UnitAddItemByIdSwapped( P[bj_forLoopAIndex], GetBuyingUnit() )
                                         set IIIII[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] = true
                                     else
                                         
                                     endif
                                 else
      if ((bj_forLoopAIndex < 12)) then
                 if ((IIIIII[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] == false)) then
                                             call UnitAddItemByIdSwapped( P[bj_forLoopAIndex], GetBuyingUnit() )
                                             set IIIIII[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] = true
                                         else
                                             
                                         endif
                                     else
    if ((bj_forLoopAIndex < 14)) then
   if ((IIIIIII[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] == false)) then
                                                 call UnitAddItemByIdSwapped( P[bj_forLoopAIndex], GetBuyingUnit() )
                                                 set IIIIIII[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] = true
                                             else
                                             
                                             endif
                                         else
    if ((IIIIIIII[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] == false)) then
                                                 call UnitAddItemByIdSwapped( P[bj_forLoopAIndex], GetBuyingUnit() )
                                                 set IIIIIIII[GetConvertedPlayerId(GetOwningPlayer(GetBuyingUnit()))] = true
                                             else
                                                
                                             endif
                                         endif
                                     endif
                                 endif
                             endif
                         endif
                     endif
                 endif
             else
             endif
             set bj_forLoopAIndex = bj_forLoopAIndex + 1
         endloop
     else
     endif
endfunction
呢段好似係問題所在
我試過分開左佢地
得呢部分出現左文法錯誤

TOP

考慮到你不熟悉jass跟hash table
我用最簡單的方法做了個sample給你看
附件: 您所在的用戶組無法下載或查看附件

TOP

引用:
原帖由 Frayja 於 2014-7-3 23:14 發表
考慮到你不熟悉jass跟hash table
我用最簡單的方法做了個sample給你看
收下了
如果再有問題我會再問
F大師咁勁你唔可以縮架
========================
表示無奈

[ 本帖最後由 古物.帝 於 2014-7-4 16:15 編輯 ]

TOP

順帶一問(此帖之問題已解決)
點樣先可以設定物品既最大擁有數量
即係例: 生命藥水 1格最多有5枝(數字7) 多出5枝就係第格(數字8)到擺

TOP

引用:
原帖由 古物.帝 於 2014-7-17 23:23 發表
順帶一問(此帖之問題已解決)
點樣先可以設定物品既最大擁有數量
即係例: 生命藥水 1格最多有5枝(數字7) 多出5枝就係第格(數字8)到擺
使用次數?

TOP

發新話題