Crafting Script v3.8 - Updated 2/26/2015

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Venka, Aug 30, 2013.

  1. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,747
    Likes Received:
    7,600
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    Ye but you don't have to do it that way was my point.
     
  2. gormack82

    gormack82 Villager Member

    Messages:
    7
    Likes Received:
    0
    First Language:
    Dutch
    This is some really impressive crafting system u made brah

    I try to do something with my extremely low program skill: To close the crafting window after u press an item to craft. I tried to modify

    def start crafting

    @claim_time = 

    blablblabla

    etc.etc.

    end

    to 

    def start crafting

    SceneManager.call(Scene_Map)

    end

    It goes back to the normal map for a moment then it automatically open the alchemy crafting window. How can I just close the windows after i press to craft a thing?
     
  3. Venka

    Venka Veteran Veteran

    Messages:
    945
    Likes Received:
    365
    Location:
    United States
    First Language:
    English
    If you look at the end of the main script you'll find a def that looks like this

    #---------------------------------------------------------------------------- # ○ new method: craft_start #---------------------------------------------------------------------------- def craft_start Sound.play_ok @detail_window.start_crafting while @detail_window.started Graphics.update Input.update update end @list_window.refresh @result_window.refresh if Pop_up_Window to_detail_window endchange the "to_detail_window" line to "return_scene"

    that should make it exit out after crafting the item and showing the result
     
    gormack82 likes this.
  4. Alkmayix

    Alkmayix Veteran Red Mage Member

    Messages:
    12
    Likes Received:
    0
    Location:
    United States
    First Language:
    English
    @Mlogan

    The issue I'm having is setting it up to do that...I understand what I need to do with the item that brings up the scene needing to be something that's there but never goes away. I need to know the actual process of setting up the item to do the scene call and such...I was gonna make it an item that would be in Key Items at one point. I ended up changing my mind and was hoping to make it pull up with an event, ie. touch a table and the menu comes up but I don't know what commands to do with the item so it does the scene calling and bring up the menus. So no, that doesn't totally answer what I'm having issues with.
     
    Last edited by a moderator: Aug 8, 2014
  5. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    Than use the same script call I wrote at the common event part, but instead of a common event, place the script call in a regular event.

    That is the script call you need to use whenever you want to open the crafting scene regardless of how you do it.

    Read the header of the Customize Settings script, you can find all script calls there with good explanations of what they do.

    Script calls can be used within the event box commands menu. 

    Create an event, double click on it, that brings up the event window, double click on the "Contents" box, this brings up the event commands.

    On this box, select the last page (3rd page), and the last option on the right side ("Advanced"/"Script..."). This option is usually referred as "script calls" in every custom script instructions.

    You could also look how Venka made the "Smithing" scene in the demo. The event which calls the "Smithing" scene in the demo is at the bottom left corner on the map. 
     
    Alkmayix likes this.
  6. Alkmayix

    Alkmayix Veteran Red Mage Member

    Messages:
    12
    Likes Received:
    0
    Location:
    United States
    First Language:
    English
    I can't download the demo w/o my browser saying it's malware and my anti-virus saying it's got a virus in it. What exactly to I put into the Script box after I select? Thank you for explaining where script calls are btw.  :)  Now I just need to figure out what to put into there. ^^;  Nevermind I see you posted what to do in an earlier post, my bad. I downloaded an older version of this script so I know I don't have the latest version, the file lists version 1.2b as it's script version. Unless that is the latest version of the script. ^^;
     
    Last edited by a moderator: Aug 8, 2014
  7. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    Wow, that's a pretty old version, I am not even sure if it uses the same script calls in that version. o_O

    You should really get the latest version, it got many more functions and it is much more customizable.
     
  8. Alkmayix

    Alkmayix Veteran Red Mage Member

    Messages:
    12
    Likes Received:
    0
    Location:
    United States
    First Language:
    English
    How to get it, I can't find it in the demo. :(  My god I'm an idiot, sorry. Duh just open the project.
     
    Last edited by a moderator: Aug 8, 2014
  9. Alkmayix

    Alkmayix Veteran Red Mage Member

    Messages:
    12
    Likes Received:
    0
    Location:
    United States
    First Language:
    English
    Ok, sorry for being annoying. I opened the project and see multiple scripts for this which do I need for the most basic useable version of the script? Just the Customization and 3.1 script?
     
  10. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    Yeah, just those 2 scripts.

    But read what the other scripts do, they are neat add-ons. :)
     
  11. Alkmayix

    Alkmayix Veteran Red Mage Member

    Messages:
    12
    Likes Received:
    0
    Location:
    United States
    First Language:
    English
    I just tried to test it with just 1 recipe and I got this error, I didn't add any of the add-ons atm. What I did was make an event where it brings up text "Would you like to cook?" then it shows choices "yes" and "no" whenever I select yes I get this error. I made a script call "craft_1" for cooking within the event. Not adding add-ons until I can figure it out first. XD

    error.png
     
    Last edited by a moderator: Aug 8, 2014
  12. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    You need to type

    craft(1) into the script box, not "craft_1".There are actual practical examples in the script header, read them carefully.

    And note that if you just simply copy pasted the customization part of the script, you need to have all the items in the script set up in your database also or else it will throw errors left and right.

    For example, the default customization script contains some recipes which use items with the ID of 19, 20, 21, 22 ... 40, etc.

    By default, these items are not made in the database (the default database contains only 16 items!).

    Either delete the pre-made recipes and make your own ones, or make the items in your database, or change the recipe settings so that it doesn't contain non-existent items from your database.
     
  13. Alkmayix

    Alkmayix Veteran Red Mage Member

    Messages:
    12
    Likes Received:
    0
    Location:
    United States
    First Language:
    English
    The examples looked like "craft_1, I just didn't stick it into "()" I'll try it again, thank you.

    Okay now I get another error, but I never touched the specified line ; ; 

    Nvm I figured it out, crafting can't be cost free.

    error.png
     
    Last edited by a moderator: Aug 9, 2014
  14. Venka

    Venka Veteran Veteran

    Messages:
    945
    Likes Received:
    365
    Location:
    United States
    First Language:
    English
  15. Alkmayix

    Alkmayix Veteran Red Mage Member

    Messages:
    12
    Likes Received:
    0
    Location:
    United States
    First Language:
    English
    By chance is there a way to make it so crafting can be made free? Whenever I tried to I kept getting an error about the game trying to divide by 0. XD
     
  16. gormack82

    gormack82 Villager Member

    Messages:
    7
    Likes Received:
    0
    First Language:
    Dutch
    Wow such a quick reply  :) it works thx brah
     
  17. Venka

    Venka Veteran Veteran

    Messages:
    945
    Likes Received:
    365
    Location:
    United States
    First Language:
    English
    Ok when you set up a recipe it normally looks like this:

    Recipes[9] = { # Hi-Potion :recipe_type => 3, # Alchemy Recipe :req_level => 3, # Level required to use this recipe :craft_time => 700, # Time it takes to make the item :earned_exp => 70, # Exp gained on success :crafted_item => [:i2, 1], # Makes 1x Hi-Potion :failed_item => [:i45,1], # 1x Gelatinous Goo when crafted too late :ingredients => [# 3x Potions, 1x Diamond Dust [:i1, 3], [:i44, 1], ]} # <- DO NOT REMOVE
    You'll need to skip the :ingredients lines and to close it out you'll use just a single "}" instead of the "]}".   Like so

    Recipes[10] = { # Hi-Potion :recipe_type => 1, # Alchemy Recipe :req_level => 1, # Level required to use this recipe :craft_time => 100, # Time it takes to make the item :earned_exp => 10, # Exp gained on success :crafted_item => [:i2, 1], # Makes 1x Hi-Potion } # <- DO NOT REMOVEYou'll also need to replace your main script with this one:

    https://www.dropbox.com/s/n5fke1ldy6ufrkp/no%20ingredients%20crafting.txt

    It won't work with any of the add ons right now. I'll work on those and PM them too you soon. It's about to start a four day weekend for me and not sure how much I'll be on the pc

    edit: you will also more then likely need to start a new game for these changes. It might work with an old save file, but I'm not 100% sure on that.
     
    Last edited by a moderator: Aug 9, 2014
  18. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    Well, I have finished my new version of the result window, and cleaned up the code a bit (still messy, mind you :p ), so I might as well post it.

    Here is the code:

    This became harder than I initially thought, because of the lot of possibilities and variables.
    The code grow in size as well, so instead of putting it up in a spoiler, I will just upload it.
    Waiting for bug reports (there can be only visual bugs/anomalies, I guess, but still)... :D

    Updated the addon (v.1.1d)!
    Nothing serious, just removed a piece of code which has caused some problems in certain cases (still don't know why >.>).
    Turns out, that piece of code is not needed anymore anyway.
    Also added extra info about some placement issues when using the Shop Recipes addon. Not directly related to my addon, but it is important anyway.
    You need to put that addon below Vlue's Randomizer script or else the Shop Recipes addon will not function properly if you enabled the random items from the shop in Vlue's script setup!

    Here are some screenshots too:
    nonboxver2.PNG boxver1.PNG boxver2.PNG nonboxver1.PNG

    Known Compatibility Issues:
    No known compatibility issues for now.
     
    Last edited: Feb 6, 2017
    SpacemanFive likes this.
  19. Alkmayix

    Alkmayix Veteran Red Mage Member

    Messages:
    12
    Likes Received:
    0
    Location:
    United States
    First Language:
    English
    You'll need to skip the :ingredients lines and to close it out you'll use just a single "}" instead of the "]}".   Like so

    Recipes[10] = { # Hi-Potion :recipe_type => 1, # Alchemy Recipe :req_level => 1, # Level required to use this recipe :craft_time => 100, # Time it takes to make the item :earned_exp => 10, # Exp gained on success :crafted_item => [:i2, 1], # Makes 1x Hi-Potion } # <- DO NOT REMOVEYou'll also need to replace your main script with this one:

    https://www.dropbox.com/s/n5fke1ldy6ufrkp/no%20ingredients%20crafting.txt

    It won't work with any of the add ons right now. I'll work on those and PM them too you soon. It's about to start a four day weekend for me and not sure how much I'll be on the pc

    edit: you will also more then likely need to start a new game for these changes. It might work with an old save file, but I'm not 100% sure on that.
    This is how to make a craft free? I still want them to need mats for it, just not cost anything once they get the correct mats. Atm I've just got it set for 1 of my in game currency.
     
  20. Venka

    Venka Veteran Veteran

    Messages:
    945
    Likes Received:
    365
    Location:
    United States
    First Language:
    English
    I guess I don't understand. You can set if it cost coins or not
     

Share This Page