Theo - Limited Inventory

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by TheoAllen, Aug 19, 2013.

  1. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,511
    Likes Received:
    5,120
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    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.

    Hmm... can you post the screenshot?
     
    #41
  2. Kuronokun

    Kuronokun Villager Member

    Messages:
    21
    Likes Received:
    2
    First Language:
    French
    Last edited by a moderator: Sep 16, 2014
    #42
  3. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,511
    Likes Received:
    5,120
    Location:
    Riftverse
    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
     
    #43
  4. Kuronokun

    Kuronokun Villager Member

    Messages:
    21
    Likes Received:
    2
    First Language:
    French
    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: Sep 17, 2014
    #44
  5. nio kasgami

    nio kasgami VampCat Veteran

    Messages:
    8,600
    Likes Received:
    2,359
    Location:
    Canada / Quebec
    First Language:
    French
    as I can see this is rather simple to transform this script into something candy : 3!
     
    #45
  6. Kuro Neko

    Kuro Neko Veteran Veteran

    Messages:
    173
    Likes Received:
    15
    First Language:
    English
    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]

    please help me to fix this.
     
    #46
  7. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,511
    Likes Received:
    5,120
    Location:
    Riftverse
    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: Sep 21, 2014
    #47
  8. Kuro Neko

    Kuro Neko Veteran Veteran

    Messages:
    173
    Likes Received:
    15
    First Language:
    English
    I tried the patch fix for YEA's menu cursor, it doesn't work at all, is there something wrong?
     
    #48
  9. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,511
    Likes Received:
    5,120
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    This is how I fixed mine. And it worked

    [​IMG]

    How is yours?
     
    #49
  10. Kuro Neko

    Kuro Neko Veteran Veteran

    Messages:
    173
    Likes Received:
    15
    First Language:
    English
    Ah sorry, my bad, wrong type. I'm using Moghunter's menu cursor, not YEA's. Really sorry...
     
    #50
  11. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,511
    Likes Received:
    5,120
    Location:
    Riftverse
    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
     
    #51
  12. Kuro Neko

    Kuro Neko Veteran Veteran

    Messages:
    173
    Likes Received:
    15
    First Language:
    English
    now it work like a charm :D
     
    #52
  13. metronome

    metronome Veteran Veteran

    Messages:
    348
    Likes Received:
    142
    First Language:
    English (Sure!)
    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: Oct 22, 2014
    #53
  14. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,511
    Likes Received:
    5,120
    Location:
    Riftverse
    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
     
    #54
  15. Dymdez

    Dymdez Newbie-in-Chief Veteran

    Messages:
    752
    Likes Received:
    148
    Location:
    Western Massachusetts
    First Language:
    English
    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: Oct 28, 2014
    #55
  16. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,511
    Likes Received:
    5,120
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    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
    None at the moment. But it's a great idea :D
     
    #56
    Dymdez likes this.
  17. Dymdez

    Dymdez Newbie-in-Chief Veteran

    Messages:
    752
    Likes Received:
    148
    Location:
    Western Massachusetts
    First Language:
    English
    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!
     
    #57
  18. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,511
    Likes Received:
    5,120
    Location:
    Riftverse
    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
     
    #58
  19. Dymdez

    Dymdez Newbie-in-Chief Veteran

    Messages:
    752
    Likes Received:
    148
    Location:
    Western Massachusetts
    First Language:
    English
    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: Oct 28, 2014
    #59
  20. MrPurpleDreadlocks

    MrPurpleDreadlocks Veteran Veteran

    Messages:
    159
    Likes Received:
    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?
     
    #60

Share This Page