RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Grid Inventory 1.0f

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Ugh, yeah. Thanks for reporting that. I hate it when I leave errors like that.

Replace @placements with @inventory.placements and it should be fine. It should look like this:

Code: [Select]
@inventory.placements.each { |slot| count -= (slot.rect.width*slot.rect.height) }

Though, are you still using 1.0 and not 1.0b? That line should be around 1987, not 1879.

Unless you deleted the header, which you absolutely should not do.


EDIT::

Script is now updated. It still says 1.0b but it shouldn't - it should be 1.0c since I updated the above line in the script. But I'm too lazy to release another version just to change the letter. Point is, if you got this script before I made this post, you will need to redownload the script.
« Last Edit: August 06, 2009, 04:00:40 AM by modern algebra »

**
Rep:
Level 84
Does that include me?
Did u make a change so big that it's worth changing or did u just fix it up and post the fixed script?
just wanna be safe LOL!

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
The only change I made is the one in my previous post. I changed @placements to @inventory.placements. If you do that manually then there is no reason to redownload the script.

**
Rep:
Level 84
Cool then. Okay now i have just one last suggestion for your script.
When you go and buy items the item just goes to the person that has a slot open.
What it should let you do is choose the person that u want to hold the newly bought item. And if the person has a full inventory then it should give u either a sound effect or give you a message telling you that the inventory is full.

What do you think?

i think it would be good cuz then you wont have to  sort through the items one by one deciding who will have what because they will have it from the start cuz u bought it for them.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
It's not a bad idea, but I'd have to add things to Scene Shop, which would make it incompatible with a lot more scripts. It's not really worth the effort I don't think.

Maybe I will do it in the future, but not for a long long time if ever.

**
Rep:
Level 84
LOL! fair enough!
Still a great script though!
Again thanks i really needed it!

**
Rep:
Level 84
Um I have a question, i tried opening the storage box but i keep getting syntax errors.
Could i maybe get an example of how to do it?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Do you get errors opening the storage box in the demo? The red and green chests are both examples of a storage box.

 You can look at those events for examples on how to setup storage boxes.

In text, it's something like this:

Code: [Select]
potion = [0, 1, 4]
spear = [1, 3, 1]
shield = [2, 1, 1]
items = [potion, spear, shield]
open_storage (0, items, "Red Chest", 79)

But you have to make sure that none of the lines go over the limit and onto a new line.

The best way to do it is to not use such long names like potion, spear, etc... and instead use something like this:

Code: [Select]
a = [0, 1, 4]
b = [1, 3, 1]
c = [2, 1, 1]
items = [a,b,c]
name = "Red Chest"
open_storage (0, items, name, 79)
« Last Edit: August 15, 2009, 06:52:01 PM by modern algebra »

**
Rep:
Level 84
Umm...
Yeah im still a little confused.

I just want to make a big storage box where I can store or withdraw any item that was previously stored.
Could i get a code for that? i can't seem to figure out how to do that... ???

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Code: [Select]
open_storage (0, [], "Chest", 79)


That's it. If you have other storage units, then you need to change the 0 to whatever index you want this storage chest to have.


**
Rep:
Level 84
Awesome now i can open it. Thanks, but i want the actor to be able to take his or her own items and add them to the storage unit. I tried the add to storage Script tage but it won't work for some reason, what code or codes do i need to do that.
Also is there a code that is able to increase the size of the storage unit?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
You just scroll to an actor by pressing Q or W and once in those inventories, you can add to the inventory by clicking on an item and going down to store.

*
Rep: +0/-0Level 83
Alright I just downloaded this, and pasted the script Into a blank map of my own (along with the other two scripts you said were needed/recommended). I created my own item, made an inventory folder just like on your game and put my item in there and had everything set up exactly as in your game as far as my item.

Now when I first start the game, If I open my inventory, everything is fine. If I try to open my inventory after I have placed my item in it, It gives me this error:

Script 'Grid Inventory' line 1837: RGSSError Occured
disposed bitmap

I checked line 1837 and it says  "contents.font.size = default_font_size"

What am I doing wrong?

**
Rep:
Level 84
Oh... i did not see that anywhere dude. Thanks!
But the Storage inventory is a tad bit too small. I tried the resize script call but its not working...
here is what i used:

resize_storage_inventory (0, 10, 10)

I don't understand why it doesn't work...
What did i do wrong?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Is 0 the correct index for that storage unit?

NM, there was a mistake in the code. Go to about line 1053 and change:

Code: [Select]
   $game_system.open_storage (id).resize_grid (width, height)

to:

Code: [Select]
   $game_system.open_storage (storage_id).resize_grid (width, height)

Also, note that you could set the size directly when first opening a storage inventory by adding that to the call when the chest is first opened. SO:

Code: [Select]
open_storage (0, [], "Chest", 79, [10, 10])

Would make the storage unit 10x10

Also note that the number 79 is the icon for the chest. Chances are you don't want that icon though, so you should change it.
« Last Edit: August 16, 2009, 03:04:56 PM by modern algebra »

**
Rep:
Level 84
Wow thanks dude!
Also for me the line was 945 for those who can't find the line exactly!

thanks again man!

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Did you delete the header of the script? It's 108 lines, which might explain why it's different. In any case, you really shouldn't do that. Put the header back in the script. It has all the instructions.

**
Rep: +0/-0Level 83
Hi there,
I decided to try you grid script since you told me (about limited inventory script) that this grod script was a bit like what I sought.
I tried it, loved it as suspected until I tested a fight.
I get an error wich maybe you could help me for.
Know that I use ziifee's wait gauge script, but oddly it never made any error occur with your limited inventory script.
The error message was Script 'Grid inventory 1.0' line 3201:noMethodError occured
undefined method 'inventory' for nil:nil Class

I know nothing in scripting at all, but I feel it might be easily repaired. Otherwise it seems I'll have to stick with the basic default inventory system (unless anyone manage to figure what's happenning or you repair the bug I mentioned earlier about your limited inventory script).


Yeah, I cannot discard ziifee's battle system it is quite nice indeed.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Hmm, well try putting the Grid Inventory Script below all other custom scripts you have (but still above Main) and see if that works.

**
Rep: +0/-0Level 83
Hmm, well try putting the Grid Inventory Script below all other custom scripts you have (but still above Main) and see if that works.

Hmmm, same type of error. Unlike my previous test, I tried an actual ingame fight rather than a test from database. Error message is still linked to line 3202, but is related to ennemies it seems:

undefined method 'inventory' for #<game_ennemy:0x12b7070>

Maybe it helps to discover the origin of the error and a way to help me repair it?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Does ziifee's battle system allow enemies to use items? I think that is where the problem is originating from.

Around where the error is, you should see:
Code: [Select]

  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Start Item Selection
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalr_invgrid_slctitm_windo_4h21 start_item_selection
  def start_item_selection (*args)
    # Run Original Method
    modalr_invgrid_slctitm_windo_4h21 (*args)
    return unless  ModernAlgebra::GI_PERSONAL_ITEM_USE
    # Setup inventory
    @item_window.ma_inventory = @active_battler.inventory
    @item_window.refresh
  end

Replace it with:

Code: [Select]

  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Start Item Selection
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalr_invgrid_slctitm_windo_4h21 start_item_selection
  def start_item_selection (*args)
    # Run Original Method
    modalr_invgrid_slctitm_windo_4h21 (*args)
    return unless  ModernAlgebra::GI_PERSONAL_ITEM_USE || !@active_battler.actor?
    # Setup inventory
    @item_window.ma_inventory = @active_battler.inventory
    @item_window.refresh
  end

The only difference is that it checks if the active battler is an enemy or not and doesn't proceed if it isn't an actor.

Hopefully, that will resolve the issue. Tell me if it doesn't

**
Rep: +0/-0Level 83
Man I really hoped it would clear everything, but the same error occurs... ...well, strangely, sometimes it is about the same error message I last showed you and sometimes the first one (with the 'nil' word instead)

Dunno if Ziifee's script allows ennemies using items.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Can you give me the complete error messages. Like the last one and include the line number. Copy it completely.

**
Rep: +0/-0Level 83
There you go (battle test from database VS succubus):

message 1:
Script 'Grid inventory 1.0' line 3202: NoMethod error occured
undefined method 'inventory' for #<Game_ennemy: 0x1327780>

message 2:
Script 'Grid inventory 1.0' line 3202: NoMethod error occured
undefined method 'inventory' for nil:NilClass

I am not too sure what affects what message is shown, but according to my tests, it seems it depends if the ennemy is attacking/acting or not before I select the inventory command. Not sure tho...



« Last Edit: September 03, 2009, 04:55:47 PM by adamass »

**
Rep: +0/-0Level 83
Why, you know I'd send you ziifee's demo so that you could check upon it if you desire so, but I ain't sure it's a good Idea to post it here. Maybe that would help you in your search for a solution  :-\