Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 9 posts ] 
    MarkR
  Sun Jan 16, 2011 9:15 pm
User avatar
Member


Location: The Netherlands
Chest system
Version: 2.0
By: Mark Redeman (or MarkR)


Introduction
With this script you can create chests where the player can store or take items, weapons and armors from.

Features
A chest has two properties. The amount of slots it has and whether the items are stackable or not.
    Stackable.
    Stackable means that the chest can contain more than one of the same type of items on one slot. For example:
    An chest which is stackable can contain 99 Potions on one slot, but a chest which isn’t stackable must have 99 open slots to contain the potions.
    Slots.
    The amount of slots determines how many items a chest can have. A chest which is stackable and has 20 slots can contain 20 different items.

Demo
You can download the demo here.

Script
Expand to see the code.


Instructions
Creating a chest.
Creating a new chest is very easy. Use the following code in a call script:
Expand to see the code.

Where the ID is the number which you will be using to call the chest menu.
max_slots is the amount of slots the chest has (Default value is 60).
stockable is a Boolean which determines if the chest is stackable or not (Default value is false).


Example 1:
Creates a chest which can contain 20 different item types.
Expand to see the code.


Example 2:
This chest will have 80 slots. Every item, weapon or armor which is in the chest will use one slot.
Expand to see the code.


Adding items to a chest
Adding items, weapons and armors can be done via the following code:
Expand to see the code.

Where ID is the ID number you used to create the chest.

Activating the chest menu
You can activate the menu with the following code:
Expand to see the code.


Screenshots
This is the menu from which you can store or take items from the chest.
Image

This is what a typical chest event would look like.
Image

Compatibility
The script won’t work with old save files.

Author's Notes
I would appreciate it if I could get some criticism on this script as it’s my first script I published on an English community. ;)

Terms and Conditions
You may use this script as long as you give me credits for making the script.


Last edited by MarkR on Mon Jan 17, 2011 1:59 pm, edited 1 time in total.

Top Top
Profile      
 

    gerrtunk
  Mon Jan 17, 2011 2:44 am
Member

Nice script. It remembers grandia one. As a easy addition it can be interesting to set the items types that a chest can hold.

Im going to add feedhback:

Quote:
# if $game_map.chests[0] == nil
# chest = $game_map.chests
# chest[0] = Game_Chest.new(20, true)
# end


I dont like this. Why use the if here?



Also i like shorter methods in the intepreter that call complex code:

Expand to see the code.


Thats posible too with the adds or show methods.

For last its better to tell the user the default values or the internal script limits.


Top Top
Profile      
 

    MarkR
  Mon Jan 17, 2011 2:04 pm
User avatar
Member


Location: The Netherlands
First of all, thanks for the feedback! :biggrin:

I put the if there so it won't replace an old chest with a new chest.
For example: If you want a chest which you can access in every inn in the game, you would have to create the chest at the start of the game, because if you where to put only the chest[id] = Game_Chest.new(num, type) you would overwrite the chest every time you try to open that chest.

gerrtunk wrote:
Nice script. It remembers grandia one. As a easy addition it can be interesting to set the items types that a chest can hold.
Also i like shorter methods in the intepreter that call complex code:

Expand to see the code.
I will look into that. I haven't worked with the interpreter yet so I didn't think of that.

gerrtunk wrote:
As a easy addition it can be interesting to set the items types that a chest can hold.
I will be adding that feature as an addon as well as showing both windows (the chest window and the party window) at the same time.

gerrtunk wrote:
For last its better to tell the user the default values or the internal script limits.
Do you mean the default values of the amount of slots and whether a chest is stackable or not? I hadn't thought about that. I will add a feature to configure these settings in the next version.


Top Top
Profile      
 

    BlueScope
  Tue Jan 18, 2011 12:51 am
The Third Man
User avatar



Location: Germany
First of all... I like the idea of the script... while it's certainly not your idea to pack items in chests for later use, to my knowledge you're the first to make a script for that. You seem to be rather new at scripting, though, and I think I see some typical eventer's habits here and there... but yeah, let me give you some more pointy feedback as well...

First of all, your layout is a bit questionable if you ask me... you're breaking with standart RMXP conventions a few times in your screenshot there (which is all I've seen from your script, as I didn't try the demo). First of all, you decided against item names in favor for a lot of items... the question is, is that a good thing to do, as usually, people use the same icon for multiple things. Also, item names generally help you finding weapons, as the name is what you identify them by usually - the icon is just a supportive feature.
Second, your help and inventory/chest icons seem to be exchanged... the order to me should be 'select where to operate' -> 'operate (as in select item)' -> 'get help for the item if needed'.
Last but not least, your Window_Command instance is a bit off... your items there are supposed to have an x value of 4, which is why yours look so damn stuck to the left side of the selection area, I think... that you should definately fix imo, it doesn't look very good.

Interface-wise, a selection menu for the two different item storages seems like an easy way to go, requires an additional (and unneeded) key press. Now if you take the Bethesda approach, displaying your inventory and the chest next to each other not only let's you select the other window with a single keypress (L/R, for example), but also shows both lists at once. It's a design that proved itself, and with a bit of writing, you can make sure every last person gets it... personally, I think it's one of the most superior scripts handling this, while I won't miss my very own chance to take it on... but more on that later.

Your scripting style is a bit questionable at times (you have Window_Container in your headers twice, for example... as well as your scene before the window definitions, which isn't really what anyone does... and yeah, you once use if Input.trigger?(Input::C) or Input.repeat?(Input::C), and once if Input.trigger?(Input::C) || Input.repeat?(Input::C) ^^ ), however basically solid. Without looking at it too extensively, the fact that it's 900 lines makes me wonder if you don't have anything unneeded in there, as I don't think you'd need that many to get this functionality done.

So yeah... it might seem to you that I teared it pretty much apart, but believe me - you got off the hook easily ^^ I actually think this script has a lot of potential, and it's a nice way of getting you very deep into RGSS ^^ (otherwise I wouldn't invest that much time writing this now, would i?).
That being said - keep up the good work, and I'm looking forward to updates ;)



Last but not least... the promised concept of mine regarding chests - and actually a unique and pretty awesome approach, if I may say so myself. ;)
The thought behind it is that you need several things at once, without loosing time or finger strength pressing too many buttons. Also, the fact that you might at all times see the amount in a chest vs. the amount in your inventory without looking both up individually is a factor. Therefore, I created a concept working with 3 columns:

Expand to see the code.


The center column shows you the list of all the items that are either a) in the current chest, or b) in your inventory, or c) in both. You best get this if you iterate through $data_items, and check in exactly the way I said earlier (though you can neglect case c) ).
The left and right columns show the amount of items carried of the specific one... or 0 in disabled color if there are none at the time (because they're only in the other container).

Now, you operate it with your arrow keys solely: Up and down keys scroll through items, left moves the current item from chest to inventory, and right does the opposite. You completely save switching through scenes, as well as gain overview, as you can compare 1:1 which items are where, and how many of 'em.
Obviously, this won't work with the icon bunch style that you chose, so if that's what you want to keep up, well... this beauty of an idea of mine (modest, am I not?) won't work. Seriously though: You don't need a chest system in a game where you can carry 6 billion items. Therefore: I can only vote for the list, and I think my system COULD work out pretty nicely... the idea is yours under one condition: You get rid of the 'mark's in the alias names, and promise to work on your scripting style :p (that's right, no credit needed)

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 

    setanbedul
  Mon Feb 07, 2011 11:50 am
Member

I try using this in my game
*thx before

but the same item not add in 1 item.. the result when I input 5 hi-potion..
there 5 hi potion in chest.. not 1 hi-potion with 5 number like the ss above

is there a config to make like SS?


Top Top
Profile      
 

    MarkR
  Tue Feb 08, 2011 10:48 pm
User avatar
Member


Location: The Netherlands
I’m sorry for this late response. I have been busy with other things and forgot about this script. :X

Thanks a lot for your criticism. I’m certain it will help me make a better script. I didn’t know that the items in a command window are supposed to have an x value of 4, but now that I read you post I can see that it indeed looks strange.

Like you said, I made some stupid mistakes with my scripting style (most likely because I was a bit too eager to publish this script) and will hopefully fix that in the next version.

I like your concept. It’s definitely more user friendly, but I also liked the idea of the chests having slots so I’m not yet sure if I will use your idea. I might make two versions, one for large chests and another one for smaller chests, which will use the slots.

One last thing. You said that I should get rid of the mark’s in my aliases (which is fine by me), but I read in the SDK that I should format my aliases like this:
yourname_scriptname_classname_methodname

So should I still use this format (only if the idea came from me of course) or is it not necessary?

setanbedul wrote:
I try using this in my game
*thx before

but the same item not add in 1 item.. the result when I input 5 hi-potion..
there 5 hi potion in chest.. not 1 hi-potion with 5 number like the ss above

is there a config to make like SS?


Could you be a bit more specific? What script codes did you use?
I normally don't speak English, so it would also help if you improved your spelling and grammar. (A)


Top Top
Profile      
 

    BlueScope
  Wed Feb 09, 2011 1:36 am
The Third Man
User avatar



Location: Germany
MarkR wrote:
One last thing. You said that I should get rid of the mark’s in my aliases (which is fine by me), but I read in the SDK that I should format my aliases like this:
yourname_scriptname_classname_methodname

So should I still use this format (only if the idea came from me of course) or is it not necessary?
Well, that's something I'm kinda fighting over with everyone... theoretically
, there could be someone creating an equal script to yours, naming their methods the same and therefore have the same alias names... and apparently, what the SDK creators thought was that there's someone who needs two chest scripts in their game... which is something I don't see happening anytime soon.

So basically, naming aliases is about uniqueness, but not on the cost of being precise and as short as possible... as you could also name an alias fdjngondmfoejornownrfonreognerog_update - not doing anyone any good. Personally, I prefer the format [script]_[original method], such as chestsystem_update. I know that the SDK states something else, so I guess it's up to you to decide on this (as you're the scripter ;) )... personally, the author's name doesn't help me while reading the script, so more unique but actually helpful alias names is definately what I prefer over bluescope_aka_the_third_man_aka_mike_update ^^

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 

    setanbedul
  Wed Feb 09, 2011 2:37 am
Member

if the img small. just click it
MarkR wrote:
...
setanbedul wrote:
I try using this in my game
*thx before

but the same item not add in 1 item.. the result when I input 5 hi-potion..
there 5 hi potion in chest.. not 1 hi-potion with 5 number like the ss above

is there a config to make like SS?


Could you be a bit more specific? What script codes did you use?
I normally don't speak English, so it would also help if you improved your spelling and grammar. (A)
okay
Image
this is my basic world.. there 2 event.. a girl that give me some item and chest
Image
I talked to her and receive item (10 for each item)
Image
in my item menu

Image
now the chest
Image
my item before add
Image
my chest before add
Image
I add a few item
Image
when i click on chest I got this?!? the item is not group but separate
Image
when i return some item.. the item that I remove is still in there .. actualy i can't click it.. is there a bug or this is the script fitur??

thx 4 the script


Top Top
Profile      
 

    MarkR
  Fri Feb 11, 2011 3:03 pm
User avatar
Member


Location: The Netherlands
@BlueScope: Thanks for explaining that to me! I will try to improve the scripting style in the next version of this script.

@setanbedul: That's because the chest you made isn't "stackable", if you don't want the items to be separate, you should use the following code:
Expand to see the code.

Don't forget to change the chest_id and amount_of_slots.

This is the code I used for the chest in the first screenshot:
Expand to see the code.

This will create a chest which is stackable and has 99 slots, which means that you can store 99 different items in the chest.


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 


Who is online

Users browsing this forum: No users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group