• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TFS 1.2] Simple Crafting System.

I will rewrite this and upload tomorrow.
 
my bad this post, @strutZ because after i tried and i saw the new script! Is working 100%, and the name is really necessary correct 100% to working.

Very Thankys! I'm new in otland, and the experience is nice, i hope i can contribute!
 
does anyone know how to add the creater name to this? so whoever crafts the item is written on the item after that
 
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)
 
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)
Something like this should work:
Code:
craftedItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Created by "..player:getName()..".")
I don't know if it will work like this but you can try adding it at the end.
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()..".")
Or you can get the Item(UID) and then apply the description.
Code:
Item(UID):setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Created by "..player:getName()..".")
 
Something like this should work:
Code:
craftedItem:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Created by "..player:getName()..".")
I don't know if it will work like this but you can try adding it at the end.
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()..".")
Or you can get the Item(UID) and then apply the description.
Code:
Item(UID):setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "Created by "..player:getName()..".")

1. 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 :D
 
1. 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 :D
Glad you managed to sort it out n_n
Have a nice day!
 
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.lua:eek:nModalWindow
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>
 
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.lua:eek:nModalWindow
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>
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.

if your items.xml has "Fire Sword", then your choice must also read "Fire Sword" not "fire sword".
 
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>
 
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>

Add this to your global.lua


Lua:
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
 
alguém poderia ajuda não estou achando essa tag ou arquivo.lua
4) Adicione a seguinte linha ao seu global.lua:
Código: dofile ('data / lib / crafting.lua')

alguém poderia ajuda nessa parte por favor
 
Back
Top