Theo - Limited Inventory

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,499
First Language
Indonesian
Primarily Uses
RMVXA
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?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,499
First Language
Indonesian
Primarily Uses
RMVXA
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
 

Kuronokun

Villager
Member
Joined
Aug 10, 2014
Messages
21
Reaction score
2
First Language
French
Primarily Uses
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 ^^
 
Last edited by a moderator:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,949
Reaction score
3,040
First Language
French
Primarily Uses
RMMV
as I can see this is rather simple to transform this script into something candy : 3!
 

Kuro Neko

Veteran
Veteran
Joined
Sep 26, 2013
Messages
173
Reaction score
15
First Language
English
Primarily Uses
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:



please help me to fix this.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,499
First Language
Indonesian
Primarily Uses
RMVXA
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 !@window.active || @window.close? return rate endend@nio: if you can, that would be great :D 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
 
Last edited by a moderator:

Kuro Neko

Veteran
Veteran
Joined
Sep 26, 2013
Messages
173
Reaction score
15
First Language
English
Primarily Uses
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 !@window.active || @window.close? return rate endend@nio: if you can, that would be great :D 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?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,499
First Language
Indonesian
Primarily Uses
RMVXA
This is how I fixed mine. And it worked



How is yours?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,499
First Language
Indonesian
Primarily Uses
RMVXA
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
 

Kuro Neko

Veteran
Veteran
Joined
Sep 26, 2013
Messages
173
Reaction score
15
First Language
English
Primarily Uses
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 :D
 

metronome

Veteran
Veteran
Joined
Aug 21, 2014
Messages
338
Reaction score
144
First Language
English (Sure!)
Primarily Uses
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!
 
Last edited by a moderator:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,499
First Language
Indonesian
Primarily Uses
RMVXA
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
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
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]?"
 
Last edited by a moderator:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,499
First Language
Indonesian
Primarily Uses
RMVXA
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 :D
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
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 :D
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!
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,499
First Language
Indonesian
Primarily Uses
RMVXA
I guess, it could be done by making a little condition like

Code:
RPG::SE.new('name', volume, pitch).play if @amount > 0
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
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
 
Last edited by a moderator:
Joined
Jan 23, 2014
Messages
159
Reaction score
19
First Language
English
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?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Dad's watching a WWII documentary while I work on some cool assets for my games. I just love RPG Maker!
Also Happy Halloween! Dad's friend won't be coming unfortunately, but Dad will still be taking me to Boxi Park to have some fun tonight! I'll be posting a video on my YouTube channel of the show, and I'll be sure to post a link here.
"Nightmares exist outside of logic and there's little fun to be had in explanations. They're antithetical to the poetry of fear. In a horror story the victim keeps asking why, but there can be no explanation and there shouldn't be one..." - Stephen King
I feel people seek explanation and demand it sometimes in games, but in the horror genre, well, maybe you shouldn't have one. Silent Hill 1 comes to mind...
Managed to implement QSprite.

Always double check your plugin order.


Finally! I've been puzzling over why it wasn't working for two days now. Turns out all of my calculations were correct, I just forgot to give some events hitboxes. :kaoswt: Now my randomly generated maps check for collision errors, and move stuff around in real time if they finds any. :LZSexcite:
Ami
--- OP Candy ---

Kids: Trick Or Treat!
Hero: Alright,here's the Candies (Give A Bunch Of Candy).
Kids: Thank you,Mister! (Running)
Hero: How cute they are…
F.Archer: Did you give them a OP Candy,accidently?
Hero: Huh?

Forum statistics

Threads
104,680
Messages
1,008,060
Members
136,167
Latest member
Gbasire
Top