• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Simple item crafting system + interface

Resource Simple item crafting system + interface 1.2.2

ThatWelshOne_

Champion
Member
ThatWelshOne_ submitted a new resource:

Simple item crafting UI - A simple interface for all your item crafting needs!

This scripts allows you to implement item crafting into your game, with a clean and partially customisable UI!

Features
  • Fully customisable crafting recipes.
  • Ability to craft multiple of any given item at a time (if ingredients allow).
  • Up to 6 ingredients per recipe.
  • Animated background, with the option to disable this if you do not like it.
  • Easy to customise the background into whatever you like by editing the bg.png graphic.
  • Sprite and text...

Read more about this resource...
 

Crono099

Rookie
Member
Joined
Apr 1, 2018
Posts
7
this is amazing. would you be able to help me a bit .
in my game i have it so Apricorns can be planted and balls have been removed from Marts. the intention is to have Ball makers spread around the region with certain town having access to some of the special balls eg the beach town has acces to the netball as a extra on top of what ever the current level of main ball unlcoked by badges.
i want to be able to use this to create Balls but i would like it to have a time limit like Kurt normaly does eg. a player truns up with 2 white apricorns and 1 red and 1 blue then proceeds to "order" a great ball costing 1 white and blue apricorn and also order a poke ball. first ball will take say a hour to make and any other balls added will take extra time say a hour each (if its a variable that can be change it allows balancing to be implemented. if it sound posible to implement using your resource that would be amazing.
 

ThatWelshOne_

Champion
Member
this is amazing. would you be able to help me a bit .
in my game i have it so Apricorns can be planted and balls have been removed from Marts. the intention is to have Ball makers spread around the region with certain town having access to some of the special balls eg the beach town has acces to the netball as a extra on top of what ever the current level of main ball unlcoked by badges.
i want to be able to use this to create Balls but i would like it to have a time limit like Kurt normaly does eg. a player truns up with 2 white apricorns and 1 red and 1 blue then proceeds to "order" a great ball costing 1 white and blue apricorn and also order a poke ball. first ball will take say a hour to make and any other balls added will take extra time say a hour each (if its a variable that can be change it allows balancing to be implemented. if it sound posible to implement using your resource that would be amazing.
It would require a slight rework at the crafting step, but yes, that is certainly possible. I can look into this over the weekend.
 

ThatWelshOne_

Champion
Member
Alright, @Crono099. Here's a slightly tweaked script:
It works in exactly the same way as the original script described in this resource post.

To get it to work like Kurt, I've got a few screenshots for a test event I set up.
example_1.png
example_2.png
example_3.png
example_4.png

Let me know if there are any issues.
 

SaltBoiRDee

Rookie
Member
Joined
Mar 26, 2021
Posts
2
I want to make recipes unlockable in my game, is that possible? For example, instead of getting tm's you would get tm recipes and you could craft the tms.
 

ThatWelshOne_

Champion
Member
I want to make recipes unlockable in my game, is that possible? For example, instead of getting tm's you would get tm recipes and you could craft the tms.

It certainly is possible! I think the easiest way to do this would be to use switches. When the player "learns" a new recipe, activate a switch. Then, in your item crafting NPC event, have new sets of recipes offered according to what switches are turned on. This is conceptually similar to how the Poké Marts work. You could use a variable instead, increasing its value by 1 every time you get a new recipe, if you know how to use these. This latter approach would require just one variable rather than multiple switches, so would be easier to manage.
 

Crono099

Rookie
Member
Joined
Apr 1, 2018
Posts
7
Got back a error while testing (finally got to this after bug testing a acro bike script to death and then had a go at updating to v19 to find that it had loads of small bugs with normal things though it was nice to have following Brendan's back. but the issues with map transitions from building was getting annoying)
so im back to v18 till its more stable
i know that on my page 4 of the event i have a switch named "0062 s:cooledDown?(" luckily 61 was the last switch i had used.
and on page 1 i have a "Else" in the conditional branch that you didnt and i couldnt figure out how to remove it. had each stage a different pokemon to visually see when it was at each stage.



[Fri Apr 30 21:46:00 GMT Daylight Time 2021]
[Pokémon Essentials version 18.1]
Exception: SyntaxError
Message: (eval):1:in `switchIsOn?'compile error
(eval):1: syntax error
cooledDown?(
^

Backtrace:
Game_Event:74:in `switchIsOn?'
Game_Event:154:in `eval'
Game_Event:74:in `switchIsOn?'
Game_Event:154:in `nf_particles_game_map_refresh'
Game_Event:152:in `each'
Game_Event:152:in `nf_particles_game_map_refresh'
ParticleEngine:584:in `refresh'
Game_Event:24:in `nf_particles_game_map_initialize'
ParticleEngine:576:in `initialize'
Game_Map:63:in `new'

Screenshot (310).png
Screenshot (314).png
Screenshot (312).png
Screenshot (313).png
 

Attachments

  • Screenshot (310).png
    Screenshot (310).png
    56.6 KB · Views: 249

ThatWelshOne_

Champion
Member
Got back a error while testing (finally got to this after bug testing a acro bike script to death and then had a go at updating to v19 to find that it had loads of small bugs with normal things though it was nice to have following Brendan's back. but the issues with map transitions from building was getting annoying)
so im back to v18 till its more stable
i know that on my page 4 of the event i have a switch named "0062 s:cooledDown?(" luckily 61 was the last switch i had used.
and on page 1 i have a "Else" in the conditional branch that you didnt and i couldnt figure out how to remove it. had each stage a different pokemon to visually see when it was at each stage.



[Fri Apr 30 21:46:00 GMT Daylight Time 2021]
[Pokémon Essentials version 18.1]
Exception: SyntaxError
Message: (eval):1:in `switchIsOn?'compile error
(eval):1: syntax error
cooledDown?(
^

Backtrace:
Game_Event:74:in `switchIsOn?'
Game_Event:154:in `eval'
Game_Event:74:in `switchIsOn?'
Game_Event:154:in `nf_particles_game_map_refresh'
Game_Event:152:in `each'
Game_Event:152:in `nf_particles_game_map_refresh'
ParticleEngine:584:in `refresh'
Game_Event:24:in `nf_particles_game_map_initialize'
ParticleEngine:576:in `initialize'
Game_Map:63:in `new'


The name of the switch got cut off in my screenshot. It should be s:cooledDown?(X), X being the number of seconds to wait. For testing, I used 10 seconds, but you can use whatever value seems reasonable for Pokéball crafting.

As for the "else" condition, you should deselect the tick box when editing the conditional branch that says "Set ... when conditions do not apply". I forget what it says exactly, but it should be obvious from that.
 

InkDrop

Rookie
Member
Joined
Apr 13, 2020
Posts
6
Hi! This script looks really awesome, but it keeps throwing a runtime error at me. I'm using v19.1 and I copied one of your examples after I installed the plugin and graphics and I got this error:

runtimeError_1.png


If you could tell me what I'm doing wrong that would be great!
 

ThatWelshOne_

Champion
Member
Hi! This script looks really awesome, but it keeps throwing a runtime error at me. I'm using v19.1 and I copied one of your examples after I installed the plugin and graphics and I got this error:

View attachment 4894

If you could tell me what I'm doing wrong that would be great!

Hello! With the script box open in RPG Maker XP, run the extendtext.exe program that's in your project's main folder. After a few seconds of loading, you should see that your script box, well, extends so that each recipe occupies one line! It should work after that.
 

InkDrop

Rookie
Member
Joined
Apr 13, 2020
Posts
6
Hello! With the script box open in RPG Maker XP, run the extendtext.exe program that's in your project's main folder. After a few seconds of loading, you should see that your script box, well, extends so that each recipe occupies one line! It should work after that.
Thanks so much! It works perfectly now!
 

JtheDuelist

Novice
Member
Joined
Jun 9, 2021
Posts
34
Wish it was possible to put this as an option in the pause menu instead of an event for the sake of player quality of life, but I get that that is probably just another limitation of the script. Excellent work, regardless.
 

ThatWelshOne_

Champion
Member
Wish it was possible to put this as an option in the pause menu instead of an event for the sake of player quality of life, but I get that that is probably just another limitation of the script. Excellent work, regardless.

This is actually possible and doesn't require many changes to the original script.
Find def pbItemCrafter at the bottom of the script that comes with this resource and replace it with this:
Ruby:
def pbItemCrafter(stock)
  for i in 0...stock.length
    raise _INTL("You are missing an ingredient or quantity value.") if stock[i][1].length%2 !=0
    itemdata = GameData::Item.try_get(stock[i][0])
    for j in 0...stock[i][1].length/2
      ingr = stock[i][1][2*j]
      cost = stock[i][1][2*j+1]
      if !GameData::Item.try_get(ingr) || cost==0
        raise _INTL("At least one ingredient or quantity value is invalid.")
      end
    end
    if !itemdata # If target item does not exist
      stock[i] = nil
    end
  end
  stock.compact! # Remove nils
  if stock.empty?
    raise _INTL("After data validation, there are no items left in your input array. Please check for typos before trying again.")
  end
end

Then, in UI_PauseMenu, find these lines:
Ruby:
cmdPokedex   = -1
cmdPokemon   = -1
cmdBag       = -1
cmdTrainer   = -1
cmdSave      = -1
cmdOption    = -1
cmdPokegear  = -1
cmdDebug     = -1
cmdQuit      = -1
cmdEndGame   = -1
Add cmdCraft = -1 somewhere in that block of code. I don't think it matters where.

Just below that, you'll see lines that look like this:
Ruby:
commands[cmdPokegear = commands.length]  = _INTL("Pokégear") if $Trainer.has_pokegear
Add this new line:
Ruby:
commands[cmdCraft = commands.length]     = _INTL("Crafting") if !(pbGet(123)==0 || pbGet(123).empty?)

Finally, scroll down a bit more and you'll see various blocks of codes that start with something like this:
Ruby:
elsif cmdPokegear>=0 && command==cmdPokegear
Add this somewhere (I believe the position here determines where the "Crafting" option will appear in the pause menu):
Ruby:
elsif cmdCraft>=0 && command==cmdCraft
  pbPlayDecisionSE
  pbItemCrafter(pbGet(123))
  pbFadeOutIn {
    scene = ItemCraft_Scene.new
    screen = ItemCraft_Screen.new(scene,pbGet(123))
    screen.pbStartScreen
    @scene.pbRefresh
  }

You might have noticed that the number 123 appears a few times in these new lines you've added. That's because I've used game variable 123 to store the crafting recipes. This approach allows you to have the player "learn" new recipes on the fly by adding those recipes into this game variable. Here's an example of what I mean (this bit will need to be in an event):
Ruby:
pbGet(123).push(
[:SITRUSBERRY,[:POTION,2]]
)
Here, we take our game variable 123 (which is an array - I'll get onto that at the end) and we append it with our Sitrus Berry recipe. You'll notice that the formatting is identical to the original resource.
You can have the player learn multiple recipes at once like this:
Ruby:
pbGet(123).push(
[:SITRUSBERRY,[:POTION,2]],
[:LAGGINGTAIL,[:HARDSTONE,1,:IRONBALL,1]]
)
If you want to use a different game variable, you just have to change the 123 everywhere.

Now for the most important part. Before the player is to learn a new recipe, you need to put this bit of code somewhere:
Ruby:
pbSet(123,[]) if pbGet(123)==0
You can put it in the same event where the player learns their first recipe or, if you're not adding this to a game with players already having save files, you can put it in the intro event. It's up to you. All I'll say is if you don't put it before the first recipe is learned, your game will crash.

I think that's all you need. If you're using a custom pause menu, I'll let you work out how to get this working with that based on the information I've given.
Let me know if there are any issues with this. ☺️
 

JtheDuelist

Novice
Member
Joined
Jun 9, 2021
Posts
34
@ThatWelshOne_ Thanks for the quick response (I was not expecting one at all, tbh), and yeah, I am using a custom pause menu (Voltseon's to be specific), but since I do not know how to code anything for myself, I will probably have to pass on trying to add it to the menu.
 

ThatWelshOne_

Champion
Member
@ThatWelshOne_ Thanks for the quick response (I was not expecting one at all, tbh), and yeah, I am using a custom pause menu (Voltseon's to be specific), but since I do not know how to code anything for myself, I will probably have to pass on trying to add it to the menu.
It's fairly straightforward to add this to Voltseon's Pause Menu instead if you like.
Go to Plugins/Voltseon's Pause Menu/001_VoltseonMenu_Config.rb
Find the MENU_ENTRIES array and add "MenuEntryCrafting" just before "MenuEntryQuit".
Then, in the same directory, open the file called 005_VoltseonMenu_Entries.rb and paste this at the bottom:
Ruby:
#-------------------------------------------------------------------------------
# Entry for Simple Item Crafting
#-------------------------------------------------------------------------------
class MenuEntryCrafting < MenuEntry
  def initialize
    @icon = "menuDebug"
    @name = "Crafting"
  end

  def selected(menu)
    pbFadeOutIn(99999) {
      scene = ItemCraft_Scene.new
      screen = ItemCraft_Screen.new(scene,pbGet(123))
      screen.pbStartScreen
    }
  end

  def selectable?; return !(pbGet(123)==0 || pbGet(123).empty?); end
end
And that's it! Even simpler than the default pause menu in my opinion. Everything else in my previous post applies.
 
Last edited:
Back
Top