?cant check detailt havent edited anthing
Yeah I need to re write this... try capitalising the items you have added to the system
Something like this should work:because the complicated method of giving the correct item generated by the modal window, adding
line 78 or so of crafting library
self:addItem(config.system[lastChoice].items[choice.id].itemID, config.system[lastChoice].items[choice.id].count)
adding...
self:doSetItemSpecialDescription(uid, description)
is giving me a lot of trouble. Anyone know the best way to do so?
--attempting to make the item read as follows
You see a rope
it weights 1.oz
it was crafted by (get player name)
craftedItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Created by "..player:getName()..".")
self:addItem(config.system[lastChoice].items[choice.id].itemID, config.system[lastChoice].items[choice.id].count):setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Created by "..player:getName()..".")
Item(UID):setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Created by "..player:getName()..".")
Something like this should work:
I don't know if it will work like this but you can try adding it at the end.Code:craftedItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Created by "..player:getName()..".")
Or you can get the Item(UID) and then apply the description.Code:self:addItem(config.system[lastChoice].items[choice.id].itemID, config.system[lastChoice].items[choice.id].count):setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Created by "..player:getName()..".")
Code:Item(UID):setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Created by "..player:getName()..".")
Glad you managed to sort it out n_n1. Lua error on line, nil value when calling method 'Item'
2.Attempt to index global player a nil value - onto something! It at least shows a possible way I can fix that
3.Attempt to call method 'item' a nil value
Though none of these 3 directly worked I chose to try and nudge #2 along because it gave me more to work with as far as a possible fix.
Adjusting the
"Created by "..player:getName()..".")
to
"Created by "..self:getName()..".")
Worked!
Tested it with saving the description and all, seems to be working perfectly so thank you very much for the help with that problem!
Ramirow great work
I will redo this script one day.. but from memory you bave to make sure you have your choices EXACTLY as it appears on your items.xml so all capitals etc.Hello, i know its been a while since the script was posted but im getting this error on console.
The script works. Just having an issue with the details option. It doesnt close the window properly it just overlay the previous window.
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/modalwindowhelper.luanModalWindow
data/lib/crafting.lua:48: attempt to index local 'choice' (a nil value)
stack traceback:
[C]: in function '__index'
data/lib/crafting.lua:48: in function 'callback'
data/creaturescripts/scripts/modalwindowhelper.lua:26: in function <data/creaturescripts/scripts/modalwindowhelper.lua:1>
[C]: in function 'capAll'
data/lib/crafting.lua:55: in function 'callback'
data/creaturescripts/scripts/modalwindowhelper.lua:26: in function <data/creaturescripts/scripts/modalwindowhelper.lua:1>
Hey if im click Details window is go close and i have this on console and i can make someone with this?
Code:[C]: in function 'capAll' data/lib/crafting.lua:55: in function 'callback' data/creaturescripts/scripts/modalwindowhelper.lua:26: in function <data/creaturescripts/scripts/modalwindowhelper.lua:1>
function capAll(str)
local newStr = ""; wordSeparate = string.gmatch(str, "([^%s]+)")
for v in wordSeparate do
v = v:gsub("^%l", string.upper)
if newStr ~= "" then
newStr = newStr.." "..v
else
newStr = v
end
end
return newStr
end