Theo - Limited Inventory

I noticed two problems. I explain : My inventory limit is 20. I created an armor who add 10 slot. So, when i'm wearing this armor, my inventory limit is 30.

My inventory is full ( so 30/30 ). If i take off the armor, my inventory is now 30/20.

And i need to put another item in my inventory to update the limit.
Do I need to randomly discard your items so it will be 20? I guess not.

Even in commercial game, when your inventory limit suddenly drops, your inventory never changes.

Second problem : when it updates the limit, some items disappear randomly or have a negative value.
Hmm... can you post the screenshot?
Yes of course :

http://www.hostingpics.net/viewer.php?id=52717020140916011451.jpg

And do you think it's possible to add in the script to walk slowly when inventory is full or exceed the limit ?
Did that happen when your inventory limit reached max (30/20), then you somehow updated the limit and negative number appeared?

I will try to reproduce the error once my college is off. And if I still can't figure that out, I might ask the demo.

For moving speed, try to insert this script

Code:
class Game_Player  def real_move_speed    super - ($game_party.inv_maxed? ? 0.5 : 0)  endend
Yes that happens when my inventory limit reached max.

I will try to explain as well as possibe. Not very easy in english sorry ...

When my inventory is 30/20, i don't know why but i can take in my inventory again one item.

I take morphine ( weight = 1 ). If i didn't already have morphine in my inventory, the morphine will be at -10 and my inventory limit will be 20/20.

If i already had 2 morphine in my inventory, the morphine will be at -8 in my inventory and inventory limit will be 20/20.

I hope it will help you to understand.

And for the moving speed script, thank you so much, that's exactly what i was looking for ^^
as I can see this is rather simple to transform this script into something candy : 3!
I have problem in compability about this script and YEA's menu cursor. When i use those scripts together, no matter which below or above, this bug will happen whenever open the item scene:

[IMG]http://i1147.photobucket.com/albums/o560/zabakapro/Untitled_zps6ba96b2a.png[/IMG]

please help me to fix this.
Sorry for late reply. I just burntout for scripting stuffs lately

I'm debugging right now.

About the Yanfly Menu Cursor. Put this patch below Yanfly's

class Sprite_MenuCursor def opacity_rate rate = 16 return -rate if [email protected] || @window.close? return rate endend@nio: if you can, that would be great 😀 EDIT:

As for jarod42 reported. Try to put this patch below my limited inventory.

class Game_Party def force_gain_item(item, amount, include_equip = false) container = item_container(item.class) return unless container last_number = item_number(item) new_number = last_number + amount container[item.id] = [new_number, 0].max container.delete(item.id) if container[item.id] == 0 if include_equip && new_number < 0 discard_members_equip(item, -new_number) end $game_map.need_refresh = true end def lose_item(item, amount, include_equip = false) force_gain_item(item, -amount, include_equip) endendIf it works, I will update the script version.I tested here and it worked. I'm unaware if it will be generates more issues though
Sorry for late reply. I just burntout for scripting stuffs lately

I'm debugging right now.

About the Yanfly Menu Cursor. Put this patch below Yanfly's

class Sprite_MenuCursor def opacity_rate rate = 16 return -rate if [email protected] || @window.close? return rate endend@nio: if you can, that would be great 😀 EDIT:

As for jarod42 reported. Try to put this patch below my limited inventory.

class Game_Party def force_gain_item(item, amount, include_equip = false) container = item_container(item.class) return unless container last_number = item_number(item) new_number = last_number + amount container[item.id] = [new_number, 0].max container.delete(item.id) if container[item.id] == 0 if include_equip && new_number < 0 discard_members_equip(item, -new_number) end $game_map.need_refresh = true end def lose_item(item, amount, include_equip = false) force_gain_item(item, -amount, include_equip) endendIf it works, I will update the script version.I tested here and it worked. I'm unaware if it will be generates more issues though
I tried the patch fix for YEA's menu cursor, it doesn't work at all, is there something wrong?
This is how I fixed mine. And it worked

Mytqsq3.png


How is yours?
This is how I fixed mine. And it worked

[IMG]http://i.imgur.com/Mytqsq3.png[/IMG]

How is yours?
Ah sorry, my bad, wrong type. I'm using Moghunter's menu cursor, not YEA's. Really sorry...
No need to say sorry. You accidentally let me know that mine won't work with yanfly menu cursor as well lol

By the way, try to put this below Mog's

Code:
module CURSOR_MENU_SPRITE  def can_update_cursor_position?    return false if !self.active         return false if self.index < 0     return false if !self.visible    return false if self.close?    return true  endend
No need to say sorry. You accidentally let me know that mine won't work with yanfly menu cursor as well lol

By the way, try to put this below Mog's

module CURSOR_MENU_SPRITE  def can_update_cursor_position?    return false if !self.active         return false if self.index < 0     return false if !self.visible    return false if self.close?    return true  endend
now it work like a charm 😀
W-w-what.....!!??? Equip only? What about item?

Anyway, I used this script together with that hime-work map item drop script, and something weird happened:

Inventory is full, but I can still grab the item on the floor, it is just that the item is not in the inventory anymore.

What I want is that when the inventory is full, I CAN'T take the item dropped on the floor anymore.

Please help

Thanks!
I'm not resposible about incompatibility among various script

But, if you're looking a way to restrict the player not to take the item when it's maxed, then you need a script call in conditional branch

Use this script call to determine if the inventory is maxed

$game_party.inv_maxed?Use this script call to check if the free slot is avalaible in certain number

$game_party.free_slot >= 5Hope that helps
Theo, awesome script, how can we change the sound effects for discarding items? Thanks.

Bonus question: Any chance we could get a prompt before an item is discarded, "Are you sure you wish to throw away [x] [item/s]?"
Theo, awesome script, how can we change the sound effects for discarding items? Thanks.
Add this patch below my limited inventory

class Window_DiscardAmount   def lose_item    $game_party.lose_item(@item,@amount)    @itemlist.redraw_current_item    @freeslot.refresh    if $game_party.item_number(@item) == 0      @itemlist.refresh    end    close    @cmn_window.activate    RPG::SE.new('name', volume, pitch).play # <-- set name, volume, and pitch for SE you want to play  end end
Bonus question: Any chance we could get a prompt before an item is discarded, "Are you sure you wish to throw away [x] [item/s]?"
None at the moment. But it's a great idea 😀
Add this patch below my limited inventory

class Window_DiscardAmount   def lose_item    $game_party.lose_item(@item,@amount)    @itemlist.redraw_current_item    @freeslot.refresh    if $game_party.item_number(@item) == 0      @itemlist.refresh    end    close    @cmn_window.activate    RPG::SE.new('name', volume, pitch).play # <-- set name, volume, and pitch for SE you want to play  end endNone at the moment. But it's a great idea 😀
Thank you - any way you could fix the patch so it doesn't play the sound effect when "0" items are dropped? Currently, if you click "discard item" and it prompts "how many?" and you decide "0" it still plays the SE. Thanks again!
I guess, it could be done by making a little condition like

Code:
RPG::SE.new('name', volume, pitch).play if @amount > 0
Thank you - do you know the exact name of the amount variable? Currently, as you write it, it gives an error. Thanks. Would you prefer I send you a PM?

Nvmd, transcription error, works perfectly
Hi Theo,

There seems to be a bug with YEA Equip Engine and Tsukihime Instance Item + Addons with your Limited Inventory

1) Whenever I am at the equip screen in battle and I remove "Normal Clothing", I try to reequip it but it is removed from my inventory entirely! D:

Here are some screenshots to help illustrate:

http://i.imgur.com/1Cn17pC.png <-- Screenshot that has my normal clothing on

http://i.imgur.com/CoGzZxh.png <-- Screenshot that I can't equip normal clothing anymore

http://i.imgur.com/whK4DqM.png <-- Screenshot that the armor "Normal Clothing" isn't in my inventory anymore. :c

2) Also whenever I equip an instanced item, like a Hand Axe (25/25) through change equipment, it doesn't initialize it, until I unequip it. Also I can't unequip weapons when your limited inventory script is active.

Any advice?

Original thread: https://forums.rpgmakerweb.com/threads/theo-limited-inventory.17101/