Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Azrith001's Simple Crafting system~

Azrith001's Simple Crafting system~Version: 3.5
By: azrith001

Introduction

Well, Hello. I was originally working on this script for my friend GubiD, to go along with a menu system design for WOTR. well :\ someone beat us to the punch so I decided to release it to all of you :). Its fairly simple to use.

Features
The Crafting System Comes with a number of features that are very useful to every game designer.
  • 100% animated
  • No errors thus far
  • Recipe System

Screenshots
craft-1.png

craft-2.png



Demo

http://www.mediafire.com/?dtdknnkmgqy

Script

In demo. Uses Images. I'm to lazy to copy them here ;D


Instructions

K.matt":1xlj530u said:
OK just to clear up any confushion about it like what i had with where to change stuff to make it all work >,< i thought id try explain it in a way mess script orrentated people can understand so hear it goes ......( if my trying to make it simplified offends you azrith001 i apologige but i think it will make your good work more userfriends to understand if you know about zip in code language)

After downloading azrith001's crafting system above. or to see what i already edited on mine so you can follo my steps easyer try this http://www.mediafire.com/download.php?qmwjmmcmow5
( also all credit should go to azrith001 i think as i only understood his code and then orginised it to my likeing)

1. open the program in RMXP so get to the editing thing ( Game.rxproj )

2.Next ill show where things are set up which is in the normal databace.
so open databace and look in items ( if you have the one i orginised youll see i have a big list of recies
set up there ( 1 herb in there as well) and the occasion is set up so you can only use them from the
menu, with a scope of none.(notice that in orger to have the uneing in the menue youll need to do what
i did with common event ( makeing it so it can say what it dose with some text and give you a new recipie
of it as its used like an item) if you dont want it to say what it dose make it .... Occasion: Never

remember that the number accigned to it is important 4 the script to recognise (eg my recipe 1 is number
23 )after seting one of them up in the databace you can use it to display a recipe in the crafting menu
( also its Icon can be changed as well but i like the recpie icon so im keeping it as Recipe )
Now The name of the recipe in this databace slot is what the recipe name is when its displayed in the
crafting menu.

3. Exit databace and enter the script editor (F11) is a shortcut key
Scroll down the list of script untill you find " Scene_Craft " and look at that section of code.

Right at the top after the Green explination is stuff that looks like
My orginisation virshion

Synth[0] = [23, ["i", 39, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]]
Synth[1] = [24, ["i", 39, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]]
Synth[2] = [25, ["i", 39, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]]

azrith001 orginisation virshion ( his is better for showing muti ingredens needed 4 a craft)

Synth[0] = [32, ["i", 34, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]]
Synth[1] = [31, ["w", 1, 1], ["i", 2, 8], nil, nil, nil, nil, nil, nil, ["w", 3]]
Synth[2] = [32, ["i", 1, 3], ["i", 34, 15], nil, nil, nil, nil, nil, nil, ["i", 3]]

ok so what dose this all mean ????? XD
Synth[0] ok well the number in the [ ] is what number in the list on crafting menu eg: the order so 0
Synth[1] is the first one, 1 is the second one and so on ( they must all be difrent and best to keep them
Synth[2] going up 1 at a time as you make another.

Now the = [23, is the next part ( i got 23 off fist line in my orginising first one is = [32, on azrith001's)

if you rememebr in databace the item slot fo Recipe 1 had its number as 23 so.... this is what the number
relats to. so you must have the item acociated with that number in invintory so see the recipe. ( best idear
is make it a recipe not somthing random like a potion ( so if you not shure just check your databace for the
right number and if need be make a ner recipe slot int the items part ( easy to just copy an old one and
change name)).

Next is the setup of the items needed for crafting the new item.
Synth[0] = [23, ["i", 39, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]]

If you look at the line ["i", 39, 3], this is how it works out what item(or wepon,armmor) is used to create
the new item it works like this.

["i", = The item page in databace ( "w" = wepon page, "a" = armmor page)
39, = reffers to the number on the list on databace ( simmilar to the 23 used to find recipe )
except you want it to find an item ( on mine 39 is set to the Herb ) in the databace
If you doing wepon's or armmor its the same setup its the number in the wepon/armmor list on
their page.
3], = this last part is how many of the item you want used to make the item ( for my line of code it is
3 which means i need 3 herb's to make the new item.( you can put in any number for 1-99 and
that will be how many you need to make the item.


The next part in my code is nil, which jsut means that you dont want anymore items needed in the
craft for the second slot so when you happy with whats already needed you fill the last 8 slots with this.
thats what iv had done to my last 7 slot's.

If you want more than one item needed to make the craft then you need to change the nill to another
line of ["i", 39, 3], instead of nil, ( remember you will need to change the ["i" , 39, 3], to show other
items needed in the craft ( reffear to the above if you not shure how to define )

Synth[1] = [31, ["w", 1, 1], ["i", 2, 8], nil, nil, nil, nil, nil, nil, ["w", 3]] This is the second line of recipies
on azrith001's and shows useing more than one item in recipe. BY filling more of the nil, with these you
add the number of ingredence needed you should get the hang of that fearly quick ( also futher down the
lines of code on azrith001's script you see one that uses 7 and also 8 items to create wepon ( his
ultimate wepon is a 7 slot).

The last part of this code ["i", 1]] Shows what the item that is created is. it follos the same format as the
rest of this code with ["i", meaning weather this item is in wepon/armmor/item list and the 1]] on
the end is saying which number in that list this item is. ( so by useing ["i", 1]] at the end on my
orginisating on the databace you will get 1 potion form the recipe)

Hint: when you make a new recime its often easyer to jsut copy a previous line of code (recipe) and past it underneather and sjut change its details.

eg: Synth[0] = [23, ["i", 39, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]] can be copper so underneath

Synth[1] = [(number in item list that has recipe), [(the items you want it useing ], nil, nil, nil, nil, nil,
nil, nil, [(and the iem you want in the end)]]


I think thats about everything that i needed to do to make new recipies with azrith001's script

**But make shure that the databace has got the items your linking ot or it will mess up**

FAQ

None thus far

Compatibility

Works in rmxp xD

Credits and Thanks

I made everything :)

Author's Notes

Please give me credit :)

Terms and Conditions

You can use any Legacy Studios Scripts/coding for free as long as you give the proper credit where its needed. if you fail to do so you are violating our copyright agreement. Please give credit, I don't want you in jail xD
 

Rya

Member

Wow, this looks fabulous! You've done a wonderful job on the outlay of this. I will be testing it very shortly. :) You said that as long as credit is given, it is free to use. What of commercial games?
 

Atoa

Member

The system is good, but the configuration syntaxe is quite bad:
"Synth[0] = [32, ["i", 34, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]]"
Why instead of using an array you don't use an hash?
Something like
Synth[0] = {'id' => 32, 'result' => ['i',1], 'ingredients' => [["i", 45, 10], ["i", 46, 8], ["i", 47, 5]]}

that way you could also allow people to add how many ingredients they want, instead of an max of 8.
 
Atoa":1a3fu31i said:
The system is good, but the configuration syntaxe is quite bad:
"Synth[0] = [32, ["i", 34, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]]"
Why instead of using an array you don't use an hash?
Something like
Synth[0] = {'id' => 32, 'result' => ['i',1], 'ingredients' => [["i", 45, 10], ["i", 46, 8], ["i", 47, 5]]}

that way you could also allow people to add how many ingredients they want, instead of an max of 8.

Because The Hash is over used :P I like the array syntax better :) plus look how much longer yours is compaired to mine xD

Atoa":1a3fu31i said:
azrith001 wrote:someone beat us to the punch so I decided to release it to all of you :)If you didn't find it, then what do you mean by this? ^^^

lolz :D well I ment the craftign system In the game we were making this for :P someone beat us to the punch of finishing it :P
 
Is there a way to switch the Item name and Icon with the Recipe Name and Icon?
So instead of the main menu saying
Recipe 1
Recipe 1
Recipie 2
Recipe X

to
Potion
Tonic
Sword
X

And have the recipe required in the little right window?
 

Atoa

Member

Because The Hash is over used :P I like the array syntax better :) plus look how much longer yours is compaired to mine xD
Longer... but more organized and would allow you to have an higher limit of materials (instead of a max of 8) and prevent mistakes.
Well whatever, it's just a matter of taste.
 

Zeriab

Sponsor

You can have the second element be an array of arrays. Don't change to a hash because you want a higher limit of materials.
"Synth[0] = [32, [["i", 45, 10], ["i", 46, 8], ["i", 47, 5]], ["i", 1]]"

In terms of organizing I would create classes for them using the struct element
[rgss]Recipe = Struct.new:)item_id, :items, :result)
Recipe_Component = Struct.new:)type, :item_id, :amount)
Recipe_Result = Struct.new:)type, :item_id)
[/rgss]

Setting up those classes takes more time so a generation mechanism which converts the former to the latter could be preferable. It is just so much easier to manage the recipe if its built up like that.

*hugs*
 
Zeriab":1ywvlm2x said:
You can have the second element be an array of arrays. Don't change to a hash because you want a higher limit of materials.
"Synth[0] = [32, [["i", 45, 10], ["i", 46, 8], ["i", 47, 5]], ["i", 1]]"

In terms of organizing I would create classes for them using the struct element
[rgss]Recipe = Struct.new:)item_id, :items, :result)
Recipe_Component = Struct.new:)type, :item_id, :amount)
Recipe_Result = Struct.new:)type, :item_id)
[/rgss]

Setting up those classes takes more time so a generation mechanism which converts the former to the latter could be preferable. It is just so much easier to manage the recipe if its built up like that.

*hugs*

ty I will see what I can do :P


JJDulin":1ywvlm2x said:
Is there a way to switch the Item name and Icon with the Recipe Name and Icon?
So instead of the main menu saying
Recipe 1
Recipe 1
Recipie 2
Recipe X

to
Potion
Tonic
Sword
X

And have the recipe required in the little right window?


yes there is :) and yes :P just change the database item name to Potion Tonic Sword etc..
 
So bascially, change the recipe item name to the linked item? That works when it's a 1-1 linking, but what if i want to link three items to one recipe? Like link Potion, Perfume and Tonic to 'Potion recipe 1'?
 
i cant seam to find where i add my own code to add new recipies or where its showing recipy one like 6 times

i like the system but i cant seam to find where 2 manipulate it to add more recipies and clean up the repeated ones if you should like in a bit on it whats says then name of the code thing eg (Cache Function and then where abouts in all the 4 difrent mods i gota change) possibly when scripting have some green writing with it to showstart/end of the difrent recipies so its alot easyer to find the place to adding new ones / removing others

O dw i understand now
 
OK just to clear up any confushion about it like what i had with where to change stuff to make it all work >,< i thought id try explain it in a way mess script orrentated people can understand so hear it goes ......( if my trying to make it simplified offends you azrith001 i apologige but i think it will make your good work more userfriends to understand if you know about zip in code language)

After downloading azrith001's crafting system above. or to see what i already edited on mine so you can follo my steps easyer try this http://www.mediafire.com/download.php?qmwjmmcmow5
( also all credit should go to azrith001 i think as i only understood his code and then orginised it to my likeing)

1. open the program in RMXP so get to the editing thing ( Game.rxproj )

2.Next ill show where things are set up which is in the normal databace.
so open databace and look in items ( if you have the one i orginised youll see i have a big list of recies
set up there ( 1 herb in there as well) and the occasion is set up so you can only use them from the
menu, with a scope of none.(notice that in orger to have the uneing in the menue youll need to do what
i did with common event ( makeing it so it can say what it dose with some text and give you a new recipie
of it as its used like an item) if you dont want it to say what it dose make it .... Occasion: Never

remember that the number accigned to it is important 4 the script to recognise (eg my recipe 1 is number
23 )after seting one of them up in the databace you can use it to display a recipe in the crafting menu
( also its Icon can be changed as well but i like the recpie icon so im keeping it as Recipe )
Now The name of the recipe in this databace slot is what the recipe name is when its displayed in the
crafting menu.

3. Exit databace and enter the script editor (F11) is a shortcut key
Scroll down the list of script untill you find " Scene_Craft " and look at that section of code.

Right at the top after the Green explination is stuff that looks like
My orginisation virshion

Synth[0] = [23, ["i", 39, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]]
Synth[1] = [24, ["i", 39, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]]
Synth[2] = [25, ["i", 39, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]]

azrith001 orginisation virshion ( his is better for showing muti ingredens needed 4 a craft)

Synth[0] = [32, ["i", 34, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]]
Synth[1] = [31, ["w", 1, 1], ["i", 2, 8], nil, nil, nil, nil, nil, nil, ["w", 3]]
Synth[2] = [32, ["i", 1, 3], ["i", 34, 15], nil, nil, nil, nil, nil, nil, ["i", 3]]

ok so what dose this all mean ????? XD
Synth[0] ok well the number in the [ ] is what number in the list on crafting menu eg: the order so 0
Synth[1] is the first one, 1 is the second one and so on ( they must all be difrent and best to keep them
Synth[2] going up 1 at a time as you make another.

Now the = [23, is the next part ( i got 23 off fist line in my orginising first one is = [32, on azrith001's)

if you rememebr in databace the item slot fo Recipe 1 had its number as 23 so.... this is what the number
relats to. so you must have the item acociated with that number in invintory so see the recipe. ( best idear
is make it a recipe not somthing random like a potion ( so if you not shure just check your databace for the
right number and if need be make a ner recipe slot int the items part ( easy to just copy an old one and
change name)).

Next is the setup of the items needed for crafting the new item.
Synth[0] = [23, ["i", 39, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]]

If you look at the line ["i", 39, 3], this is how it works out what item(or wepon,armmor) is used to create
the new item it works like this.

["i", = The item page in databace ( "w" = wepon page, "a" = armmor page)
39, = reffers to the number on the list on databace ( simmilar to the 23 used to find recipe )
except you want it to find an item ( on mine 39 is set to the Herb ) in the databace
If you doing wepon's or armmor its the same setup its the number in the wepon/armmor list on
their page.
3], = this last part is how many of the item you want used to make the item ( for my line of code it is
3 which means i need 3 herb's to make the new item.( you can put in any number for 1-99 and
that will be how many you need to make the item.


The next part in my code is nil, which jsut means that you dont want anymore items needed in the
craft for the second slot so when you happy with whats already needed you fill the last 8 slots with this.
thats what iv had done to my last 7 slot's.

If you want more than one item needed to make the craft then you need to change the nill to another
line of ["i", 39, 3], instead of nil, ( remember you will need to change the ["i" , 39, 3], to show other
items needed in the craft ( reffear to the above if you not shure how to define )

Synth[1] = [31, ["w", 1, 1], ["i", 2, 8], nil, nil, nil, nil, nil, nil, ["w", 3]] This is the second line of recipies
on azrith001's and shows useing more than one item in recipe. BY filling more of the nil, with these you
add the number of ingredence needed you should get the hang of that fearly quick ( also futher down the
lines of code on azrith001's script you see one that uses 7 and also 8 items to create wepon ( his
ultimate wepon is a 7 slot).

The last part of this code ["i", 1]] Shows what the item that is created is. it follos the same format as the
rest of this code with ["i", meaning weather this item is in wepon/armmor/item list and the 1]] on
the end is saying which number in that list this item is. ( so by useing ["i", 1]] at the end on my
orginisating on the databace you will get 1 potion form the recipe)

Hint: when you make a new recime its often easyer to jsut copy a previous line of code (recipe) and past it underneather and sjut change its details.

eg: Synth[0] = [23, ["i", 39, 3], nil, nil, nil, nil, nil, nil, nil, ["i", 1]] can be copper so underneath

Synth[1] = [(number in item list that has recipe), [(the items you want it useing ], nil, nil, nil, nil, nil,
nil, nil, [(and the iem you want in the end)]]


I think thats about everything that i needed to do to make new recipies with azrith001's script

**But make shure that the databace has got the items your linking ot or it will mess up**
 
np i found when i was trying t use it it got confusing ( someone helped me finhd my place and then i was able to work it out but i dident want others confused like i was ( and iv always been good at explaining something if i undrstood it) so if i find thereads that are sonfusing but i an work it out ill normaly try do 1 of them ifiv got time
 
I like this script a lot, it's very nice. However, I copied the scripts into my game and I cannot get to the craft screen. In the Demo, the craft selection is normally where end game would be located, but that is not the case, in my game, where I simply copied the scripts. Any help would be appreciated.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top