Save-/loadable Inventory

Hey Guys, 


after watching diverse tutorials on YouTube and hours after hours of try-and-error i searched the www for a script that allows me to simply save the current inventory (to actually delete it and load it later).


I found one, still this requiered some changing in other scripts of the vxa. I tried my best, but as i'm not really talented in this, i failed. I asked the author of the script, but it seems that the forum i found the script is not really used anymore and the ppl i wrote to never answered.


In fact, im a complete new RMer and wanted to do a game only with RM-given things... but at the time beeing, my character is in jail and therefor needs to be taken off its inventory..


so far there would be no problem, as i could simply clear every single item availabe (with this script i found i guess, not 100% sure). 


But as the game should continue, the character escapes from jail and (should) find his inventory-stuff in a chest later.


Is there by any chance, someone who knows where i can find a working script?


Or did anyone of you wrote such a script?


If so, it would be more than awesome if you would allow me to use it and send me the script (at best with an explanation how to use it).


At this point, i dont want to earn any money with my project.


Thanks in advance


Diaxos
Use event commands to unequip every equipment your actor/s might have then


call this snippet in an event script call when you want to remove the items


id = 1
id2 = 2
$game_variables[id] = []
$game_variables[id2] = []
$game_party.all_items.each do |item|
$game_variables[id].push(item)
x = $game_party.item_number(item)
$game_variables[id2].push(x)
$game_party.lose_item(item,x,false)
end


Change the value of id and id2 to Game Variables that you are not using, and don't use them for anything else, or you'd destroy the snippet.


Then when you want to regain all items, just call this snippet in an event script call


id = 1
id2 = 2
$game_variables[id].each_index do |index|
item = $game_variables[id][index]
x = $game_variables[id2][index]
$game_party.gain_item(item,x)
end




Make sure that id and id2 are consistent between the two script calls. 


This should do for your current needs, just take note than you shouldn't do something like call the "save items" part more than once before using the "recover items" part.
Thx Adiktuzmiko for your fast answer, sorry im late, had much work to do.


I guess im just too dumb to use this properly u.u


in a test world this works perfectly fine, but with the very same variables used (not used during the game), in my game it doesnt work anymore..


and when i try to check on the variables via F9 Key, my RGSS3Player times out.


Do you have any Ideas what i can do?


Maybe it helps you to know that my character loses the equipment properly with your snippet in map A and should regain the equipment in map B.


I hope I dont bother you too much..


Thx for your help!


Diaxos
in a test world this works perfectly fine, but with the very same variables used (not used during the game), in my game it doesnt work anymore..


and when i try to check on the variables via F9 Key, my RGSS3Player times out.



If it works on a test environment but not in your project, that would most probably mean something is actually changing those variables in your game, probably some other script. This could also happen with just those snippets in case you did like set the event to autorun/parallel and didn't delete it after coz that will run the snippet over again continuously, in which case by the 2nd run of that snippet the party doesn't have the items anymore, so the saved list gets replaced by the current inventory which is a blank one.

Maybe it helps you to know that my character loses the equipment properly with your snippet in map A and should regain the equipment in map B.



So in your own project, they lose the items but didn't regain them? That would then mean that the value of the variables are getting replaced. 


Can you show me a screenshot of the events where you used the lose and regain item snippets?
alternatively you can search for tsukihime's scripts on the master script list, she wrote multiple player/multiple inventory scripts.
Adiktuzmiko , thats exactly what happens..


you were right, one of the events was set to automatic without a proper exit, changed that, still doesnt work ...


screenshots should be below... thx for all your help 🙂  I would be so damn lost without your help 😮

screenshot lose1.png

screenshot lose2.png

screenshot lose3.png

screenshot lose4.png

screenshot regain.png
Good evening Andar, I just found a plugin of tsukihime, that manages multiple inventories, still i dont get how to install it..


In the description she says, I should download the .js data and load it via plugin-manager. But my VXACE doesnt grant me a plugin-manager.. can you help me out on this one?


Im sorry I bother you so much -.- Im really a bloody noob '^^
@Diaxos That is because plugins are for MV, scripts are for Ace - Ace has a script editor, MV has a plugin manager.


You got the wrong script - please search Tsukihimes site again, you'll also find the Ace-Version of it there and that is the one you need, not the MV-Plugin.
Ah, I see... I really didnt know that, sorry -.- Now I found the right script, I think. Still got to get used to the handling.


Thx so far for helping 🙂

Original thread: https://forums.rpgmakerweb.com/threads/save-loadable-inventory.73996/