Jump to content


Photo

CSCA Crafting

csca crafting

  • Please log in to reply
65 replies to this topic

#1 casper667

casper667

    Advanced Member

  • Member
  • 548 posts
  • RM Skill - Jack of All Trades

Posted 09 May 2013 - 08:11 AM

CSCA Crafting
By: Casper Gaming (Casper667)
Last Update: May 17, 2013
Latest version: 1.0.4

Introduction
Allows you to easily set up crafting recipes, while remaining a powerful crafting script. Can show only recipe's of a certain type in the crafting scene. Can note tag armors/weapons to increase crafting stats. Intended for use with CSCA Professions but not required. Lots of customization.

 

Supports CSCA Currency System currencies in crafting recipes.

Screenshots

Discovering new recipes. Toast messages shown only if using the CSCA Toast Manager.
craftdisc.png

The crafting menu! It can differentiate between, say, cooking and alchemy recipes.

craftcooking.png

If using the CSCA Toast Manager, crafting result window will be displayed! Works well with CSCA Professions.

craftcomplete.png

How to Use
Place in your materials section. Setup required. Instructions in script.

 

Updates

version 1.0.1

- Bug fix: Ingredients should now display properly.

 

version 1.0.2

- Bug Fix: Required Items/Products can now be weapons, armors, and gold too.

 

version 1.0.3

- Bug Fix: Errors dealing with required items should now be fixed. (finally)(hopefully)
- CSCA Currency System colors now show in the crafting info window.

 

version 1.0.4

- Bug Fix: Errors dealing with gold and CSCA Currency System should be fixed now.

 

Script
Text file is found here(copy and paste everything into your script editor in the materials section): LINK
Requires CSCA Core Script to work properly - Get it here!

Optional: For the discovery/craft result windows, you'll need CSCA Toast Manager - Get it here!

Optional: For a full profession system that works well with the crafting system, use CSCA Professions! - Get it here!

 

Credit
Casper Gaming

Terms
http://www.caspergam...rms_of_use.html


Edited by casper667, 17 May 2013 - 10:58 AM.


#2 harvard1932

harvard1932

    Advanced Member

  • Member
  • 51 posts

Posted 09 May 2013 - 08:51 AM

This script reminds me the crafting system in Aion. :DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

WANTTTTTTTTTTTTTTTTTTTTTTTTTTTT



#3 demonking39

demonking39

    Member

  • Member
  • 22 posts
  • RM Skill - Jack of All Trades

Posted 10 May 2013 - 02:15 PM

Hey Casper, awesome script. I only have one issue with it. When you use a weapon or armour as an ingredient it is displayed under the crafting menu as the ITEM with that ID. So if the ingredient is a dagger, for example, it would be weapon[2] and would go into your script like [:weapon, 2, 1]. However, the menu would show it as item[2], in my case that's Hi-Potion. It's using the dagger as the ingredient, so that parts right, but it's displaying it as a Hi-Potion for some reason.

 

I think the issue is in the way the script draws the ingredients here:

 

#--------------------------------------------------------------------------
  # Draw ingredients
  #--------------------------------------------------------------------------
  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 = $data_items[ingredient.id] # I think that this line is telling the crafting menu to get all its ingredient information ONLY from the items list
      draw_icon(item.icon_index, x, y + ny)
      x += 24
      draw_text(x, y + ny, contents.width-x, line_height, sprintf("%sx %s", ingredient.amount, item.name))
      ny += line_height
      x -= 24
    end
  end

 

I don't have much scripting knowledge, and I'm not even sure if I'm right about this issue, but I would really appreciate any help you can offer to resolve this issue.



#4 casper667

casper667

    Advanced Member

  • Member
  • 548 posts
  • RM Skill - Jack of All Trades

Posted 10 May 2013 - 04:16 PM

Argh, I'm an idiot. I'll fix it when I'm done making/eating my pizza.

 

Script updated! :)

 

version 1.0.1

- Bug fix: Ingredients should now display properly.


Edited by casper667, 10 May 2013 - 05:43 PM.


#5 demonking39

demonking39

    Member

  • Member
  • 22 posts
  • RM Skill - Jack of All Trades

Posted 10 May 2013 - 06:40 PM

Haha thanks Casper! And you're definitely no idiot my friend, even geniuses are allowed to make small oversights from time to time! 



#6 poundcakery

poundcakery

    Newbie

  • Member
  • 7 posts

Posted 12 May 2013 - 01:59 PM

this script is just what i'm looking for, thank you for making it!

I have one question, i'm having trouble figuring out the discovery script call( i put the script call in quotes below). could someone provide an example of how this script call should be used? thanks!

 

 discover_recipe(recipe[, discovered])



#7 casper667

casper667

    Advanced Member

  • Member
  • 548 posts
  • RM Skill - Jack of All Trades

Posted 13 May 2013 - 09:34 AM

this script is just what i'm looking for, thank you for making it!

I have one question, i'm having trouble figuring out the discovery script call( i put the script call in quotes below). could someone provide an example of how this script call should be used? thanks!

 

 discover_recipe(recipe[, discovered])

It would look something like this:
 

discover_recipe(:applepie)

 

The []'s just mean that the parameter discovered is optional. If you want to set a recipe to undiscovered, you'd do
 

discover_recipe(:applepie, false)


#8 poundcakery

poundcakery

    Newbie

  • Member
  • 7 posts

Posted 13 May 2013 - 10:07 AM

oh okay, thank you so much for clarifying! :)



#9 Jennestia

Jennestia

    Advanced Member

  • Member
  • 97 posts
  • RM Skill - Designer

Posted 13 May 2013 - 06:06 PM

Awesome script~ I appear to have an issue

---------------------------
Echoes of Eternity ~ Distant Echoes
---------------------------
Script 'Craft' line 511: NameError occurred.

undefined method `refresh' for class `CSCA_Window_Toast'
---------------------------
OK   
---------------------------


 

that points to 511:

  alias :csca_craft_refresh :refresh

It appears to happen right as I load the game - granted it has been a year or two since I've been able to do anything RPG related so I made sure everything is as up to date as possible but I may simply be missing something obvious haha.


Edit: Removed script list, it appears to have been one of my custom scripts I wrote recently that regards summoning ^^. Got the issue resolved!


Edited by Jennestia, 13 May 2013 - 06:27 PM.

~*Playlist for my Project, Tears of Eternity ~ Silent Whispers (Known as Echoes of Eternity ~ Somber Sorrows) OST*~ (Playlist being updated ~ Songs are remastered versions..)
~*Current Project: Echoes of Eternity ~ Somber Sorrows*~
(Offsite, to be updated!)
Progress~
Echoes of Eternity - Somber Sorrows (VX) - 100% (Japanese)

Translation (English) - Canceled - Localization help needed.
Tears of Eternity ~ Silent Whispers (EoE  ~ Somber Sorrows Remaster) (VXA) - 100% (Japanese)
Translation (English) - 17%


#10 Amber

Amber

    Advanced Member

  • Member
  • 155 posts

Posted 13 May 2013 - 07:07 PM

I got some few erros:

  • Adding Gold for Product/Required or any of those ends up with draw_icon 
  • Already have Required Item, ends up with another nomethod error

 



I got some few erros:

  • Adding Gold for Product/Required or any of those ends up with draw_icon 
  • Already have Required Item, ends up with another nomethod error

 



#11 casper667

casper667

    Advanced Member

  • Member
  • 548 posts
  • RM Skill - Jack of All Trades

Posted 15 May 2013 - 09:09 AM

I got some few erros:

  • Adding Gold for Product/Required or any of those ends up with draw_icon 
  • Already have Required Item, ends up with another nomethod error

I updated the script. Hopefully your problems are fixed in the updated version.

 

version 1.0.2

- Bug Fix: Required Items/Products can now be weapons, armors, and gold too.



#12 Amber

Amber

    Advanced Member

  • Member
  • 155 posts

Posted 16 May 2013 - 02:03 AM

The version 1.0.2 doesn't solved my problem, I getting slammed on error due to

  • A recipe without required item (nil) doesn't work and end up with NoMethodError ( if @recipe.required.type == :gold)
  • Have an recipe with Gold requirement still get you this error (below if @recipe.required.type == gold)
  • Ok! Does it solve when you have the item you need to craft, I think NOT (items.each do |item|) and I'm not talking about Gold, Weapons and Armor here and yes, I do try to add Armor/Weapon as required item. I still end up with error explained above

This update is terrible, it won't let anyone craft an item/armor/weapon and even GOLD. I think you need to test this yourself to see it work



#13 demonking39

demonking39

    Member

  • Member
  • 22 posts
  • RM Skill - Jack of All Trades

Posted 16 May 2013 - 07:26 AM

The version 1.0.2 doesn't solved my problem, I getting slammed on error due to

  • A recipe without required item (nil) doesn't work and end up with NoMethodError ( if @recipe.required.type == :gold)
  • Have an recipe with Gold requirement still get you this error (below if @recipe.required.type == gold)
  • Ok! Does it solve when you have the item you need to craft, I think NOT (items.each do |item|) and I'm not talking about Gold, Weapons and Armor here and yes, I do try to add Armor/Weapon as required item. I still end up with error explained above

This update is terrible, it won't let anyone craft an item/armor/weapon and even GOLD. I think you need to test this yourself to see it work

 

Have you been changing the coding in the actual script or have you been setting up your recipes properly in the recipe section of the script? I tried to recreate your issue in my game and the only way it would give me those errors is when I went to the lines that caused you errors and changed their values. As for the issue involving gold as a required item, you need the CSCA currency system script in order for that to work. It references the script and checks to see if it's imported right before the line that gives you trouble.

The only error that I found is that the item data under the "draw required item" section is double referenced.

 

#--------------------------------------------------------------------------
# Draw required item
#--------------------------------------------------------------------------
def draw_required_item(y)
s1 = "Required Item: "
x = 0
item = case @recipe.required.type
when :item; $data_items[@recipe.required.id]
when :weapon; $data_weapons[@recipe.required.id]
when :armor; $data_armors[@recipe.required.id]
when :gold; $imported["CSCA-CurrencySystem"] ? $game_party.get_csca_cs_currency(@recipe.required.id)[:currency_unit] : Vocab::currency_unit
end
item = $data_items[@recipe.required.id]  #This line is double referencing the item line above that I hi-lighted as blue 
change_color(system_color)
draw_text(x, y, contents.width-x, line_height, s1)
change_color(normal_color)
x += text_size(s1).width
unless @recipe.required.type == :gold
draw_icon(item.icon_index, x, y)
x += 24
end
if @recipe.required.type == :gold
draw_text(x, y + ny, contents.width-x, line_height, sprintf("%s%s", @recipe.product.amount, item))
else
draw_text(x, y, contents.width-x, line_height, sprintf("%sx %s", @recipe.product.amount, item.name))
end
end

 

When I removed this line I stopped getting the error, so try it and let me know how it works for you.

 

Edit: That's actually your issue. That one line is double referencing the values for each defining line. So even if you put ":weapon" in the required item field, this line is trying to contradict it and that's what causes the error.


Edited by demonking39, 16 May 2013 - 07:31 AM.


#14 Amber

Amber

    Advanced Member

  • Member
  • 155 posts

Posted 16 May 2013 - 08:09 AM

I remove the troublesome line, but end up with this error and this line cause the error draw_product(oy)



#15 demonking39

demonking39

    Member

  • Member
  • 22 posts
  • RM Skill - Jack of All Trades

Posted 16 May 2013 - 08:21 AM

Yeah I just got that error too, I'm trying to rewrite that little part to see what I can do. If I don't get it I'm sure Casper will, just hang tight and be patient, help is on the way lol



#16 Amber

Amber

    Advanced Member

  • Member
  • 155 posts

Posted 16 May 2013 - 08:27 AM

I'll give Casper a demo so he can check whenever he's online



#17 demonking39

demonking39

    Member

  • Member
  • 22 posts
  • RM Skill - Jack of All Trades

Posted 16 May 2013 - 08:52 AM

Ok, I have resolved most of the issues, but I'm getting one that I don't know what to do with.

 

 

#--------------------------------------------------------------------------
  # Party has required items?
  #--------------------------------------------------------------------------
  def has_items(items)
    items.each do |item|   # I'm getting an undefined method error for "each" I tried to change that line to @recipe.items.each, but then I got the   same error except this time it's for the term "items".
      case item.type
      when :gold; next if $game_party.gold >= item.amount
      when :armor; next if $game_party.item_number($data_armors[item.id]) >= item.amount
      when :weapon; next if $game_party.item_number($data_weapons[item.id]) >= item.amount
      when :item; next if $game_party.item_number($data_items[item.id]) >= item.amount
      end
      return false
    end
    return true
  end
 
I have decided to go with the older version of the script and exclude the "required" field for the time being. The older version of the script works fine as long as you put "nil" in the required item field.
Sorry I couldn't be of more help, but this has exceeded what minimal scripting knowledge I have, and so I think it's best left in the hands of it's creator.

Edited by demonking39, 16 May 2013 - 09:07 AM.


#18 Amber

Amber

    Advanced Member

  • Member
  • 155 posts

Posted 16 May 2013 - 08:55 AM

I think casper knows about this.



#19 casper667

casper667

    Advanced Member

  • Member
  • 548 posts
  • RM Skill - Jack of All Trades

Posted 16 May 2013 - 09:56 AM

OK guys, I updated the script again. I have a few days off of my real life job now so I had a bit more time to test this update. I also added in that now the currency color will show in the crafting information window if using my currency system.

 

version 1.0.3
- Bug Fix: Errors dealing with required items should now be fixed. (finally)(hopefully)
- CSCA Currency System colors now show in the crafting info window.


Edited by casper667, 16 May 2013 - 09:57 AM.


#20 demonking39

demonking39

    Member

  • Member
  • 22 posts
  • RM Skill - Jack of All Trades

Posted 16 May 2013 - 11:23 AM

Hey just tested the script and it's working perfectly! Thanks for the awesome work Casper.

 

Just one thing I thought I would ask. Is it possible to use formulas to determine the success rate of a recipe?

 

So you could have something like :success_rate => 20 + v[1] + v[2]    (where v[1] could be the profession level and v[2] could be the number of times crafted)

 

So the higher the profession level and the more you make that item, the better you will get at making said item.







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users