• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Resource icon

Resource [v20\v21] Item Crafter UI Plus 3.0.0

Thunderbird games

Novice
Member
Joined
Jan 1, 2022
Posts
47
Ah well, you should try force compiling, but I haven't actually downloaded the hotfixes, so it probably needs to be added to the meta.txt if it changes the compiler, as this script aliases a few of the compiler methods to allow it to be compiled.
tried that didn't work sadly
 

CoderFreddy

Novice
Member
Joined
Feb 8, 2023
Posts
47
Is there a way to add an item or pokegear app that lets you see the recipes you have?
 

chip929

Rookie
Member
Joined
Oct 5, 2023
Posts
9
Hello, I would like to know if it's possible to add the crafting menu directly from the main menu/Pokégear? If so, do you have a solution? Thank you in advance!
Would love to see this happen. I've been trying to finnagle this myself but did not work out.
 

chip929

Rookie
Member
Joined
Oct 5, 2023
Posts
9
ClessioTV said:
Hello, I would like to know if it's possible to add the crafting menu directly from the main menu/Pokégear? If so, do you have a solution? Thank you in advance!
Would also like to know please.

So I think we can do this (not a complete solution but a step in the right direction I think)

1. Go into the 001_UI_ItemCrafting.rb that's included in the download for Item Craftin UI Plus. Edit the last block of code starting with this line "def pbItemCrafter(stock)

Original:
Ruby:
Expand Collapse Copy
def pbItemCrafter(stock,speech1=nil,speech2=nil)
  stock.each do |recipe|
    raise _INTL("Invalid Recipe ID {1}.", recipe) if !GameData::Recipe.exists?(recipe)
  end
  stock.uniq!
  if stock.empty?
    pbMessage(_INTL("You don't have any recipes to use here."))
    return
  end
  if pbConfirmMessage(_INTL("Would you like to craft something?"))
    pbMessage(speech1 ? speech1 : _INTL("Let's get started!"))
    pbFadeOutIn {
      scene = ItemCraft_Scene.new
      screen = ItemCraft_Screen.new(scene,stock)
      screen.pbStartScreen
    }
  end
  pbMessage(speech2 ? speech2 : _INTL("Come back soon!"))
end

And replace with: NOT SURE IF THIS'LL WORK, this was copied from a post (https://eeveeexpo.com/threads/3717/) but for a v20.1 Pokemon Essentials
Ruby:
Expand Collapse Copy
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

2. Go into Script Editor and go to the UI_PauseMenu. Within UI Pause Menu, there's a section called "Pause menu commands". There's blocks of code starting with "MenuHandlers.add". I'm guessing each block adds a new menu option (Pokedex, Bag, Trainer Card, etc).

Example (adds Bag option):
Ruby:
Expand Collapse Copy
MenuHandlers.add(:pause_menu, :bag, {
  "name"      => _INTL("Bag"),
  "order"     => 30,
  "condition" => proc { next !pbInBugContest? },
  "effect"    => proc { |menu|
    pbPlayDecisionSE
    item = nil
    pbFadeOutIn do
      scene = PokemonBag_Scene.new
      screen = PokemonBagScreen.new(scene, $bag)
      item = screen.pbStartScreen
      (item) ? menu.pbEndScene : menu.pbRefresh
    end
    next false if !item
    $game_temp.in_menu = false
    pbUseKeyItemInField(item)
    next true
  }
})

You'd have to add a new block of code starting to create the Crafting Option: THIS IS WHERE I MIGHT BE STUCK, there's probably more lines of code / edits that are needed to create a functioning menu option for crafting.
Ruby:
Expand Collapse Copy
MenuHandlers.add(:pause_menu, :item_crafter, {
  "name"      => _INTL("Crafting"),
  "order"     => 60,
  "effect"    => proc { |menu|
    pbPlayDecisionSE
    pbFadeOutIn do
      scene = ItemCraft_Scene.new
      screen = ItemCraft_Scene.new(scene)

      screen.pbStartScreen
      menu.pbRefresh
    end
    next false
  }
})
 

Vendily

Elite Trainer
Member
ClessioTV said:
Hello, I would like to know if it's possible to add the crafting menu directly from the main menu/Pokégear? If so, do you have a solution? Thank you in advance!


So I think we can do this (not a complete solution but a step in the right direction I think)

1. Go into the 001_UI_ItemCrafting.rb that's included in the download for Item Craftin UI Plus. Edit the last block of code starting with this line "def pbItemCrafter(stock)

Original:
Ruby:
Expand Collapse Copy
def pbItemCrafter(stock,speech1=nil,speech2=nil)
  stock.each do |recipe|
    raise _INTL("Invalid Recipe ID {1}.", recipe) if !GameData::Recipe.exists?(recipe)
  end
  stock.uniq!
  if stock.empty?
    pbMessage(_INTL("You don't have any recipes to use here."))
    return
  end
  if pbConfirmMessage(_INTL("Would you like to craft something?"))
    pbMessage(speech1 ? speech1 : _INTL("Let's get started!"))
    pbFadeOutIn {
      scene = ItemCraft_Scene.new
      screen = ItemCraft_Screen.new(scene,stock)
      screen.pbStartScreen
    }
  end
  pbMessage(speech2 ? speech2 : _INTL("Come back soon!"))
end

And replace with: NOT SURE IF THIS'LL WORK, this was copied from a post (https://eeveeexpo.com/threads/3717/) but for a v20.1 Pokemon Essentials
Ruby:
Expand Collapse Copy
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

2. Go into Script Editor and go to the UI_PauseMenu. Within UI Pause Menu, there's a section called "Pause menu commands". There's blocks of code starting with "MenuHandlers.add". I'm guessing each block adds a new menu option (Pokedex, Bag, Trainer Card, etc).

Example (adds Bag option):
Ruby:
Expand Collapse Copy
MenuHandlers.add(:pause_menu, :bag, {
  "name"      => _INTL("Bag"),
  "order"     => 30,
  "condition" => proc { next !pbInBugContest? },
  "effect"    => proc { |menu|
    pbPlayDecisionSE
    item = nil
    pbFadeOutIn do
      scene = PokemonBag_Scene.new
      screen = PokemonBagScreen.new(scene, $bag)
      item = screen.pbStartScreen
      (item) ? menu.pbEndScene : menu.pbRefresh
    end
    next false if !item
    $game_temp.in_menu = false
    pbUseKeyItemInField(item)
    next true
  }
})

You'd have to add a new block of code starting to create the Crafting Option: THIS IS WHERE I MIGHT BE STUCK, there's probably more lines of code / edits that are needed to create a functioning menu option for crafting.
Ruby:
Expand Collapse Copy
MenuHandlers.add(:pause_menu, :item_crafter, {
  "name"      => _INTL("Crafting"),
  "order"     => 60,
  "effect"    => proc { |menu|
    pbPlayDecisionSE
    pbFadeOutIn do
      scene = ItemCraft_Scene.new
      screen = ItemCraft_Scene.new(scene)

      screen.pbStartScreen
      menu.pbRefresh
    end
    next false
  }
})
Yeah you literally lost the entire stock portion of the item craft scene, and you've removed the entire functionality of pbItemCrafter, so all it does is crunch a stock list (which wasn't even necessary if you weren't going to bother using the method call).

EDIT: I just noticed that the method you replaced it with is from the old version of this script, it's not compatible with how I set up the recipe data even slightly.

EDIT 2: Just call the main method for the script in the menu handler. Yes the code I provided was for an item, but it's the same thing regardless.
 
Last edited:

chip929

Rookie
Member
Joined
Oct 5, 2023
Posts
9
Yeah you literally lost the entire stock portion of the item craft scene, and you've removed the entire functionality of pbItemCrafter, so all it does is crunch a stock list (which wasn't even necessary if you weren't going to bother using the method call).

EDIT: I just noticed that the method you replaced it with is from the old version of this script, it's not compatible with how I set up the recipe data even slightly.

EDIT 2: Just call the main method for the script in the menu handler. Yes the code I provided was for an item, but it's the same thing regardless.
I appreciate you showing me where I wrong.

Now just to clarify (cuz I'm brand new at this):

EDIT 1: replacing the pbItemCrafter was completely useless.

EDIT 2: (this is where I could use some direction) pbItemCrafter is the main method? And I should call pbItemCrafter in the MenuHandlers.add?
 

Vendily

Elite Trainer
Member
I appreciate you showing me where I wrong.

Now just to clarify (cuz I'm brand new at this):

EDIT 1: replacing the pbItemCrafter was completely useless.

EDIT 2: (this is where I could use some direction) pbItemCrafter is the main method? And I should call pbItemCrafter in the MenuHandlers.add?
Yes, if you call the method, it will start the item crafter, so you could call it in a menu. But you have to give it a stock list, which is why it's called with pbGetRecipes
 

chip929

Rookie
Member
Joined
Oct 5, 2023
Posts
9
Yes, if you call the method, it will start the item crafter, so you could call it in a menu. But you have to give it a stock list, which is why it's called with pbGetRecipes
Beautiful, the dots have connected for me. Thank you lots
 

pkmnacademia

Trainer
Member
Joined
Mar 24, 2023
Posts
53
I really love the look of these new features, but I've done a lot with the base crafting UI already in my game - is there a way to smoothly transition what I've put together already into this updated version?
 

Vendily

Elite Trainer
Member
I really love the look of these new features, but I've done a lot with the base crafting UI already in my game - is there a way to smoothly transition what I've put together already into this updated version?
I didn't really make many significant changes to the UI itself, only to how cost is calculated and how ingredients in general work. If you grab a fresh copy of the original script, you can run both into a diff checker and pick out my specific changes. That should let you integrate my changes into your UI.
The rest of the plugin files involves only my changes with how recipes work, so they can be left alone and they'll work just fine. You only really need to adjust the UI.
 

MoonlightRose

Rookie
Member
Joined
Mar 24, 2022
Posts
6
Would it be possible to make a version that allows you to get Pokémon from items? Portable Fossil revival machine would be cool.
 

pkmnacademia

Trainer
Member
Joined
Mar 24, 2023
Posts
53
Is there a way to make it so when you hold the left/right/up/down arrow, the page switch/quantity increase continually moves forward like the Pokedex, rather than needing to press the button each time?

I've tried making alignments to the UI_Pokedex code here:

Ruby:
Expand Collapse Copy
        elsif Input.repeat?(Input::RIGHT)
          if index == -2
            index = -3
          elsif index >= -1
            if minmax == 1 && index >= cmds.length
              index = 0
            elsif minmax == 1 && index == cmds.length - 1
              index = -1
            elsif index < cmds.length && !(minmax == 1 && index < 0)
              index += 1 if minmax == 1 || selindex[1] == -1 ||
                            (selindex[1] < cmds.length && selindex[1] >= index + 1)
            end

But I haven't quite gotten it right. Any clues?
 

DarkFlamr

Rookie
Member
Joined
Feb 24, 2024
Posts
5
Yeah you literally lost the entire stock portion of the item craft scene, and you've removed the entire functionality of pbItemCrafter, so all it does is crunch a stock list (which wasn't even necessary if you weren't going to bother using the method call).

EDIT: I just noticed that the method you replaced it with is from the old version of this script, it's not compatible with how I set up the recipe data even slightly.

EDIT 2: Just call the main method for the script in the menu handler. Yes the code I provided was for an item, but it's the same thing regardless.
How did you get that working?
 
Back
Top