Jump to content
×
×
  • Create New...
  • 0

[PyLUA++]Tradehouse / LUA_ERROR


piktorvik

Question

  • Premium

Hi Metin2Dev,

 

I need help with this:

20:20:57.867740 :: RunState: LUA_ERROR: locale/hungary/quest/object/state/mb_igshop:984: attempt to call field `give_item_with' (a nil value)
SYSERR: Oct 30 20:20:57.867829 :: WriteRunningStateToSyserr: LUA_ERROR: quest mb_igshop.start click

 

 

This happens when someone buys the product I am offering for sale and wants to take it out or when I just want to smoothly withdraw a sale.

 

Please help me! Thanks! Have a nice day!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I can't tell you how to solve it, i can just try to explain you what's happen here:
 

LUA_ERROR: locale/hungary/quest/object/state/mb_igshop:984: attempt to call field `give_item_with' (a nil value)

 

The Error is saying us that a quest is calling give_item_with (i guess you might find it as pc.give_item_with) which is not defined in the module (it might be pc module) and the attempt to call it returned a nil value (because can't find its function body defined). 
The way to solve it is to define the body of the function.

Usually the lua modules are defined by passing a function table e.g. here we have:

 

void RegisterPCFunctionTable()
{
  luaL_reg pc_functions[] =
    {
    { "get_wear",		pc_get_wear			},
    { "get_player_id",	pc_get_player_id	},
    { "get_account_id", pc_get_account_id	},
    { "get_account",	pc_get_account		},
    //[........]
    //[........]
    //[........]			
    { NULL,			NULL			}
  };

  CQuestManager::instance().AddLuaFunctionTable("pc", pc_functions);
}

 

As you can see here we have a list of methods defined by giving them a name (callable from lua) and a definition which is defined in the .cpp file (e.g. questlua_pc.cpp)

 

Conclusion is that you need to define your function which is giving you that error and to add it to the appropriate function table.

Edited by Ikarus_
  • Love 1

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

  • 0
  • Premium
14 hours ago, Ikarus_ said:

I can't tell you how to solve it, i can just try to explain you what's happen here:
 

LUA_ERROR: locale/hungary/quest/object/state/mb_igshop:984: attempt to call field `give_item_with' (a nil value)

 

The Error is saying us that a quest is calling give_item_with (i guess you might find it as pc.give_item_with) which is not defined in the module (it might be pc module) and the attempt to call it returned a nil value (because can't find its function body defined). 
The way to solve it is to define the body of the function.

Usually the lua modules are defined by passing a function table e.g. here we have:

 

void RegisterPCFunctionTable()
{
  luaL_reg pc_functions[] =
    {
    { "get_wear",		pc_get_wear			},
    { "get_player_id",	pc_get_player_id	},
    { "get_account_id", pc_get_account_id	},
    { "get_account",	pc_get_account		},
    //[........]
    //[........]
    //[........]			
    { NULL,			NULL			}
  };

  CQuestManager::instance().AddLuaFunctionTable("pc", pc_functions);
}

 

As you can see here we have a list of methods defined by giving them a name (callable from lua) and a definition which is defined in the .cpp file (e.g. questlua_pc.cpp)

 

Conclusion is that you need to define your function which is giving you that error and to add it to the appropriate function table.

 

Thats my RegisterPCFunctionTable()

    void RegisterPCFunctionTable()
    {
        luaL_reg pc_functions[] = 
        {
/////////ETC,ETC/////////////////

            { "get_channel_id",        pc_get_channel_id    },

            { "give_poly_marble",    pc_give_poly_marble    },
            { "get_sig_items",        pc_get_sig_items    },

            { "charge_cash",        pc_charge_cash        },
            
            { "get_informer_type",    pc_get_informer_type    },    //µ¶ŔĎ Ľ±ą° ±â´É
            { "get_informer_item",  pc_get_informer_item    },

            { "give_award",            pc_give_award            },    //ŔĎş» °čÁ¤´ç ÇŃąřľż ±Ý±« Áö±Ţ
            { "give_award_socket",    pc_give_award_socket    },    //¸ô ŔÎşĄĹ丮żˇ ľĆŔĚĹŰ Áö±Ţ. ĽŇÄĎ ĽłÁ¤Ŕ» Ŕ§ÇŃ ÇÔĽö.

            { "get_killee_drop_pct",    pc_get_killee_drop_pct    }, /* mob_vnum.kill ŔĚşĄĆ®żˇĽ­ killeeżÍ pcżÍŔÇ level Â÷ŔĚ, pcŔÇ ÇÁ¸®ąĚľö µĺ¶ř·ü µîµîŔ» °í·ÁÇŃ ľĆŔĚĹŰ µĺ¶ř Č®·ü.
            { "give_item_with", pc_give_item_with },                                                        * return °ŞŔş (şĐŔÚ, şĐ¸đ).
                                                                    * (¸»ŔĚ şąŔâÇѵĄ, CreateDropItemŔÇ GetDropPctŔÇ iDeltaPercent, iRandRange¸¦ returnÇŃ´Ů°í ş¸¸é µĘ.)                                                        * (ŔĚ ¸»ŔĚ ´ő ľî·Áżď¶ółŞ ¤Đ¤Đ)
                                                                    * ÁÖŔÇ»çÇ× : kill eventżˇĽ­¸¸ »çżëÇŇ °Í!
                                                                    */

            { NULL,            NULL            }
        };

        CQuestManager::instance().AddLuaFunctionTable("pc", pc_functions);
    }
};
 

Any other solution? 😕

Link to comment
Share on other sites

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Answer this question...

×   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.

  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Metin2 Dev Github
  • Activity

    1. 0

      Extended memory pool

    2. 7

      Wear (use) item only on specific map

    3. 4

      Python tool for analyzing average yang drop per hour in each map.

    4. 162

      Plechito - Halloween 2022

    5. 0

      disable quest esc

    6. 7

      Wear (use) item only on specific map

    7. 7

      Wear (use) item only on specific map

    8. 7

      Wear (use) item only on specific map

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.