[TFS 1.2] Simple Crafting System.

Sp0tl3ss

Nestalia.org
Joined
Jul 19, 2014
Messages
273
Best answers
0
Reaction score
12
cant check detailt havent edited anthing
 

tekadon2

Member
Joined
Jun 18, 2016
Messages
61
Best answers
0
Reaction score
8
Também estou tendo o mesmo problema.
A lista de detalhes não aparece
 

tekadon2

Member
Joined
Jun 18, 2016
Messages
61
Best answers
0
Reaction score
8
****I'm also having the same problem.
The list of details does not appear
 
OP
strutZ

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,338
Best answers
6
Reaction score
470
I will rewrite this and upload tomorrow.
 

Lucas Primo

New Member
Joined
Oct 3, 2017
Messages
22
Best answers
1
Reaction score
1
Location
Brazil
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!
 

William Hughes

New Member
Joined
Oct 12, 2018
Messages
15
Best answers
0
Reaction score
1
does anyone know how to add the creater name to this? so whoever crafts the item is written on the item after that
 

William Hughes

New Member
Joined
Oct 12, 2018
Messages
15
Best answers
0
Reaction score
1
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)
 

Ramirow

Excellent OT User
Joined
Aug 22, 2009
Messages
482
Best answers
12
Reaction score
189
Location
Argentina
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()..".")
 

William Hughes

New Member
Joined
Oct 12, 2018
Messages
15
Best answers
0
Reaction score
1
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
 

Ramirow

Excellent OT User
Joined
Aug 22, 2009
Messages
482
Best answers
12
Reaction score
189
Location
Argentina
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!
 

hucke.ducke

New Member
Joined
Jul 28, 2019
Messages
1
Best answers
0
Reaction score
0
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>
 
OP
strutZ

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,338
Best answers
6
Reaction score
470
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".
 
Top