[XP] Item Storage

Started by G_G, May 01, 2009, 08:50:28 pm

Previous topic - Next topic

monkeydash

Love this script, its gonna make it so much better than having an event for every chest.

I was wondering though, if its possible to put Gold in the chests.

G_G

Possibly in a later version. I'm remaking the system completely for a friend who plans on making an Oblivion esque game.

Xero

Quote from: monkeydash on January 16, 2011, 10:33:51 am
Love this script, its gonna make it so much better than having an event for every chest.

I was wondering though, if its possible to put Gold in the chests.



If you want to have gold in your chests simply make an item that represents your gold then make a common event with a conditional branch that says
"If you have 1 gold (the item you made), remove it from your inventory then add one gold (the actual money)" Give it kinda a fallout feel :3






This just looks to sick!

monkeydash

Thanks Xero. Im sure that will do in the meantime.

rezpect

whether this necropost?
if so, sorry!

I just wanted to ask, if this script could store only one kind of thing only?
as in the first chest can only store a weapon!
and the second chest can only store as armor!

if you can like it, please let me know how?  :bow: :nod:

OOT : sorry my english is very bad  :facepalmx: :facepalmx: :whistle:

diagostimo

hi there, i was wondering if you could help me with a problem im having trying to run this scrip with the os script, i have got the most recent update.

i have included the os add-on right below the item storage script, and these are below the two os scripts, i create a new user on the server it loads fine, i quit the game then reboot it loging in as same user, loads fine, i go to anpc that executed the item deposit and put some random items in there, quit then log back in and i get this error:

Script'(RM-OS) Script' line 2458: Argument Error occurred.

any idea what im doing wrong or is this script no longer compatible with the recent version?

G_G

Should still be compatible. However, I'm gonna do a rewrite of this script, make it a little more prettier and better all around. If I have time I'll look into the RMX-OS problem.

diagostimo

that would be great if you could, i am also using alot of the other os addons so maybe there could be conflict? ignore the pm i saw you were online and thought you might have not seen my post:)

diagostimo

i tryed messing with it but no luck, the error occures on this section of the os script-

#----------------------------------------------------------------------------
  # Deserializes data retrieved from the server into this object.
  #  prefix - semantical prefix for loaded data access
  #  classe - class that needs to be instantiated
  # Returns: New instance of a class after loading.
  #----------------------------------------------------------------------------
  def rmxos_deserialize_object(prefix, classe)
    # if classe requires additional creation arguments
    if RMXOS::Options::CREATION_DATA.has_key?(classe)
      # get the arguments
      args = RMXOS::Options::CREATION_DATA[classe]
      # create an instance with those arguments
      new = eval("#{classe.name}.new(#{args})")
    else
      # simply instantiate the class
      new = classe.new
    end
    # load data for this class
    new.rmxos_deserialize("#{prefix}/#{classe.name}")
    return new
  end
 
end

the error to be specific is on this line-

# simply instantiate the class
      new = classe.new

so the problem i guess is not saving the class with the data but initiating it with the new data

Helskyth

Necropost in a way, but, there's something I was hoping you could help me out with that uses your Item Storage.

I know that it's designed so the player physically interacts with a chest in order to place items in there, but is there a way of forcing items to be removed from a players inventory and being placed into a chest without physically interacting? :huh:

For example: I have a scene where the characters are captured and taken to a prison. Naturally, they'd lose all their items because what idiot would let their prisoners carry swords still? Unfortunately, the engine only has ways to store the players equipped items in variables (and I suppose with more sleuthing, I could get the item ID of every item they "may" have on them and store that amount in variables too to be called upon and re-allocated later), so you can see where this isn't all that practical.

So is there by chance a way of scripting it to take items from an inventory, maybe by referring to item ID's to know what to remove (or something, I really haven't got a clue how such would work.  :^_^':)

Thanks in advance for any help.
It's not me that's addicted to coffee. It's the coffee that's addicted to me!




My Deviant Art
My Youtube

G_G

I'll do a quick script revamp. Its possible but it'd be a pain in the ass. I'll rewrite a few parts of the script and it should be easier to add items to chests in game.

Helskyth

Don't press yourself if it's a massive pain. Finding an alternate way to solve the problem I described is a good challenge still, that I'd give it a shot with events and variables still. Or just cut-scene the bitch hardcore. :D
It's not me that's addicted to coffee. It's the coffee that's addicted to me!




My Deviant Art
My Youtube

G_G

Updated to 1.3.

Changelog:
-You can now add/remove items to chests while in game.
-You can take all items from a chest (Limits you to 99 items)
-You can now empty your inventory into a chest

Note: These new features can only be accessed via script call. They are not part of the scene itself.

Script Calls: (Also in instructions)
 New Syntaxes:
You can now take all items from a chest and empty your entire inventory
into a chest. While this isn't built into the scene, you'll have to do this
through a script call.
-Take All
   chest = $game_system.chests(chest_id)
   chest.take_all
-Empty Inventory
   chest = $game_system.chests(chest_id)
   chest.empty_all

You can now add/remove items to and from chests.
   chest = $game_system.chests(chest_id)
   chest.aaa_bbb(ccc, ddd)
   aaa = add/take
   bbb = item/weapon/armor
   ccc = item/weapon/armor id
   ddd = amount

Helskyth

Just put the new script calls on a run for their money then, and they worked seamlessly!

Thanks a shot-load G_G. This script's going to make things a hundred times easier!
It's not me that's addicted to coffee. It's the coffee that's addicted to me!




My Deviant Art
My Youtube

zottel89

June 02, 2012, 11:04:10 am #54 Last Edit: June 02, 2012, 11:10:39 am by zottel89
Hey there, game_guy  :)

Your script is reaaally awesome, I love it !
I have just one question (which has actually already been asked):

Quote from: SP27 on January 01, 2010, 07:57:26 pm
The only thing that I really feel is missing is that you can put all of your items in it.
What I mean with that is that some items you don't want the player to be able to remove from the holding bag.

Would you be kind enough to consider this feature in a future update?


Quote from: game_guy on January 02, 2010, 03:23:52 am
Yea I'll add that. So pretty much you want to be able to not put some items in there. That'll be simple. The hard thing is when I'll be able to do it.



Is this still in the making ?! 'Cause if it is, then I'm gonna be a really happy guy someday :P

Right now, I'm having a pretty simple "Diary" system in my game.
It's basically an item, which starts a common event that tells the player his
current main quest (based on variable values).

The thing is...  I don't want the player to be able to put the diary into the "Item Storage" (Chest).
That's kind of my problem right now ^^


Sry for the bad english btw,
I'm no native speaker.

G_G

I'll try to get to it sometime soon. Finally out of school so I've got a lot of time on my hands.

zottel89

Quote from: game_guy on June 02, 2012, 11:37:06 am
I'll try to get to it sometime soon. Finally out of school so I've got a lot of time on my hands.


Yey, really glad to hear that :)
Thank you so much ^^

G_G

I found a bit of time to do it tonight, updated to 1.4. I look through this code and I just wanna revamp it so much. It's so messy. >.< Anyways, you can now mark Items, Weapons, and Armors with a "Key Item" element to prevent specific items from being stored.

diagostimo

hey game guy, i was just wondering if you had the time to look into the RMX-OS issue? i have resurected the old project i had the issue in but would really like to have this script apart of the online system as lets face it every mmo needs a banking system, so i have stripped the project down to just this and rmx-os, and the issue is still there, heres a screeny of the error that occurs:
Spoiler: ShowHide


since i have little knowledge in scripting now i checked the rmx-os options, your script and the rmx-os add-on to save the data, and you where right it should work its all there in black and white, ill detail what happens abit more, so in the script i have 99 potions set-up in a container, when i log in and take lets say 10 of these, I quit out of the game the re-log in, when i re log in this is when the error pops up, then i log in again this time no error, if i check my bag and i obtained the potions, when i check the container they where never taken :/ any help is appreciated :)

G_G

Have you tried using an updated version of the script? I did recently add a new feature, and about 2 months ago I did refactor it a bit. If the problem still persists, I'll look into it when I get back home. (Few more days)