Jump to content

Recommended Posts

I updated the script again. I tested a recipe with gold as an ingredient, product, and required item now with no problems so hopefully it works for you now :)

Sorry about all the errors XD I kind of threw in support for gold as a last minute thing.

Share this post


Link to post
Share on other sites

Hi! I've tried out this script and everything seems to be working fine for the most part, but learned recipes aren't appearing when i call a crafting event. These are the alterations I've made and the script call:

    PROFESSION[1] = {
    :name => "Smithing",
    :symbol => :smithing,
    :discovered => true,
    :level => 1,
    :max => 99,
    :exp => 0,
    :exp_curve => [10, 0, 10, 10],
    :exp_array => nil,
    :image => nil,
    :icon => 1179,
    :color => Color.new(65,105,225),
    :show_recipes => true,
    :recipe_type => :smithing,
    :desc => ["Allows you to craft equipment."]

 

 


    RECIPE[2] = {
    :name => "Long Sword",
    :ingredients => [[:item, 71, 2], [:item, 108, 1]],
    :required => [[:item, 109, 1]],
    :product => [:weapon, 7, 1],
    :scrap => [:item, 110, 1],
    :type => :smithing,
    :discovered => true,
    :time => 180,
    :success_rate => 100,
    :symbol => :longsword,
    :experience => 5,
    :level_req => 1,
    :icon => 5144,
    :image => nil,
    :color => 2,
    :start_sound => "Hammer",
    :fail_sound => nil,
    :complete_sound => nil,
    :desc => ["Forge a long sword."]
    }

 

 

SceneManager.call(CSCA_Scene_Crafting)
SceneManager.scene.prepare(:smithing =>
"Smithing")

 

Any chance you can help out with this?

Share this post


Link to post
Share on other sites

Your prepare script call is wrong:

SceneManager.call(CSCA_Scene_Crafting)

SceneManager.scene.prepare(:smithing =>
"Smithing")

It should look like this:
 

SceneManager.call(CSCA_Scene_Crafting)
SceneManager.scene.prepare(:smithing)

Also remember to add smithing to the SCENE_NAMES hash.

Share this post


Link to post
Share on other sites

Hm...Now I'm just getting a nomethod error

 

I assume it's supposed to look like this but i get an error unless i add a comma after "Cooking" and "Smithing" and after I do that, i get the same results as before. I checked that everything is spelled right and everything should be in the right place, the error says it's at line 977 and occurs after i learn the recipe and call the event rather than calling the event without learning the recipe

 

    SCENE_NAMES = {
    :all => "Crafting",
    :cooking => "Cooking"
    :smithing => "Smithing"

    }

 

SceneManager.call(CSCA_Scene_Crafting)
SceneManager.scene.prepare(:smithing)

 

So these are the additional changes up here

-----

Well i was in the middle of typing this and it turns out that i fixed the problem just by erasing the error lines (which was apparently 977 and 982) but now the problem's a little different: Everything is working fine except that I can't seem to be able to craft it even with the required items and being at the required level.

Share this post


Link to post
Share on other sites

The line number doesn't matter, as your line numbers will be different from mine (because of the added recipes and stuff).

You need a comma after "cooking" but not "smithing".

What does the whole nomethod error you are getting say?

Share this post


Link to post
Share on other sites

Script 'csca_crafting' line 977 NoMethodError occured.

undefined method 'icon_index' for nil:NilClass

 

Didn't work so I erased it and then...

 

      draw_icon(item.icon_index, x, y)

 

...The line I erased to get it to (sort of but apparently not really) work when it showed up a second time

 

      draw_text(x, y, contents.width-x, line_height, sprintf("%d%s", @recipe.required.amount, item))

Share this post


Link to post
Share on other sites

Well, first of all, it's highly recommended that you don't erase lines that you don't know what they do as you've likely caused more problems than you've solved. (You should probably put the lines you erased back).

Secondly, it might be easier and faster if you send a demo of your problem to me via PM so I can open it up myself and see what the problem may be.

Share this post


Link to post
Share on other sites

Sorry if this is kind of a stupid question, but how exactly do I open the crafting screen up? Or is it not suppose to show up in the menu? I'm less than a novice when it comes to scripts. :P

Share this post


Link to post
Share on other sites
#==============================================================================
# ** Calling the Crafting Scene
#==============================================================================
# You must call the recipe scene, as well as prepare it for a certain recipe type
# or all recipe types. To do so, make the following script call:
#
# SceneManager.call(CSCA_Scene_Crafting)
# SceneManager.scene.prepare(SCENE_NAME_SYMBOL_HERE)
#
# Where the preparation parameter will be a symbol, such as :all or :cooking,
# specified in the SCENE_NAMES hash below.


So for example, you could do:
 
SceneManager.call(CSCA_Scene_Crafting)
SceneManager.scene.prepare(:all)

in an event script call.

Share this post


Link to post
Share on other sites

Hey casper, I think when developer adds more than 6 ingredient the other  ingredient couldn't fit into the window and just.

:ingredients => [[:item,60,1],[:item,59,1],[:item,51,2],[:item,19,3],[:item,14,15],[:item,22,8],[:gold,0,1300]],

It won't fit all the ingredients into the ingredients section and went way down and can't been seen. IT would be nice to scroll down the ingredient if they have more than 6 ingredients that couldn't fit the window

Share this post


Link to post
Share on other sites

I tried making my own custom ingredient and my own custom crafting group. I keep getting this error

 

undefined method 'name' for #<ArrAY:0XC23254C>
 
Here is how I have the section of the script the I changed set up. I simply copied over the 1st recipe and changed it since I was having problems with it before.
 
 
    SCENE_NAMES = {
    :all => "Crafting",
    :cooking => "Cooking",    
    :tend => "Bartending"
 
    }
    
    #RECIPE[x] = {    # the value inside the brackets should start at 0 and ascend in order.
    #:name => "Apple Pie",    # The name of the recipe.
    #:ingredients => [[:item, 1, 5], [:item, 2, 3]],  # The consumed ingredients for the recipe. Explained more below.
    #:required => [:item, 3, 1], # The required item for the recipe. Explained more below.
    #:product => [:item, 4, 1],  # The item the recipe produces if successful. Explained more below.
    #:scrap => [:item, 5, 1],    # The item the recipe produces if unsuccessful. Explained more below.
    #:type => :cooking,          # The recipe type. All recipes of the same type will be shown in the crafting list determined by the SCENE_NAME specified.
    #:discovered => false,       # Determines if the player has unlocked the recipe or not. Undiscovered recipe's will not show in the recipe list.
    #:time => 120,               # The time, in frames (60f = 1sec) the recipe takes to create. Recommended to set above 2.
    #:success_rate => 100,       # The chance a recipe has at successfuully producing its :product rather than its :scrap . Range 0 - 100
    #:symbol => :applepie,       # The recipe's symbol. Used in script calls to specify the individual recipe.
    # * :experience => 10,       # The experience granted by the recipe.
    # * :level_req => 1,         # The required skill level to be able to craft the recipe.
    #:icon => 559,               # The icon associated with the recipe.
    #:image => nil,              # The image associated with the recipe. 72x72, located in the "Graphics" folder. Set to nil if not using.
    #:color => 2,                # The text color of the recipe name.
    #:start_sound => "Hammer",   # The SE played when starting to craft the recipe. Located in "Audio/SE" folder.
    #:fail_sound => nil,         # The SE played when recipe is unsuccessfully completed. Located in "Audio/SE" folder.
    #:complete_sound => nil,     # The SE played when recipe is successfully completed. Located in "Audio/SE" folder.
    #:desc => ["Delicious Apple Pie.","HP Restoration item."] # The descriptive text displayed in the recipe information window. Each block of text is 1 line.
    #}
    # * Requires CSCA Professions to function.
    #
    # HOW TO SET UP THE INGREDIENTS/REQUIRED/PRODUCT/SCRAP ITEMS.
    # Items are set up like this: [symbol, id, amount]
    # where [symbol] is either :item, :weapon, :armor, or :gold.
    # the [id] is the ID of the item/weapon/armor. Gold does not use an id, so leave it as 0. EXCEPTION: If using CSCA Currency System, set the id to the currency symbol when using :gold.
    # the [amount] is how much of the specified object is required.
    # the :ingredients support unlimited items, however :required, :product, and :scrap only support 1 item each. The :required parameter is optional; set to nil if not using.
    
    RECIPE[0] = {
    :name => "Apple Pie",
    :ingredients => [[:gold, :g, 5]],#, [:item, 2, 3]],
    :required => [:gold, :g, 100],
    :product => [:item, 18, 1],
    :scrap => [:item, 5, 1],
    :type => :cooking,
    :discovered => false,
    :time => 120,
    :success_rate => 100,
    :symbol => :applepie,
    :experience => 10,
    :level_req => 1,
    :icon => 559,
    :image => nil,
    :color => 2,
    :start_sound => "Hammer",
    :fail_sound => nil,
    :complete_sound => nil,
    :desc => ["Delicious Apple Pie.","HP Restoration item."]
    }
    
    RECIPE[1] = {
    :name => "Beer",
    :ingredients => [[:gold, :g, 5]],#, [:item, 2, 3]],
    :required => [:gold, :g, 100],
    :product => [:item, 18, 1],
    :scrap => [:item, 5, 1],
    :type => :tend,
    :discovered => false,
    :time => 120,
    :success_rate => 100,
    :symbol => :beer,
    :experience => 10,
    :level_req => 1,
    :icon => 559,
    :image => nil,
    :color => 2,
    :start_sound => "Hammer",
    :fail_sound => nil,
    :complete_sound => nil,
    :desc => ["Delicious Apple Pie.","HP Restoration item."]
    }

 

Can you find anything I did wrong?

Share this post


Link to post
Share on other sites

You'd need to script it yourself. To do so, you'd check each frame for button input, and then adjust the y values of the ingredient list based off the input. Likely to be too hard for a beginner (not sure your scripting capabilities).

Share this post


Link to post
Share on other sites

I'm terrible a scripting and that's why I just need the code for the frame to do it


def draw_ingredients(y) s1 = "Ingredients: " x = 0 ny = 0 change_color(system_color) draw_text(x, y, contents.width-x, line_height, s1) change_color(normal_color) x += text_size(s1).width @recipe.ingredients.each do |ingredient| @y_add += line_height item = case ingredient.type when :item; $data_items[ingredient.id] when :weapon; $data_weapons[ingredient.id] when :armor; $data_armors[ingredient.id] when :gold; $imported["CSCA-CurrencySystem"] ? $game_party.get_csca_cs_currency(ingredient.id)[:currency_unit] : Vocab::currency_unit end if ingredient.type == :gold change_color($game_party.get_csca_cs_currency(ingredient.id)[:color]) if $imported["CSCA-CurrencySystem"] draw_text(x, y + ny, contents.width-x, line_height, sprintf("%d%s", ingredient.amount, item)) change_color(normal_color) else draw_icon(item.icon_index, x, y + ny) x += 24 draw_text(x, y + ny, contents.width-x, line_height, sprintf("%dx %s", ingredient.amount, item.name)) end ny += line_height x -= 24 end end

can you tell me what to add on the above code?

Share this post


Link to post
Share on other sites

Hey there Casper667!

 

Okay, I'm already using your core script and your encyclopedia on my current project, and I have an idea for a symbiotic pair of character classes.

 

1st class can take blank runes and use magic points to fill them with elemental magic, and use the runes like stored magic spells.  The 2nd class can take filled runes and fit them inside runic weapons and armor, but can also take runes and using TP can combine them in various ways, either by stacking same type runes to make higher level runes or by adding multiple types together to create hybrid runes.  The cool part is the 1st class that can make the runes can then use the combined runes for stored spells, and the 2nd class can still use them in the weapons and armor.

 

My question is, can this crafting script be used for such a system, and if so, can you think of anything I would need to know to use this script for it?

Share this post


Link to post
Share on other sites

@Wren I'm not sure this script would do what you want. This script does not support MP or TP as a crafting ingredient, and to infuse a weapon with a rune, you'd have to make the different weapons individually in the database, stats of a weapon cannot be modified with this script. Hybrid rune crafting would probably be feasible, but that sounds like one of the only features you want that would be easily set up with this script. You may be better off requesting a completely new script (this crafting script is very easily added on to other scripts, so whoever takes on your request wouldn't necessarily have to code their own crafting scene). I'd also check out the materia script, as that sounds a little closer to what you want. There are other crafting scripts out there that may also be better suited to what you want, I haven't checked them out much. Downloading and testing this script yourself won't cause any harm though, so you could always experiment yourself and see if what you come up with is acceptable or not :)

 

@Amber No, sorry.

Share this post


Link to post
Share on other sites

What is causing this error?

Script 'CSCA Crafting' line 1006: NoMethodError occured
undefined method 'icon_index' for nil:NilClass

Share this post


Link to post
Share on other sites

 

What is causing this error?

Script 'CSCA Crafting' line 1006: NoMethodError occured
undefined method 'icon_index' for nil:NilClass

The line number is off, since you've added/modified settings. Knowing the method would be more helpful, also knowing your setup too. If I had to guess, one of your ingredients' symbols (:gold, :item, :weapon, :armor) may be mispelled, or your ingredients parameters may be in the wrong spot.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted