Just want to check on this, because I know it's something of a common thing in RPGs (especially Eastern ones):
Say the party gets captured. Obviously the captors aren't going to leave them armed and well-stocked, so in the story they take away everything the party has (or most everything). Now as the developer I don't know how many items the characters have gotten, so for all I know they could have a single health potion left, or several dozen, but I want them all gone. The player may get them back later but for now they should have (basically) empty pockets.
Is there a quick way to easily dump the player's inventory out, without having to check a bajillion variables or needing to create a script to do as such?
If you want to get rid of everything, perhaps the easiest way would be blocking the player's access to the item menu then?
But what if he wants to get all the same items/equipments back before it was taken away?
You're not supposed to put it there bro, even if it allowed you, it probably won't do anything...
You put that large code into the scripts section... then just use the 1 liner script I posted on the event command
Oh yea lol, duh my bad, wasn't thinking(It's almost 6am here)
AFAIK, yes that would work... though as I said, I'm not sure if the item quantities will be adjusted as well... I haven't have time to look at those yet so it might not work correctly for that matter...
EDIT: I looked at it, it seems like the item number is the actual thing saved in those arrays so I think it's all okay... 🙂
I'll test it in a bit. Then we'll see if it blows up in my face or not XD
btw, make sure you don't run the restore before doing any clear, that will 99.99% throw a nil error during the first time you try it...
Aaaaand throwing an error already @__@
Current layout is as follows:
"Game" starts;
Character runs over to guard and is given various items (5 potions, 2 weapons [she dual-wields them], 1 piece of body/head armor, and 2 accessories;
Character equips them;
Character then walks down onto black hexagram (remove event);
and then this happens:
[IMG]http://i.xomf.com/fncyx.png[/IMG]
ADDENDUM: After another quick test-run, I found that unequipping/ not equipping the items allows the "purge" Event to pass successfully. However, trying to get the items to restore (via a white hexagram, or the "regain" Event) throws a different error that states: "can't convert Hash into Array" @__@
what is line 85? anyway, I think it seems like you need to unequip all items first before you try to do the removal script...
which line errors for the next error code?
Yay! It worked!... Kinda. XD
I had to remove the '+' in the "return items" bit, because it was throwing another error ("undefined method '+' for {}:Hash"), but after doing that it worked!
Now if I could just remove the equipped items.... :\
Gack.
[IMG]http://i.xomf.com/vfdhs.png[/IMG]