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

belal112

Basic Lua scripter
Joined
Dec 20, 2012
Messages
96
Solutions
1
Reaction score
11
Hello,

Wasn't going to release this because there is already a couple but open source right?
Like always it is using @Non Sequitur modal window system which can be found HERE

You will have to install that in order to be able to use this system.

Pictures

Main Screen
365ab70c051a18c7b3f7128e9416f6c3.png


Selection Screen
37c6bbd309818c4e1522a19c5a5b9cbe.png


Item Selection Screen (Please note pressing ok brings you back to the selection screen.)
6e831aac3ecb4735bb7c7bca9cdb22f0.png

Why use this?
Much cleaner then all the other crafting systems.. easy configurable and you just need to add the action script and the lib files. There is no need to register the scripts on login.lua or add creaturescripts!

Information on the system
It has an easy config section for you to customize it how you would like it! You just need to fill out the config table found in the action script (pictured below)
Code:
-- Window Config
   mainTitleMsg = "Crafting System", -- Main window title
   mainMsg = "Welcome to the crafting system. Please choose a vocation to begin.", -- Main window message

   craftTitle = "Crafting System: ", -- Title of the crafting screen after player picks of vocation
   craftMsg = "Here is a list of all items that can be crafted for the ", -- Message on the crafting screen after player picks of vocation
-- End Window Config

-- Player Notifications Config
   needItems = "You do not have all the required items to make ", -- This is the message the player recieves if he does not have all required items

-- Crafting Config
   system = {
  [1] = {vocation = "Master Sorcerer", -- This is the category can be anything.
       items = {
         [1] = {item = "Shadow's Sceptre", -- item name (THIS MUST BE EXACT OR IT WILL NOT WORK!)
             itemID = 25249, -- item to be made
             reqItems = { -- items and the amounts in order to craft.
                 [1] = {item = 25224, count = 50}, -- Silver Tokens
                 [2] = {item = 9969, count = 1}, -- Black Skull
                 [3] = {item = 5904, count = 30}, -- Magic Sulphur
                 [4] = {item = 7451, count = 1}, -- Shadow Sceptre
                 [5] = {item = 22396, count = 50}, -- Cluster of Solace
               },
             },

Installation

1)
Install the modal window helper HERE

2) Register the script in /data/actions/actions.xml by adding this line (Replacing "ITEMID" with the item you want to use:
Code:
    <action itemid="ITEMID" script="crafting.lua"/>
3) Create a new text document in /data/actions/scripts and name it "crafting.lua" and paste the following:
http://pastebin.com/dF2Qp7wx
4) Add the following line to your global.lua:
Code:
dofile('data/lib/crafting.lua')
5) Create a new text document in /data/lib/ and name it "crafting.lua" and paste the following:
http://pastebin.com/5QwAviAP

Enjoy =)

I'm pretty much of a big noob so please help me with that silly question, how exactly can I use the system? xD
meaning, how do I execute the window... how do I get the thing to work? should I bind an item to it as in use that
item to open the window or something? If so, can you tell me how or atleast redirect me to a link teaching me how to?
THANK YOU! c:
 
OP
strutZ

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,370
Solutions
6
Reaction score
533
I'm pretty much of a big noob so please help me with that silly question, how exactly can I use the system? xD
meaning, how do I execute the window... how do I get the thing to work? should I bind an item to it as in use that
item to open the window or something? If so, can you tell me how or atleast redirect me to a link teaching me how to?
THANK YOU! c:

Hey dude,

All you have to do is follow the instructions i provided in the main post. The window opens when you use the item you set here:
Code:
    <action itemid="ITEMID" script="crafting.lua"/>

When you use w/e item you chose it will launch the window =)
 

belal112

Basic Lua scripter
Joined
Dec 20, 2012
Messages
96
Solutions
1
Reaction score
11
Hey dude,

All you have to do is follow the instructions i provided in the main post. The window opens when you use the item you set here:
Code:
    <action itemid="ITEMID" script="crafting.lua"/>

When you use w/e item you chose it will launch the window =)

OH THANK YOU SO MUCH! I didn't quite understand that when I read it but it's clear now! Sorry for your time haha :D Thanks!
 
OP
strutZ

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,370
Solutions
6
Reaction score
533
OH THANK YOU SO MUCH! I didn't quite understand that when I read it but it's clear now! Sorry for your time haha :D Thanks!
No worries man everyone starts somewhere =)
 

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,461
Solutions
8
Reaction score
203
I got an error (or not error), well, I install the helper before with another system, and then install the action system, but when I click in the first choice nothing happen, not error in console, but not open the new window with the list of items
I edit the config to be smaller
Code:
[1] = {vocation = "Items 1", -- This is the category can be anything.
        items = {
            [1] = {item = "bow", -- item name (THIS MUST BE EXACT OR IT WILL NOT WORK!)
                    itemID = 25249, -- item to be made
                    reqItems = { -- items and the amounts in order to craft.
                            [1] = {item = 25224, count = 50}, -- Silver Tokens
                            [2] = {item = 9969, count = 1}, -- Black Skull
                            [3] = {item = 5904, count = 30}, -- Magic Sulphur
                            [4] = {item = 7451, count = 1}, -- Shadow Sceptre
                            [5] = {item = 22396, count = 50}, -- Cluster of Solace
                        },
                    },
               
            [2] = {item = "bow",
                    itemID = 25254,           
                    reqItems = {
                            [1] = {item = 25224, count = 25}, -- Silver Tokens
                            [2] = {item = 7891, count = 1}, -- Magma Boots
                            [3] = {item = 13757, count = 20}, -- Coal
                            [4] = {item = 18420, count = 20}, -- red crystal fragments
                    },
                },
            },
        },
    }
how I can start to find the issue ? (already check if exist the window helper in my data)
 

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,461
Solutions
8
Reaction score
203
what details ?
don't appear it
still in the "master sorcerer, elder druid.. " etc...
when I select any category nothing happen..
 
OP
strutZ

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,370
Solutions
6
Reaction score
533
what details ?
don't appear it
still in the "master sorcerer, elder druid.. " etc...
when I select any category nothing happen..

very confused as to what you are saying... if you are saying you changed the catagory and my ones are still coming up type in these commands on your god.
/reload global
/reload actions

If that does still not fix your problem
Code:
[1] = {item = "bow", -- item name (THIS MUST BE EXACT OR IT WILL NOT WORK!)
 

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,461
Solutions
8
Reaction score
203
very confused as to what you are saying... if you are saying you changed the catagory and my ones are still coming up type in these commands on your god.
/reload global
/reload actions

If that does still not fix your problem
Code:
[1] = {item = "bow", -- item name (THIS MUST BE EXACT OR IT WILL NOT WORK!)
I restart the server... also I already try with another item name "Glacial Rod" for exemple, and "glacial rod"
 
OP
strutZ

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,370
Solutions
6
Reaction score
533
I restart the server... also I already try with another item name "Glacial Rod" for exemple, and "glacial rod"
Tell me what is happening more clearly and i can help you.
 

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,461
Solutions
8
Reaction score
203
ok... the steps.
1 - I already have the modal window helper installed in my libs.
2 - then I install your system, crafting in actions and lib.
3 - try test it
4 - then when I use the item that open the modal window appear to me the category edited there, called Items 1
5 - so, when I try click in the category called Items 1 the modal window close and nothing happen, no error in the console but not open the list of items in the category selected
6 - then I try change the items name, so I use e.g.
Glacial Rod and glacial rod just for test if is problem with the item name
7 - still closing the modal window when I click in the category called
Items 1

Now is more clearly to you understand ? I'm not sure if I can be more clearly than it.
 
OP
strutZ

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,370
Solutions
6
Reaction score
533
ok... the steps.
1 - I already have the modal window helper installed in my libs.
2 - then I install your system, crafting in actions and lib.
3 - try test it
4 - then when I use the item that open the modal window appear to me the category edited there, called Items 1
5 - so, when I try click in the category called Items 1 the modal window close and nothing happen, no error in the console but not open the list of items in the category selected
6 - then I try change the items name, so I use e.g.
Glacial Rod and glacial rod just for test if is problem with the item name
7 - still closing the modal window when I click in the category called
Items 1

Now is more clearly to you understand ? I'm not sure if I can be more clearly than it.

yea thats perfect man. Did you happen to change anything else in the lib file? like the modal window name by any chance?
 

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,461
Solutions
8
Reaction score
203
yea thats perfect man. Did you happen to change anything else in the lib file? like the modal window name by any chance?
nope, no edit any name in the lib...
maybe the problem is with the modal window helper, I install in another folder data\lib\miscellaneous\modal_window.lua
and the "dofile" are located in miscellaneous.lua
Code:
dofile('data/lib/miscellaneous/miscellaneous.lua')
the lib...
https://hastebin.com/igorohiqix.lua
 

Crixpx

New Member
Joined
Jan 11, 2015
Messages
67
Reaction score
3
Hello,

Wasn't going to release this because there is already a couple but open source right?
Like always it is using @Non Sequitur modal window system which can be found HERE

You will have to install that in order to be able to use this system.

Pictures

Main Screen
365ab70c051a18c7b3f7128e9416f6c3.png


Selection Screen
37c6bbd309818c4e1522a19c5a5b9cbe.png


Item Selection Screen (Please note pressing ok brings you back to the selection screen.)
6e831aac3ecb4735bb7c7bca9cdb22f0.png

Why use this?
Much cleaner then all the other crafting systems.. easy configurable and you just need to add the action script and the lib files. There is no need to register the scripts on login.lua or add creaturescripts!

Information on the system
It has an easy config section for you to customize it how you would like it! You just need to fill out the config table found in the action script (pictured below)
Code:
-- Window Config
   mainTitleMsg = "Crafting System", -- Main window title
   mainMsg = "Welcome to the crafting system. Please choose a vocation to begin.", -- Main window message

   craftTitle = "Crafting System: ", -- Title of the crafting screen after player picks of vocation
   craftMsg = "Here is a list of all items that can be crafted for the ", -- Message on the crafting screen after player picks of vocation
-- End Window Config

-- Player Notifications Config
   needItems = "You do not have all the required items to make ", -- This is the message the player recieves if he does not have all required items

-- Crafting Config
   system = {
  [1] = {vocation = "Master Sorcerer", -- This is the category can be anything.
       items = {
         [1] = {item = "Shadow's Sceptre", -- item name (THIS MUST BE EXACT OR IT WILL NOT WORK!)
             itemID = 25249, -- item to be made
             reqItems = { -- items and the amounts in order to craft.
                 [1] = {item = 25224, count = 50}, -- Silver Tokens
                 [2] = {item = 9969, count = 1}, -- Black Skull
                 [3] = {item = 5904, count = 30}, -- Magic Sulphur
                 [4] = {item = 7451, count = 1}, -- Shadow Sceptre
                 [5] = {item = 22396, count = 50}, -- Cluster of Solace
               },
             },

Installation

1)
Install the modal window helper HERE

2) Register the script in /data/actions/actions.xml by adding this line (Replacing "ITEMID" with the item you want to use:
Code:
    <action itemid="ITEMID" script="crafting.lua"/>
3) Create a new text document in /data/actions/scripts and name it "crafting.lua" and paste the following:
http://pastebin.com/dF2Qp7wx
4) Add the following line to your global.lua:
Code:
dofile('data/lib/crafting.lua')
5) Create a new text document in /data/lib/ and name it "crafting.lua" and paste the following:
http://pastebin.com/5QwAviAP

Enjoy =)

*-* HERMOSO <3
 

Tampek

ECHO 'Zarkonia.online';
Joined
Dec 29, 2015
Messages
446
Solutions
5
Reaction score
29
Location
Spain
escusme i have one question

how i can add fuction on this line:

-- Send effect and give player item.
self:addItem(config.system[lastChoice].items[choice.id].itemID)
self:getPosition():sendMagicEffect(CONST_ME_FIREATTACK)
end

from script upgrading system by zbizu

doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_HITCHANCE, upgrading.upValue(it:getHitChance(), nLevel, conf["upgrade"].hitChance))

thnx for advance
 
OP
strutZ

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,370
Solutions
6
Reaction score
533
escusme i have one question

how i can add fuction on this line:

-- Send effect and give player item.
self:addItem(config.system[lastChoice].items[choice.id].itemID)
self:getPosition():sendMagicEffect(CONST_ME_FIREATTACK)
end

from script upgrading system by zbizu

doItemSetAttribute(itemEx.uid, ITEM_ATTRIBUTE_HITCHANCE, upgrading.upValue(it:getHitChance(), nLevel, conf["upgrade"].hitChance))

thnx for advance
I dont know what that system is doing so i cant help with that. What i would suggest is understanding what his system does and creating functions for them and then using those functions in the code you linked.
 

Tampek

ECHO 'Zarkonia.online';
Joined
Dec 29, 2015
Messages
446
Solutions
5
Reaction score
29
Location
Spain
hmmm its ok, so if you have time when and if you want we can edit my idea to build your craft system with some images and other options.
And edit sources

:D anyway thnx for reply :)
 
Top