Jump to content
Galv

Multiple Storage Containers

Recommended Posts

Multiple Storage Containers - Version 1.4
Galv


Introduction
Playing around with my item storage/bank script (which was only one storage) I decided I wanted to try multiple.


Features
You can make any events you choose into storage containers. Player will be able to remove items as well as store them in each container event.
This could be used, for example, for a house the player owns to allow them to store their stuff... or use it for every cupboard, barrel, bucket, chest, pile of hay, etc. in the game.
By default the containers are empty, but you can populate a container any time you choose with script calls.

The name of the container shows in the scene in the top right.
At the bottom of the scene there is text to tell the user when he can "take all" items, a changeable coloured status word (could be used to tell the player if taking things from the container is considered stealing) and a variable that displays in the bottom right (for reputation or you could make it the same variable you use for morality if you're doing that in your game).

Script calls allow you to:
- Add or remove items from any event container.
- Count the number of items in any event container.
- Set up some container features such as if there's a chance to get caught or how much to modify a variable if you steal or add to the container

If you get caught it closes the container and activates a switch for you to use eventing to control what happens when you are caught. (All NPC's could turn aggressive and become on-touch battle encounters for example).

In addition to this, you can notetag items and actors to reduce the chance to get caught or notetag items to make them modify the reputation variable more if they are more valuable.
It's a bit complicated... check out the demo for examples of how to use it.


Screenshot
mult-storage_zps5f9195e0.jpg


How to Use
Place script under Materials and above Main.
Read script instructions for script calls to use.

I think downloading the demo and looking at some of the script calls in use would be better than any instructions I can give as it could be a little complicated for some.
(demo download can be found on the script page).

Script
Get it here


FAQ
None yet.


Credit and Thanks
- Galv


Updates
2013-01-20 - Version 1.4 - Fixed a "take all" bug in dangerous container
2013-01-17 - Version 1.3 - Added "take all" key and a bunch of new features.
2012-10-24 - Version 1.2 - Changed alias naming convention for compatibility with my own scripts...
2012-10-24 - Version 1.1 - Forgot the alias game_temp initialize method... fixed that.

Author's Notes
A bit of a warning, I have no idea the limitations of storing data and would be interested to know if any issues arose from storing hundreds of items across hundreds of event containers. Edited by Galv

Share this post


Link to post
Share on other sites

I should probably update my posts to say where the demo is haha.

Let me know if you run into any problems :)

Share this post


Link to post
Share on other sites

There are instructions in the top of the script. Did you download the demo and have a look at the events? That will show you exactly how to make it work :)

Share this post


Link to post
Share on other sites

Gonna be very helpful for a survival game. Searching through places, taking and stuffing things inside to hide them and stuff, it has a pretty wide range of things it can be used for.

Share this post


Link to post
Share on other sites

Could you add the option to have certain containers not show the "put item" command?

 

This way, you could use this one script for a bank as well as treasure chests that players can't deposit items into.

 

Oh and a "take all" button would be godly!

Share this post


Link to post
Share on other sites

Take all button is a good idea. But if you have the take all button and don't want people to store items in it as well, wouldn't it be more efficient to give the player the items the conventional way? :P

 

I'll add these options when I'm updating this script next.

Share this post


Link to post
Share on other sites

This is a really awesome script, but what are you guys doing about item limits or item weight? If there's no penalty to carrying around 300 suits of armor and a half million potions, (aside from inventory clutter) storage boxes aren't as important.

Hopefully that doesn't come off as negative, because I do think it's a really neat feature and gives you something to work with. Just my two cents.

Share this post


Link to post
Share on other sites
This is a really awesome script, but what are you guys doing about item limits or item weight? If there's no penalty to carrying around 300 suits of armor and a half million potions, (aside from inventory clutter) storage boxes aren't as important.

Hopefully that doesn't come off as negative, because I do think it's a really neat feature and gives you something to work with. Just my two cents.

The script includes a setting to limit the amount of each stack of items. It doesn't limit item groups or by weight, though, which I agree would be good features to use with this. Will look into making it compatible with inventory group/weight limiting scripts if people need it - just link me to the script.

Share this post


Link to post
Share on other sites
Take all button is a good idea. But if you have the take all button and don't want people to store items in it as well, wouldn't it be more efficient to give the player the items the conventional way? :P

 

I'll add these options when I'm updating this script next.

I have a confession lol.  I used your script in a wierd way.  Instead of using an event on the ground, I called a common event from an item in the player's inventory so that it could be like a package sent to the player.  A take all button would make it so I could delete the package from the player's inventory with the same common event and the player would then have his items.  The only difference between this and the standard add items method is the player gets to see all the items in a nifty loot window before they're added to his inventory, possibly getting lost in the fray. 

 

So far it works flawlessly, except I don't want the players putting items back into the packages, only removing until they're empty. 

Share this post


Link to post
Share on other sites

Oh, it works in a common event called from an item? Didn't actually think about using a common event haha... but if it's working, that's good :D

(You might want to do a bunch of tests with different items on the same and different maps, etc. to make sure there's no problems if you haven't already).

Share this post


Link to post
Share on other sites

Hey, Galv, could something like this be used to make a looting system where you are presented with a few different options to loot from an event and whatever you select is taken and the others are lost/forfeited and the event can then be deleted/self-switched to an empty page, making you pick which item you want to loot from for instance a boss enemy?

Share this post


Link to post
Share on other sites

With modifications to the script that would be possible, but that's not what this was made to do :)

This script was designed to make it possible to store items in and take items out of any event... as storage. Put things in then come back later to get them.

 

It sounds like you could use choices for what you want to do?

 

EDIT: Disabling the "put item" button will work for this which I will be doing in next update.

 

EDIT 2: Pretty big update. I spent a while on this and found my coding was very poor when I originally wrote the script (it's not much better now... but a little haha).

Check the original post for updates.

"Take all" button added as well as ability to make it 'take only'.

Edited by Galv

Share this post


Link to post
Share on other sites
With modifications to the script that would be possible, but that's not what this was made to do :)

This script was designed to make it possible to store items in and take items out of any event... as storage. Put things in then come back later to get them.

 

It sounds like you could use choices for what you want to do?

 

EDIT: Disabling the "put item" button will work for this which I will be doing in next update.

 

EDIT 2: Pretty big update. I spent a while on this and found my coding was very poor when I originally wrote the script (it's not much better now... but a little haha).

Check the original post for updates.

"Take all" button added as well as ability to make it 'take only'.

the "get it here" link isn't a link anymore :-(

 

I went through your site and the version there is correct, but the direct link from this page is dead at the moment.

Share this post


Link to post
Share on other sites

Hey, great system. Using it myself now because it does exactly what I need it to do.

 

There was one little thing it lacked that I added though, which was a way to check if the container was empty or not.

(It's being used in my Evented Furniture System. Didn't want them to change the furniture when it had stuff in it.)

 

I added this into the game interpreter:

  def c_empty?(event_id, map_id)
    if event_id <= 0
      container_id = @event_id
    else
      container_id = event_id
    end
    if map_id <= 0
      container_id_map = $game_map.map_id
    else
      container_id_map = map_id
    end
    $game_temp.contents = [container_id, container_id_map]
    return $game_party.container[$game_temp.contents].empty?
  end

Thought you'd like to know incase you wanted to throw it in as another part of your system.

Edited by Titanhex

Share this post


Link to post
Share on other sites

Thanks Titanhex.

Wow I could really improve this script a lot... haha. Might go back and re-write it one day.

 

If you are using it in a conditional branch, a quicker way could be:

def c_empty?(event_id,map_id)
    !$game_party.container[[event_id,map_id]].nil? ||
      $game_party.container[[event_id,map_id]] == {}
  end

Share this post


Link to post
Share on other sites

Think you mean:

  def c_empty?(event_id, map_id)
    $game_temp.contents = [@event_id, $game_map.map_id]
    return $game_party.container[$game_temp.contents].empty?
  end

;)

 

Yeah all scripts that are 6 months old or more are usually a big change in scripting skill for the author. :)

Share this post


Link to post
Share on other sites


Wow I could really improve this script a lot... haha. Might go back and re-write it one day.

 

In my opinion, if it ain't broke don't fix it. If it's working how it should, no point in going back to re-write it when there are plenty of newer things to create!

 

I really need to get into scripting, it's just so complicated and hard to get into. I've tried once before, and I didn't have the patience for it. But I'm a bit older now, so maybe I can handle it, :)

 

But now I'm getting off-topic, great script Galv.

Share this post


Link to post
Share on other sites
Think you mean:
  def c_empty?(event_id, map_id)
    $game_temp.contents = [@event_id, $game_map.map_id]
    return $game_party.container[$game_temp.contents].empty?
  end
;)

 

Yeah all scripts that are 6 months old or more are usually a big change in scripting skill for the author. :)

 

 

 

 

The $game_temp.contents global variable is just storing that array to use as the container key :)

But I did make a mistake, I actually mean:

 

def c_empty?(event_id,map_id)
    !$game_party.container[[event_id,map_id]].nil? &&
      $game_party.container[[event_id,map_id]].empty?
  end

 

 

:P

Share this post


Link to post
Share on other sites

Great Script!!

 

Is there a way to disable the reputation on certain boxes?  I'd like to make use of them as a "Stash" as well as lootable containers.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×