Jump to content
HILO

forge.lua error

Recommended Posts

 

Hi,
I've been getting this error on lua_err.log, Anyone have a clue?
 

Quote

forge.lua:1101: attempt to perform arithmetic on field `?' (a nil value)

 

here is the code:
   

 StoneInfo[0]=0
    StoneInfo[1]=0
    StoneInfo[2]=0
    StoneLv[0]=0
    StoneLv[1]=0
    StoneLv[2]=0
    StoneInfo[0],StoneInfo[1],StoneInfo[2],StoneLv[0],StoneLv[1],StoneLv[2] = CheckStoneInfo ( Num )

    local AddCheck = 0

    local i = 0
    local j = 0
    for i = 0 , 2 , 1 do
        if StoneInfo [i] ~= nil and StoneInfo [i] ~=0  then
            if StoneAttrType[StoneInfo [i]] == ITEMATTR_VAL_MNATK then
                local Itemattr_Type1 = StoneAttrType[StoneInfo [i]]
                local Itemattr_Type2 = Itemattr_Type1 + 1
                local ItemAttrEff = 0
                local num_stone=0
                local lv_stone=0
                if StoneLv[i]>0 and StoneLv[i]<=9 then
                    lv_stone=StoneLv[i]
                end
                if StoneInfo [i]>=0 and StoneInfo [i]<=StoneEff_Num then
                    num_stone=StoneInfo [i]
                    ItemAttrEff =StoneEff [num_stone] * lv_stone
                end
                AddCheck = AddItemFinalAttr ( Item , Itemattr_Type1 , ItemAttrEff )
                if AddCheck == 0 then
                    LG("check_item_final","AddCheck Failed")
                end
                AddCheck = AddItemFinalAttr ( Item , Itemattr_Type2 , ItemAttrEff )
                if AddCheck == 0 then
                    LG("check_item_final","AddCheck Failed")
                end
            else
                local Itemattr_Type = StoneAttrType[StoneInfo [i]]
                local ItemAttrEff = 0
                local num_stone=0
                local lv_stone=0
                if StoneLv[i]>0 and StoneLv[i]<=9 then
                    lv_stone=StoneLv[i]
                end
                if StoneInfo [i]>=0 and StoneInfo [i]<=StoneEff_Num then
                    num_stone=StoneInfo [i]
                    ItemAttrEff =StoneEff [num_stone] * lv_stone  --  this is the line mentioned on log.
                end
                AddCheck = AddItemFinalAttr ( Item , Itemattr_Type , ItemAttrEff )
                if AddCheck == 0 then
                    LG("check_item_final","AddCheck Failed")
                end

            end
        end
    end
end

 

Share this post


Link to post
Share on other sites

Have you by any chance modified the gem variables? Perhaps added a new gem or something and forgot to increase values? Didn't declare something right I guess.

Share this post


Link to post
Share on other sites

What i recommend is add this line after num_stone = StoneInfo

Notice ( "StoneEff = "..StoneEff[num_stone].." , Lv_Stone = "..lv_stone.."" )

It does not solve the problem, but it will point you what the null value is to be fixed.

 

@HILO

Edited by Shako
  • Like 1

logo-big.png   logo.png

                                   Sunny Go! Online                                                                    pko.host                                                 

Share this post


Link to post
Share on other sites
Quote

Have you by any chance modified the gem variables? Perhaps added a new gem or something and forgot to increase values? Didn't declare something right I guess.

Added the cloak gems before, but didn't notice the error before, and those gems aren't even used on server now.

 

Share this post


Link to post
Share on other sites

Mind posting your Variable.lua @HILO or posting the whole gems variables?I experienced the error before with the cloak gems but i fixed it from the variables.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...