![]() |
mod code question
1 Attachment(s)
I ask the question for certain person .
He is developing a mod . http://forum.1cpublishing.eu/showthread.php?t=36243 But he encountered a error (attached pic) and a messenger "msg_gold_is_found_01" in-game.Does anyone know how to fix the error and can the chests.lua code be improved ? For i can't find WotN's mod sub-forum, so i open the thread here and there seems to higher popularity here.:) Btw,the mod refers to a previous mod here but i don't know that original mod's name. |
Without the code we can't help you. The message is clear, there are an error on line 85, now without the function...;)
|
1 Attachment(s)
Quote:
He seemed to mention he wrote the chests.lua in the mod with boxes.lua and addon_pet.lua . Is the problem as simple as what you replied ?Ok ,i will tell him.Thx. |
Simple ? Certainly not !
The problem occur in : function gen_object_in_box_name(par) -- äîñòóïíû ïåðåìåííûå: -- object - òýã ïðåäìåòà -- count - êîëè÷åñòâî âçÿòîãî -- image local cs = Logic.cur_lu_var("count") local count = 0 if cs ~= nil then count = tonumber( "0" .. cs ) end if par == "image" then return "<imb=" .. Logic.cur_lu_var("image") .. ">" --<br><label=itm_"..Logic.cur_lu_var("object").."_na me>: "..tostring(count) end if par == "name" then if count > 1 then return "<label=itm_"..Logic.cur_lu_var("object").."_name> : "..tostring(count) else return "<label=itm_"..Logic.cur_lu_var("object").."_name> " end end if count > 1 then return "<br><imb=" .. Logic.cur_lu_var("image") .. "><br><label=itm_"..Logic.cur_lu_var("object").."_ name>: "..tostring(count) else return "<br><imb=" .. Logic.cur_lu_var("image") .. "><br><label=itm_"..Logic.cur_lu_var("object").."_ name>" end end But he don't change this file, it's called from somewhere in his mod, and he must find where. |
Saroumana,thanks for your explanation.
I seem to find the question ,and now i want to know whether it can be answered or modified if anyone can reply again. The mod has a purpose to get random items form dug chests in battlefield by mixing boxes.lua with addon_pet.lua ,but it seems to the mod that random items will cause certain error. Reference to this thread: http://forum.1cpublishing.eu/showthr...406#post126406 Is it impossible to safely let dug chests in battlefield generate random items due to some internal codes we can't modify ? |
It crash at this line :
return "<br><imb=" .. Logic.cur_lu_var("image") .. "><br><label=itm_"..Logic.cur_lu_var("object") .."_ name>" Which mean some value are missing. Whether : -image -object (unlikely) -name I guest some objects (item ?) don't have the image field filled. |
All times are GMT. The time now is 01:41 PM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.