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.

PrexCraft - Crafting Script

I figured out how to add individual sound effects to this, based on the type of thing produced...
Code:
In 'Scene_Craft'

[B]Find:[/B]
  def update
    @recipe_list.update
    @result_info.update(@recipe_list.data)
    @result_comp.update(@recipe_list.data)

[B][U]Underneath add:[/U][/B]
    recipe = Craft.get_recipe(@recipe_list.data)

[B]Then Find:[/B]
    if Input.trigger?(Input::C)
       if craft(@recipe_list.data)

[B][U]And Replace the default SE call with this:[/U][/B]
        case recipe['RESULT'][0]
        when 0 
        Audio.se_play("Audio/SE/126-Water01", 80, 150)
        when 1
        Audio.se_play("Audio/SE/097-Attack09", 80, 150)
        when 2
        Audio.se_play("Audio/SE/097-Attack09", 80, 150)
        end
If you have a better SFX, replace the ones here with something else; just alter '126-Water01' to 'Mysound' or whatever. You don't need the extension; but it must be imported into your SE folder.

Also, I sort of got around the whole confirmation box thing by masking the crafting scene in events; and adding a dispose scene command in the script after the item was made. This has two useful purposes; One, it stops you going on an item making frenzy and wasting ingredients, and Two, allows me to add some random amount of time to the ingame clock. (With a message 'You took x minutes to make that!')

This works excellently for me, since I use an alchemy sound for items made, and a custom made smithing noise for weapons and armour.
 
I tried to figure out how to add a confirmation box, but couldn't I'm afraid. My scripting skills are skill pretty mediocre; after all. You'll have to wait for Prexus to come back from his slumber or find a workaround like I did.
 

Keke

Member

Hic , Prexus , please come back and complate your Script :((
@ All : hey everyone , who help me add confirmation box to this Script ?
@ eharper256 : thanks

.
 
ohhhh ho ho.... sombodys angry! ;)

Well thanks for a great script anyway! sniff.... ill just find a way to make it in the menu...... *cries*

Edit: But WAIT I HAVE A WAY!! I found yout how using the cheat imput script!!!
 

Keke

Member

Hey Prexus , I need your Script , please help me for confirmation window ( I'm noob ) . It's very easy with you but difficult with me

.
 
Prexus;155999 said:
The script is complete as is. Stop asking for a confirmation window. It's about 10 lines of code. Figure it out yourself.

Keke, learn to read. Prexus has stated that you do it yourself, which I believe you should.
 

Keke

Member

I made 20 Recipes , and open the Scene_Craft , but only 14 Recipes visible ! That's a bug , please fix it !

!
 
okay, I'm a noob and this is probably a noob question. I'd like to add options to my menu(Default Menu) which will call the blacksmith and cooking scenes. Could someone please tell me how to do this? I might be able to figure it out if I could find the correct script to edit. I already know how to call the script from events, I just want to add it to my menu.
 
I have a problem, it says this

Code:
Script 'PrexCraft' line 671: NoMethodError occurred.
undefined method 'include?' for nil:NilClass

Any idea how to fix this?
 
After a tutorial or two, I managaed to edit my command menu to call this script. It works great. I know you've said the script is finished, but if you ever feel like working on it again, could you implement a way to un-craft something? Dissasembling, reversing the recipe, whatever you want to call it. I think that would be a nice feature.
 
Hey, Just so you know i'm having problems, I added a item called Steel Sword and this keeps popping up and stopping me from testing.

Script 'PrexCraft' line 114: SyntaxError occurred

I'd like to start working on making more equipment so yeah, if i could get some help PPPLLLEAAAASSSSEEEEEE That'd be great.

btw, this is what i imputed for the error that occurred. (Its the same that the
script has)

114 def self.valid_recipe?(name) <----- Thats the problem
115 for recipe in RECIPES
116 return true if name == recipe['NAME']
117 end
118 return false
119 end
 
Trenzer;167004 said:
I have a problem, it says this

Code:
Script 'PrexCraft' line 671: NoMethodError occurred.
undefined method 'include?' for nil:NilClass

Any idea how to fix this?

It would help if you provided what was on line 671.
 
Hello everyone. I was wondering if someone could help me with something. I would like to go to the cook and see a list of, let's say, 50 "Unknown" or "???" Recipes. Kind of like:

01: ???
02: ???
03: ???

Then, after you learn "02: Mushroom Soup"...It would something like this:

01: ???
02: Mushroom Soup
03: ???

And so on...Just an idea that I though be cool. If someone could please help me it would be deeply appreciated. Thanks!

-Jimmy
 

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