Hide key inventory items

Guilhermefoligno

Villager
Member
Joined
Dec 3, 2017
Messages
10
Reaction score
0
First Language
Portugues
Primarily Uses
RMMV
First of all, I'm sorry for my bad English, but I spent the day scouring forums and google, and I didn't find the solution. I'm making a game on vxace, where I need the resource that has in the MV to have hidden items that don't appear in the player's inventory, because I use items to activate conditions, switches, etc., maybe it can be a very simple problem to solve, knowing how to filter what appears in the inventory and making sure that the item keys do not appear, but in fact, I couldn't do that.
 
Last edited:

Stupidbro

Veteran
Veteran
Joined
Jul 8, 2019
Messages
57
Reaction score
7
First Language
English
Primarily Uses
RMVXA
Are you wanting all key items to disappear or just specific ones? If it's specific items, are you absolutely certain they need to be items? I might be able to help find an alternative to items if you could explain what you're trying to do.
 

Guilhermefoligno

Villager
Member
Joined
Dec 3, 2017
Messages
10
Reaction score
0
First Language
Portugues
Primarily Uses
RMMV
I need the category items (key item) to be hidden from the player's inventory, so that only the common items appear, as the keys do not want the players to know that they have acquired them, as I will use them to activate secret game events.

I did with items in the MV now there is a way to assign variables to a player, to use instead of items, it would also serve, but I don't know how to make a player "add" a variable.
 

Stupidbro

Veteran
Veteran
Joined
Jul 8, 2019
Messages
57
Reaction score
7
First Language
English
Primarily Uses
RMVXA
I need the category items (key item) to be hidden from the player's inventory, so that only the common items appear, as the keys do not want the players to know that they have acquired them, as I will use them to activate secret game events.

I did with items in the MV now there is a way to assign variables to a player, to use instead of items, it would also serve, but I don't know how to make a player "add" a variable.
Okay, well, I see three ways of doing this that could potentially work.
1) Visually remove the key items tab from the items menu. (Can probably be done with scripting and I could tinker a bit and get back to you)
2) Just use variables (Event commands --> tab 1 --> control variables --> operation --> add)
3) If which of the exact keys you have is relevant, you can use a series of switches (Which could also make it easier to test as well)
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,554
Reaction score
541
First Language
English
Primarily Uses
RMVXA

Guilhermefoligno

Villager
Member
Joined
Dec 3, 2017
Messages
10
Reaction score
0
First Language
Portugues
Primarily Uses
RMMV
let me rephrase the question, because I think my English may be confused.


what I need, is exactly what is in the MV, the hidden items a, b, I need to hide some types of items so that when the player acquires them they do not appear in their inventory, stay there with them, but invisible.

example:
the player receives the item "faced the secret boss"

then I do a conditional ahead, that if the player has faced the secret boss, it happens x thing, if it doesn't have y thing.

the point is that I don't want the "faced the secret boss" to appear in his inventory
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,289
Reaction score
11,692
First Language
English
Primarily Uses
RMVXA
Why does this need to be an item?

If I were doing this, I would turn the switch 'Faced secret boss' ON and then, when needed, I would just use a conditional to check if that switch was ON or OFF.

You need to say what you want the item to do in addition to simply providing that information in order for us to say how you could do it.
 

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
675
Reaction score
436
First Language
English
Primarily Uses
RMVXA
Untested, but this should work:
Ruby:
class Window_ItemList < Window_Selectable

  alias amn_hideitem_winditemlist_include?  include?
  def include?(item)
    return false if item && item.note =~ /<hide>/i
    amn_hideitem_winditemlist_include?(item)
  end

end
Write <hide> in the notes field of the items you want hidden.
 

Guilhermefoligno

Villager
Member
Joined
Dec 3, 2017
Messages
10
Reaction score
0
First Language
Portugues
Primarily Uses
RMMV
Why does this need to be an item?

If I were doing this, I would turn the switch 'Faced secret boss' ON and then, when needed, I would just use a conditional to check if that switch was ON or OFF.

You need to say what you want the item to do in addition to simply providing that information in order for us to say how you could do it.
because when I used the MV, I used the hidden items to activate conditionals, as if they were variables you know
ex: player went through such a place, player already beat that boss, player already participated in this dungeon for today, and etc.

there may be a simpler way to do this, but I got used to this method in the MV.


give invisible items to save what the player has done, wherever he went, limit him to do things more often
 

Guilhermefoligno

Villager
Member
Joined
Dec 3, 2017
Messages
10
Reaction score
0
First Language
Portugues
Primarily Uses
RMMV
Untested, but this should work:
Ruby:
class Window_ItemList < Window_Selectable

  alias amn_hideitem_winditemlist_include?  include?
  def include?(item)
    return false if item && item.note =~ /<hide>/i
    amn_hideitem_winditemlist_include?(item)
  end

end
Write <hide> in the notes field of the items you want hidden.

do I have to create a new script with this? Or do I insert it into the windows_itemlist that I already have? pasting as a new script gave this error
 

Attachments

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,946
First Language
English
Primarily Uses
RMMV
That's generally what switches are for.

Where did you paste the code? You definitely shouldn't get that error if it's in the right place.
 

Guilhermefoligno

Villager
Member
Joined
Dec 3, 2017
Messages
10
Reaction score
0
First Language
Portugues
Primarily Uses
RMMV
That's generally what switches are for.

Where did you paste the code? You definitely shouldn't get that error if it's in the right place.
[/CITAR]
O que outras pessoas estão dizendo

is that I’m using a vxaOS tool, it’s a netplayer, I don’t know if it would be good

fill up with
it with switchs, I think. I pasted the code above MAIN.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,946
First Language
English
Primarily Uses
RMMV
Can you show me a screenshot?
 

Guilhermefoligno

Villager
Member
Joined
Dec 3, 2017
Messages
10
Reaction score
0
First Language
Portugues
Primarily Uses
RMMV
Can you show me a screenshot?

and the item list script I have is this

#==============================================================================
# ** Window_Item
#------------------------------------------------------------------------------
#
#------------------------------------------------------------------------------
# Autor: Valentine
#==============================================================================

class Window_Item < Window_ItemList

def initialize

#reajustada no adjust_windows_position da Scene_Map
super(adjust_x, adjust_y, 212, 212)
self.visible = false
self.windowskin = Cache.system('Window3')
@dragable = false
create_gold_bar
end

def adjust_x
$windows[:equip].x
end

def adjust_y
$windows[:equip].y + $windows[:equip].height - 1
end

def gold
$game_party.gold - $game_trade.my_gold
end

def enable?(item)
$game_actors[1].usable?(item) || $game_actors[1].equippable?(item)
end

def usable?
item.is_a?(RPG::Item) && $game_player.usable?(item)
end

def make_item_list
@Data = $game_party.all_items
end

def draw_item_number(rect, item)
rect.y += 7
draw_text(rect, $game_party.item_number(item) - $game_trade.my_item_number(item), 2)
end

def update
super
double_click
drop_item
end

def double_click
return unless Mouse.dbl_clk?:)L)
return unless index >= 0
if $windows[:shop].visible
$windows[:shop].sell_item
elsif $windows[:trade].visible
$windows[:amount].show(Constants::AMOUNT_ADD_TRADE_ITEM, item)
elsif $windows[:bank].visible
$windows[:amount].show(Constants::AMOUNT_DEPOSIT_ITEM, item)
elsif item.is_a?(RPG::EquipItem) && $windows[:equip].sufficient_level? && !$windows[:equip].equip_vip?
$network.send_player_equip(item.id, item.etype_id)
elsif item.is_a?(RPG::Item)
use_item
end
end

def use_item
return if $game_player.item_attack_time > Time.now
$game_player.item_attack_time = Time.now + Configs::COOLDOWN_SKILL_TIME
$network.send_use_item(item.id) if usable?
end

def drop_item
return unless Mouse.click?:)R)
return unless index >= 0
return if $windows[:trade].visible
$windows[:amount].show(Constants::AMOUNT_DROP_ITEM, item)
end

def update_drag
return unless Mouse.press?:)L)
return if $cursor.object
return if $dragging_window
return unless index >= 0
$cursor.change_item(item, Constants::MOUSE_ITEM)
end

def update_drop
return if Mouse.press?:)L)
return unless $cursor.object
return unless in_area?
case $cursor.type
when Constants::MOUSE_EQUIP
$network.send_player_equip(0, $cursor.object.etype_id) unless $game_party.full_items?($cursor.object)
when Constants::MOUSE_SHOP
$windows[:amount].show(Constants::AMOUNT_BUY_ITEM, $cursor.object, $windows[:shop].index)
when Constants::MOUSE_TRADE
$windows[:amount].show(Constants::AMOUNT_REMOVE_TRADE_ITEM, $cursor.object)
when Constants::MOUSE_BANK
$windows[:amount].show(Constants::AMOUNT_WITHDRAW_ITEM, $cursor.object)
end
end
end
 

Attachments

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
675
Reaction score
436
First Language
English
Primarily Uses
RMVXA
Okay, it's pretty important to mention if you're using custom scripts so people don't waste their time. Looks like you're using scripts that overwrite all of the base scripts, which means that any vanilla fix I give you probably won't work. Try this in a new slot below those:
Ruby:
class Window_Item < Window_ItemList
  def make_item_list
    @data = $game_party.all_items.select { |i| !i.note.include?("<hide>") }
  end
end
 

Guilhermefoligno

Villager
Member
Joined
Dec 3, 2017
Messages
10
Reaction score
0
First Language
Portugues
Primarily Uses
RMMV
Okay, it's pretty important to mention if you're using custom scripts so people don't waste their time. Looks like you're using scripts that overwrite all of the base scripts, which means that any vanilla fix I give you probably won't work. Try this in a new slot below those:
Ruby:
class Window_Item < Window_ItemList
  def make_item_list
    @data = $game_party.all_items.select { |i| !i.note.include?("<hide>") }
  end
end
it worked, thank you very much
and excuse me, for the lack of detailed explanation.
 

Guilhermefoligno

Villager
Member
Joined
Dec 3, 2017
Messages
10
Reaction score
0
First Language
Portugues
Primarily Uses
RMMV
Okay, it's pretty important to mention if you're using custom scripts so people don't waste their time. Looks like you're using scripts that overwrite all of the base scripts, which means that any vanilla fix I give you probably won't work. Try this in a new slot below those:
Ruby:
class Window_Item < Window_ItemList
  def make_item_list
    @data = $game_party.all_items.select { |i| !i.note.include?("<hide>") }
  end
end
one last thing, without wanting to abuse it.

do you know how do i not display the item text acquired to the player to get the item? the item no longer appears in the inventory thanks to its code, but can I also prevent items with "<hide>" from appearing in the popout warning the player who picked it up?


the code is this:

class Sprite_Popup <Sprite2

def initialize
super
self.bitmap = Bitmap.new (225, 24)
self.x = 11
self.z = 50
self.visible = false
end

def show (name, icon_index, amount, key = false)
self.y = $ game_actors [1] .party_members.empty? ? 120: $ game_actors [1] .party_members.size * 35 + 163
self.y + = 42 if $ windows [: states] .visible
@text = amount> 1? "# {name} x # {convert_gold (amount)}": name
@width = text_width (@text) + 40
@icon_index = icon_index
@Key = key
self.visible = true
@Time = 60
refresh
end

def refresh
draw_background
draw_item
end

def draw_background
self.bitmap.clear
rect = Rect.new (0, 0, @width, self.bitmap.height)
self.bitmap.fill_rect (rect, Color.new (0, 0, 0, 160))
end

def draw_item
rect = Rect.new (@icon_index% 16 * 24, @icon_index / 16 * 24, 24, 24)
bitmap = Cache.system ('Iconset')
self.bitmap.blt (5, 0, bitmap, rect)
color = @Key? crisis_color: normal_color
self.bitmap.font.color.set (color)
self.bitmap.draw_text (35, 3, self.bitmap.width, 18, @text)
end

def update
super
@Time - = 1
self.visible = false if @Time == 0
end

end
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,554
Reaction score
541
First Language
English
Primarily Uses
RMVXA
How does the player know an item is received? A script has to control that.
What script is that code from? and you should really use code block when pasting code, Then it doesn't get pasted as text and have forums modifications to the code.
Code:
code here
 

Guilhermefoligno

Villager
Member
Joined
Dec 3, 2017
Messages
10
Reaction score
0
First Language
Portugues
Primarily Uses
RMMV
How does the player know an item is received? A script has to control that.
What script is that code from? and you should really use code block when pasting code, Then it doesn't get pasted as text and have forums modifications to the code.
Code:
code here
------


I suppose it was for this script that deals with popout windows, but the scripts that I have are these, if you have any idea where you can deal with the display of the name and icon of the item when you pick it up from the floor, appear in a popout window












this code in code block
#==============================================================================
# ** Sprite_Popup
#------------------------------------------------------------------------------
# Esta classe lida com a exibição do item e ouro obtidos.
#------------------------------------------------------------------------------
# Autor: Valentine
#==============================================================================

class Sprite_Popup < Sprite2

def initialize
super
self.bitmap = Bitmap.new(225, 24)
self.x = 11
self.z = 50
self.visible = false
end

def show(name, icon_index, amount, key = false)
self.y = $game_actors[1].party_members.empty? ? 120 : $game_actors[1].party_members.size * 35 + 163
self.y += 42 if $windows[:states].visible
@text = amount > 1 ? "#{name} x#{convert_gold(amount)}" : name
@width = text_width(@text) + 40
@icon_index = icon_index
@Key = key
self.visible = true
@Time = 60
refresh
end

def refresh
draw_background
draw_item
end

def draw_background
self.bitmap.clear
rect = Rect.new(0, 0, @width, self.bitmap.height)
self.bitmap.fill_rect(rect, Color.new(0, 0, 0, 160))
end

def draw_item
rect = Rect.new(@icon_index % 16 * 24, @icon_index / 16 * 24, 24, 24)
bitmap = Cache.system('Iconset')
self.bitmap.blt(5, 0, bitmap, rect)
color = @Key ? crisis_color : normal_color
self.bitmap.font.color.set(color)
self.bitmap.draw_text(35, 3, self.bitmap.width, 18, @text)
end

def update
super
@Time -= 1
self.visible = false if @Time == 0
end

end
 

Attachments

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,497
First Language
Indonesian
Primarily Uses
RMVXA
Instead of pasting the script, why not just link the source so we can look at ourselves.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Ami
--- Diary ---

M.Mage: It's the F.Mage's Diary. While she isn't here,i can read it.

May, 10: I'm hurt after the battle with the Minotaur. But luckily,F.Healer heal me with her Heal-2. That why,i Fall in Love with her.

M.Mage: Eh???
So... some of my Desktop hardware has kicked it apparently (still trying to figure out what and how at the moment :/ ) .... yay?
Stream will be live shortly with some Darkest Dungeon! Feel free to drop by!
Made a HUGE (YYOOOOJJ) Update to Monstructs and moving towards a Steam Early Access release!

Forum statistics

Threads
104,223
Messages
1,004,805
Members
135,741
Latest member
alishadean066
Top