Jump to content

Taking And Giving Items Back To The Actor

Recommended Posts


I'm unsure if this would be a plugin or an evented problem, but I assumed plugin since eventing would be more confusing to me >.<;

I'm the problem is fixed by eventing (not an overly complicated one though) then this can be moved :)


Anyway, I want a situation in my game where so far through the game, the character is stripped of all their items and equipment, but later they will get their items back.

My problem is replicating the exact amount of items/quantity they originally had.


I could try predict this but since there will be battles and optional items, I can't really predict how many items are used/found.


Is their a possible plugin that can save these details and then be called on when they are given back?

I was considering using Hime's Actor Inventories plugin, but I'm not sure if that would work correctly for this situation.


I can't access my game for the next few days so I also couldn't test that plugin to do that anyway.


Any feedback/help on this could help~




Share this post

Link to post
Share on other sites

I'm not good at deciphering the coding parts.

Was any of that to be adjusted at all?


I made a test event copying the exact script code you wrote, and I got an error for the taking items part.

I'm not sure what parts to change and what parts are meant to be kept ^^;

Sorry >.<, I really appreciate this though!

Share this post

Link to post
Share on other sites

Ah, I missed a character.

Here's the code.



var v = $gameVariables._data;
v[2] = $gameParty.allItems();
v[3] = [];
for (var i = 0; i < v[2].length; i++) {

Getting back items:

var v = $gameVariables._data;
for (var i = 0; i < v[3].length; i++) {
  $gameParty.gainItem(v[2][i], v[3][i]);

2 being ID of variable where to save items

3 being ID of variable where to save items amount

Share this post

Link to post
Share on other sites

Ooh, i see the mistake. I should've noticed that myself >.<;

Thanks Glasses~



I've tested it and it works perfectly now!

Thank you very much for your time and help :) I really appreciate it ^^


*gives cookie*




Oh, this can be closed now since the problem was fixed~

Thankies <3

Edited by Takeo212

Share this post

Link to post
Share on other sites
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.