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.

questions about items in xp

Hi,
Here are some questions:

(1)Is it possible to not show a specific item, a weapon for example, on the players item list?

(2)is it possible to make a weapon used an item?
what i have is a weapon that is a stick, but i want to use it as a item too, so when i use it in the items it runs a common event.

related to (1) if i had a way to hide specific items or weapons i could hide the weapon in the items list and list a duplicated item similar of the weapon, this way it would give the idea of the same thing but having actually 2.. but would work..

ps: i dont know much about scripting.

thanks in advance!
 
Just use switches. Create one, for example, called 'Found Sword' and switch it on. Then create another event page on your affiliated event (adjust the graphic) and check 'Switch...' in the conditions menu on the event. Then select Found Sword and put your next event (for example, "Thanks for finding my sword.") and he'll say "Thanks for finding my sword." as long as the switch is on.
 
i guess i didnt explain myself correctly.
the problem is not the messages is in the items.
I have a stick that is a weapon and i want to use it as an item(not in battle but in normal game), because even if it is listed in the items(for the player not editing) i cant use it as an item.
i want that when people click on it, in the items list, i can run a common event like i can do with items..  now is just grayed out.
if i could hide the weapons in the items for the player i could do a item version of the weapon and simulate that.

is there a way to do that?
 
they want a weapon to be able to run a common event from the item list in the menu when its used.

i understand exactly what youre trying to do, but i havent really messed around with it much yet myself, ive been spending too much time working on resources, i have way too much original stuff to finish before i can actually start working on my game.
 
This will allow you to create an element called "Hidden_Item", and tag any item, weapon, or armor with that element. It won't show up in the item list. It will, however, if it's a weapon or armor, show up in the "Sell" & "Equip" lists.

I've been accused of not explaining clearly, so here's what I did...  :scruff:
Create an additional element in the database (System tab) called "Hidden_Item" (mine was # 17)
Find the weapon that you want to hide from the item list.
Check the "Hidden_Item" element

Paste this script above 'main' in the script editor.

Code:
class Window_Item
  #--------------------------------------------------------------------------
  # * Refresh
  #
  # Modified to hide any item, weapon, or armor tagged with a specific element.
  # Create an additional element called "hidden_item"
  # Set "hidden_element" below to the number of the element you use.
  #--------------------------------------------------------------------------
  def refresh
    hidden_element = 17
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add item
    for i in 1...$data_items.size
      hidden = false
      for j in 0...$data_items[i].element_set.size
        if $data_items[i].element_set[j] == hidden_element
          hidden = true
        end
      end
      if $game_party.item_number(i) > 0 and hidden == false
        @data.push($data_items[i])
      end
    end
    # Also add weapons and items if outside of battle
    unless $game_temp.in_battle
      for i in 1...$data_weapons.size
        hidden = false
        for j in 0...$data_weapons[i].element_set.size
          if $data_weapons[i].element_set[j] == hidden_element
            hidden = true
          end
        end
        if $game_party.weapon_number(i) > 0 and hidden == false
          @data.push($data_weapons[i])
        end
      end
      for i in 1...$data_armors.size
        hidden = false
        for j in 0...$data_armors[i].guard_element_set.size
          if $data_armors[i].guard_element_set[j] == hidden_element
            hidden = true
          end
        end
        if $game_party.armor_number(i) > 0 and hidden == false
          @data.push($data_armors[i])
        end
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
end

Change the "hidden_element = 17" to match the element number you used.

Be Well
 

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