I don't know what it's asking me to fix!

angelique

Veteran
Veteran
Joined
Feb 11, 2014
Messages
74
Reaction score
0
First Language
English
Primarily Uses
Correct. If you look at the recipe setup:

RECIPES = {

  0 => { :result => [0,1,1],

         :materials => [[0,4,2]],

         :gold_cost => 10,

         :success => 95,

         :success_gain => 1,

         :level => 5,

         :craft_level => 1,

         :category => :Baking,

         :xp => 50,

         :xp_deprac => 15,},

 

  1 => { :result => [0,2,1],

         :materials => [[0,4,1],[0,5,2,false]],

         :gold_cost => 50,

         :success => 90,

         :success_gain => 2,

         :level => 15,

         :craft_level => 1,

         :category => :Baking,

         :xp => 150,

         :xp_deprac => 20,},       

  2 => { :result => [0,3,1],

         :materials => [[0,4,1],[0,5,1],[0,6,2],[0,7,1],[0,8,1],[0,9,2]],

         :gold_cost => 150,

         :success => 85,

         :success_gain => 3,

         :level => 25,

         :craft_level => 1,

         :category => :Baking,

         :xp => 250,

         :xp_deprac => 25,},

  }

 

So recipe 0 creates 1 of item #1, requiring 2 of item #4; recipe 1 creates 1 of item #2, requiring 1 of item #4 and 2 of item #5; recipe 2 creates 1 of item #3, requiring 1 of item #4, 1 of item #5, 2 of item #6, 1 of item #7, 1 of item #8 and 2 of item #9.

 

The thing is, your database only has two items right now, Cupcake and Cupcake Recipe. The script is looking at your defined recipes and going "Okay, so this recipe needs this many of item #4. I need to show the icon for item #4...where is item #4? You don't have one!" *crash*

 

Make sense?
Yes but how do I add certain ingredients? Like for the cupcake I wanna add the following:

  • 1 strawberry
  • vanilla extract
  • whipped cream
  • sugar
  • flour
  • and eggs
?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,959
First Language
English
Primarily Uses
RMMV
Well you would have to actually create "strawberry", "vanilla extract", "whipped cream", "sugar", "flour" and "egg" items in the database, then change the recipe to match the item IDs and put in the quantity you want it to require. For example, say Strawberry is item 3, Vanilla Extract is item 4, Whipped Cream is item 5, Sugar is item 6, Flour is item 7 and Egg is item 8 (and for the sake of simplicity the recipe requires only 1 of everything except eggs, of which it requires 2): (note also that all items used as recipe materials must have an icon or the script will crash)

0 => { :result => [0,1,1],

         :materials => [[0,3,1], [0, 4, 1], [0, 5, 1], [0, 6, 1], [0, 7, 1], [0, 8, 2]],

         :gold_cost => 10,

         :success => 95,

         :success_gain => 1,

         :level => 5,

         :craft_level => 1,

         :category => :Baking,

         :xp => 50,

         :xp_deprac => 15,},
 
Last edited by a moderator:

angelique

Veteran
Veteran
Joined
Feb 11, 2014
Messages
74
Reaction score
0
First Language
English
Primarily Uses
Well you would have to actually create "strawberry", "vanilla extract", "whipped cream", "sugar", "flour" and "egg" items in the database, then change the recipe to match the item IDs and put in the quantity you want it to require. For example, say Strawberry is item 3, Vanilla Extract is item 4, Whipped Cream is item 5, Sugar is item 6, Flour is item 7 and Egg is item 8 (and for the sake of simplicity the recipe requires only 1 of everything except eggs, of which it requires 2): (note also that all items used as recipe materials must have an icon or the script will crash)

0 => { :result => [0,1,1],

         :materials => [[0,3,1], [0, 4, 1], [0, 5, 1], [0, 6, 1], [0, 7, 1], [0, 8, 2]],

         :gold_cost => 10,

         :success => 95,

         :success_gain => 1,

         :level => 5,

         :craft_level => 1,

         :category => :Baking,

         :xp => 50,

         :xp_deprac => 15,},
Ohhhh I see thanks ^w^

I'm getting this and I changed it putting the ID:

---------------------------

Dream Life

---------------------------

Script 'crafting' line 81: SyntaxError occurred.

 

unexpected ',', expecting tASSOC

...rials => [[0,4,2]],[[0, 3, 1]], [[0, 4, 2]], [[0, 5, 1]], [[...

---------------------------

OK   

---------------------------

 
 
Last edited by a moderator:

angelique

Veteran
Veteran
Joined
Feb 11, 2014
Messages
74
Reaction score
0
First Language
English
Primarily Uses
I'm going to try without...anyone know how to do recipes w/ 4+ items w/ an event?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
You have too many brackets. You need to do it as [[0, 3, 1], [0, 4, 1], etc.  You see, you are using an array within a hash, and the format is [ to start the recipie, then [] for each ingredient. Don't forget to end with a ]

If you have no idea what a hash is or an array, I'd honestly recommend looking up diamondandplatium3's videos on how to script. This script is NOT a beginner friendly script, and it is not recommended to try to use it (or any crafting scripts really) without studying scripting first.

As for how to do it in an event, use many conditional branches to see if all the items are present. See if the first item is present, if so check for the second, if so check for the third, etc.

However, you are going to be limited to 4 choices for crafting, period, due to the limit on the conditional choices. You may want to see how some of the other games have gotten around this (some have you use an inventory item to invoke crafting of that recipe for example).
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
Your config is wrong.


This is a right setup for ingredients:

:materials => [ [0,4,2],[0, 3, 1],[0, 4, 2],[0, 5, 1] ]Note:
One BIG array with many small arrays!


Not many double arrays, like you wrote.


Make sure to read the descriptions in the script, more time if needed. And make sure you don't make any typos anywhere in your configuration.
 

angelique

Veteran
Veteran
Joined
Feb 11, 2014
Messages
74
Reaction score
0
First Language
English
Primarily Uses
Ok I'm not getting the ID error but I'm getting the error for the gold cost...and I didn't change it.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,959
First Language
English
Primarily Uses
RMMV
angelique, whenever you get an error of some sort, you will accomplish literally nothing by just posting "I got an error". There is nobody on the face of the earth who can help you fix it if you don't tell us exactly what the error was and what you were doing when it happened. A screenshot is worth a thousand words.
 

angelique

Veteran
Veteran
Joined
Feb 11, 2014
Messages
74
Reaction score
0
First Language
English
Primarily Uses
I just copied what the error said though
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,959
First Language
English
Primarily Uses
RMMV
You said "Ok I'm not getting the ID error but I'm getting the error for the gold cost...and I didn't change it." none of that gives us an actual error.

It's kind of weird that you're getting any more errors at all considering I literally have your project in front of me working with the fixes we already gave you.
 

angelique

Veteran
Veteran
Joined
Feb 11, 2014
Messages
74
Reaction score
0
First Language
English
Primarily Uses
I haven't updated the download but the ingredient error is gone but it goes to the next line now for the gold cost
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,959
First Language
English
Primarily Uses
RMMV
Can you paste your RECIPES hash for me, please?
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
It goes to the next line because you did not put a comma at the end of the materials setup.


Each setting in the recipe hash must be separated with a comma.


I am writing this without having any clue what the error message you get (thanks to your "crash reports", if we can even name those like that), but seeing your errors from before, it is kinda 98% that I'm right.


As the others already pointed it out (multiple times), your way of reporting errors is not the way of doing it, at all.


You don't provide any information about the error message itself, let alone specifying the time it occurs, the specified line in the script (because due to the configuration of the user, the line reported to you might not be the same for other users of the script), and the changes you made to the script (if any). The only thing we can do with your reports is guessing, which you could do as well, because without the necessary information we are just as clueless as you are here.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,959
First Language
English
Primarily Uses
RMMV
Yeah, that's what I was driving at as the problem as well, Sixth.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
@OP: Posting a screenshot of the error message in full will go a long way to getting this fixed. That's what most posters do on here when they have an error, and it helps a *lot* in getting the problem fixed. You can use photobucket to upload the image, then you can post a link to it via the image button above.
 

angelique

Veteran
Veteran
Joined
Feb 11, 2014
Messages
74
Reaction score
0
First Language
English
Primarily Uses
The only way to get errors posted is by actually copying the message since I can't post pictures automatically and I don't wanna save them either or use a another site for hosting and I haven't been able to reply due to...outside reasons -_- unfortunately
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
By clicking on "More Reply Options", you get the option to add attachments (below the editor area). Of course the file needs to be present on your pc to be able to upload it, but you can safely delete it afterwards.
 

angelique

Veteran
Veteran
Joined
Feb 11, 2014
Messages
74
Reaction score
0
First Language
English
Primarily Uses
I can't open my project: "Unexpected file format" I saved my game before I turned off though so why am I getting this?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
I can't open my project: "Unexpected file format" I saved my game before I turned off though so why am I getting this?
You should never simply turn off your computer, you should always shut it down regularly.
That error basically tells that something damaged the project file(s), which usually happens if saving has been aborted by a crash or power failure.


Copy the project in its damaged form as backup, then make a new project. Copy the main project file from the new project to your project, overwriting the damaged project file - and hope that this is the only damaged file, because if more files are damage then you'll have lost some data
 

angelique

Veteran
Veteran
Joined
Feb 11, 2014
Messages
74
Reaction score
0
First Language
English
Primarily Uses
You should never simply turn off your computer, you should always shut it down regularly.

That error basically tells that something damaged the project file(s), which usually happens if saving has been aborted by a crash or power failure.

Copy the project in its damaged form as backup, then make a new project. Copy the main project file from the new project to your project, overwriting the damaged project file - and hope that this is the only damaged file, because if more files are damage then you'll have lost some data
Well good thing I uploaded my previous version onto MF just have to edit it
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top