The idea is this. After a particular boss fight(should you lose) your party is chucked into prison and your items are taken away. One member of the party manages to get free and uses the air vents (which form a sort of dungeon) to get to their gear and the keys to the cell. My problem is figuring out how to remove whatever gear the player is wearing and having it be picked up once the 'dungeon' is cleared. I looked at the multiple inventory script but am having some issues wrapping my brain around it and it seems incompatible with my scriptset (yan scripts and a crafting script). Is there another way of finding out what is equipped and what potions are in inventory - removing all of this - saving the data - and storing it somewhere to be found by the player?
Jail System help please!
RPG Maker VXAce SupportWould it be possible to set a switch that, when activated, set the party's items to none? Then, just turn off the switch when the items are returned? I speak as a non-scripting eventor. I hope that helps! Your game sounds pretty neat!
Edit: Argh. I'm such a dunce. I completely misread the forum. I didn't know this was for script support. I'm so sorry, man. X__X; I hope you find the help you need. 🙂
Edit: Argh. I'm such a dunce. I completely misread the forum. I didn't know this was for script support. I'm so sorry, man. X__X; I hope you find the help you need. 🙂
The only thing I have thought of is setting variables from the beginning of the game to track and flip on switches for each and every item and then turn them off to remove them from the inventory and then somehow turn them back on after the dungeon is cleared. But that requires switches and variables for every single item and seems like more trouble than it is worth.
Moving back to VX Ace Support
You don't need to use a script to do this - you can do it using a Script call within events.
The "one person" who manages to get free - is that a particular party member, or could it be any of them? When they pick up the gear, will they get ALL of it, or just their own stuff?
Once you answer these questions I'll show you how to do it.
You don't need to use a script to do this - you can do it using a Script call within events.
The "one person" who manages to get free - is that a particular party member, or could it be any of them? When they pick up the gear, will they get ALL of it, or just their own stuff?
Once you answer these questions I'll show you how to do it.
It is a particular party member. It goes along with the storyline but to just break it down, the party is built up of a demon girl, a thief who was once a paladin and a slime girl who has taken the form of a human to blend in. The slime character, mistaken for a human, liquifies herself to escape and enters the vents to find her way to the keys and the gear for the party and yes she would pick up all of the gear belonging to the party. My only problem is removing the gear from everyone and returning it because I don't have a way of knowing what the player has equipped or bought so I don't know what to give back.
what about gold?
Not concerned about the gold in this instance really. I set up a bank and figured out how to work variables for gold through some online tutorials, but couldn't find anything like it for gear. I've spent most of the day trying to figure this out.
Stop trying 🙂
Assign a variable to keep your list of possessions. I'll use variable 5 in my example, but you replace 5 with whatever variable ID you choose (no leading zeros). And name it so you don't accidentally use it for something else.
On your event where all the items are taken away, add the following in a Script call:
$game_variables[5] = {}$game_party.all_members.each {|actor| actor.clear_equipments}$game_party.all_items.each {|item| qty = $game_party.item_number(item) $game_variables[5][item] = qty $game_party.lose_item(item, qty) }Then on the event where you retrieve all items again, add the following in a Script call:
This will not re-equip the weapons and armor - it'll just put them back in inventory for later use.The only thing to remember is to make those event pages ONLY run at the appropriate time. If you run the "retrieve lost items" event before the items have been taken away, or after they're given back, it'll give you an error.
shout if the above gives you any problems.
Assign a variable to keep your list of possessions. I'll use variable 5 in my example, but you replace 5 with whatever variable ID you choose (no leading zeros). And name it so you don't accidentally use it for something else.
On your event where all the items are taken away, add the following in a Script call:
$game_variables[5] = {}$game_party.all_members.each {|actor| actor.clear_equipments}$game_party.all_items.each {|item| qty = $game_party.item_number(item) $game_variables[5][item] = qty $game_party.lose_item(item, qty) }Then on the event where you retrieve all items again, add the following in a Script call:
Code:
$game_variables[5].each_pair {|item, qty| $game_party.gain_item(item, qty) }$game_variables[5] = 0
shout if the above gives you any problems.
I have no idea if it worked or not. I hit playtest, got some kind of map error, then RM crashed and now refuses to open.
You'll need to give more information. The map error might have indicated an error in entering the script - so a screenshot of the error and of the event would be good. Although that would only be the case if you actually got to activate the event. If it crashed right on starting, that's something else entirely. You will need to give more information on the crash (an error message?) and what "refuses to open" means. I wonder if your game or database has been corrupted with the launch (which has nothing to do with you adding those event commands).
Found out why it wouldn't open, steam had to update. Thats the price I pay for using Humble Bundle. Loaded back up and the crash just cost me about 3 days of work. Gonna need a bit of time to get back to this point. But gonna quick load a spot to test this out.
Works perfectly, thank you so much. Now I'm just gonna cry for the next few days while I redo 3 days worth of work. Lost my tutorial system, my bank system, three towns, a boss fight, and have to repair several errors I had fixed before. Lesson learned - make backups after everything.
SaroOfDemons, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.
Just edit your previous post and add the new info.
Glad it works. Sorry about the Steam issue.
Just edit your previous post and add the new info.
Glad it works. Sorry about the Steam issue.
Hi Shaz,
I know I'm a bit late but I'm trying to use your script for a similar situation in my game. However when I call the script I get the following error:
SyntaxError: Unexpected identifier
at Game_Interpreter.command355 (rpg_objects.js:10437)
at Game_Interpreter.executeCommand (rpg_objects.js:8895)
at Game_Interpreter.update (rpg_objects.js:8803)
at Game_Map.updateInterpreter (rpg_objects.js:6080)
at Game_Map.update (rpg_objects.js:5987)
at Scene_Map.updateMain (rpg_scenes.js:417)
at Scene_Map.updateMainMultiply (rpg_scenes.js:409)
at Scene_Map.update (rpg_scenes.js:398)
at Function.SceneManager.updateScene (rpg_managers.js:1673)
at Function.SceneManager.updateMain (rpg_managers.js:1641)
Any thoughts?
Thanks a lot!
EDIT: Sorry I just realized this script is for VX Ace not MV!
Any ideas how to do this in MV? Or should I ask in the MV script support?
I know I'm a bit late but I'm trying to use your script for a similar situation in my game. However when I call the script I get the following error:
SyntaxError: Unexpected identifier
at Game_Interpreter.command355 (rpg_objects.js:10437)
at Game_Interpreter.executeCommand (rpg_objects.js:8895)
at Game_Interpreter.update (rpg_objects.js:8803)
at Game_Map.updateInterpreter (rpg_objects.js:6080)
at Game_Map.update (rpg_objects.js:5987)
at Scene_Map.updateMain (rpg_scenes.js:417)
at Scene_Map.updateMainMultiply (rpg_scenes.js:409)
at Scene_Map.update (rpg_scenes.js:398)
at Function.SceneManager.updateScene (rpg_managers.js:1673)
at Function.SceneManager.updateMain (rpg_managers.js:1641)
Any thoughts?
Thanks a lot!
EDIT: Sorry I just realized this script is for VX Ace not MV!
Any ideas how to do this in MV? Or should I ask in the MV script support?
You have both hijacked someone else's thread and necroposted. Please start your own thread in the MV forum, maybe adding a link to this one, explaining what you're trying to do (is your situation EXACTLY the same?). Then we'll be able to assist you over there 🙂
Original thread: https://forums.rpgmakerweb.com/threads/jail-system-help-please.36445/