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
15,352
Reaction score
8,532
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
13,522
Reaction score
14,255
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
15,352
Reaction score
8,532
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
41
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
15,352
Reaction score
8,532
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 Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,855
Messages
1,017,007
Members
137,563
Latest member
MinyakaAeon
Top