inventory confiscation

Status
Not open for further replies.

Barsek

Veteran
Veteran
Joined
Dec 21, 2016
Messages
30
Reaction score
4
First Language
Arabic
Primarily Uses
Hello Everyone ! ( this is my first time using a forum ) 
 


i'm making a game using rpg maker vx ace and i'm on a part where the party get prisoned and i am looking for a script or something that makes all their items confiscated (inventory taken from them ) and after a while they will find it in a tresure chest ( all their inventory ) 
 


Thnx for the help ! ^^
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,078
Reaction score
7,767
First Language
English
Primarily Uses
RMMV
Hi there, if you are wanting a script for this, I can move it over to the script requests section for you.


Though a bit tedious, this could be done with variables, no script needed. You would simply need to store the value of each item in a separate variable. Then later in the event, use that variable to add the number of items back into the inventory.


Coming back because I realize I am a bit wrong - I was confusing MV where you can more easily store the item count in a variable. Still, I think you could event it, perhaps using a script call for the variable control, but I can't find the one needed at the moment. I will leave this here for now, but if a script is necessary, someone will move it to script requests for you.
 
Last edited by a moderator:

Barsek

Veteran
Veteran
Joined
Dec 21, 2016
Messages
30
Reaction score
4
First Language
Arabic
Primarily Uses
ah ok thnx for trying to help! and sorry for not getting this post on the right place this is my first time after all ...and yea i thought about storing em in variables but i just have too many items ..like so many x.x this is why i thought there would be a script to do the job for me or something 
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
12,528
Reaction score
12,836
First Language
English
Primarily Uses
RMVXA
I did this with a multiple inventory script (Formar0153 has one I think?). When you wish the inventory to be confiscated, change the inventory (that will wipe it out). You'll have to de-equip everyone first though, as it only changes your inventory.


Then, when you find the chest, merge  your current inventory (in case they pick anything up) with the old inventory. Or, if it is impossible for them to pick anything up, just switch back to the old inventory.


As a side note, you may wish to tell the player to reequip their stuff, as they might not expect their weapons to now be in their inventory.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,078
Reaction score
7,767
First Language
English
Primarily Uses
RMMV
No worries - it can be a bit confusing exactly where things should go for us as well at times. :p


I'll move this to script requests then.
 

Adventurer_inc.

Technically a Programmer
Veteran
Joined
Sep 12, 2015
Messages
99
Reaction score
40
First Language
English
Primarily Uses
RMMV
Don't really need a full script for a one time thing. You could also do a call. Although a bit inefficient, it is simple.


Just run this with the Command Script in the Event Command. (This assumes you aren't using a special item script that creates different item data.) Just change the 99 to whatever variable is free and let Maker handle the rest.


This stores all UNEQUIPPED items, weapon, and armor in the variable 99:


$game_variables[99] = {}
($data_items + $data_weapons + $data_armors).each{|i|
$game_variables[99] = $game_party.item_number(i)
$game_party.lose_item(i, $game_party.item_number(i)) }




This retreats all items from variable 99:


$game_variables[99].each{|i,a| $game_party.gain_item(i, a)}


This should work and is simple enough to check, unless I blew something up.
 
Last edited by a moderator:

Barsek

Veteran
Veteran
Joined
Dec 21, 2016
Messages
30
Reaction score
4
First Language
Arabic
Primarily Uses
Sweet Babies !


it works like magiiiiiiic !


thnx all i've been looking for this everywhere ! i really am grateful for ur help guys :'D
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,078
Reaction score
7,767
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I was stunned-STUNNED-to find that I have been working on my current project since November. It feels like so much less time than that.
Stream will be live shortly with some art! Going to do a recolor, then start on a new monster! Feel free to drop by!
I've been busy working on other projects this month so I haven't been able to do much towards finishing the prep work for my RPG, but I did brainstorm some interesting ideas for the game.
redrawing one of three my VNM protags
I'm making my game in both English and Portuguese. I wonder if I should add Spanish too? :v

Forum statistics

Threads
93,709
Messages
914,835
Members
123,312
Latest member
Jonas930
Top