Home
Help
Search
Calendar
Login
Register
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
New forum theme up and running!
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
Jail (Rm2k3)
« previous
next »
Print
Pages: [
1
]
Author
Topic: Jail (Rm2k3) (Read 2374 times)
SqareMan
Initiate
Posts: 40
Jail (Rm2k3)
«
on:
April 25, 2010, 02:43:53 AM »
Hi im trying to make a rip-off of The Elder Scrolls IV: Oblivion and I had every thing under control untill I came across the crime system. I can make it to where you steal and get a bounty but what I cant do is figure out how to save my inventory to a varrible so that when you get out of jail you'll get all your stuff back. Please help me.
Thanks In Advance,
SqareMan
Logged
Prpl_Mage
Administrator
Sage
Posts: 7,644
The Administrator Mage
Re: Jail (Rm2k3)
«
Reply #1 on:
April 25, 2010, 07:10:12 AM »
What you ask off can be done, but it's pretty much the reason why most RPGs have a shared inventory even though your other party member found that sword in a dungeon in another continent.
The simple answer would be to forbid you to access the menu while in the prison, then when you get out - the player can access the inventory as well as the rest of the menu as he pleases. And you also remove all equipment from the character so that if a battle occurs - he won't have the sword of thousand lies equipped and a full set of dragonscale armour.
Now for the hard version that actually stores everything you got.
Step 1.
What we do is to create a whole friggin bunch of variables who's job is to see what items you have and how many.
So we need to use the "Variable Operations" command, you choose a variable and set it "Equal To" - Item - Number Held.
So the Variables value will now be the same as how many items you had.
For example potions. you take the variable "potions held" set it equal to Potions held. So if you had 50 potions - the variable will know that you had 50.
Continue doing this with all the items in the game. medicine, equipment, key items and so on.
PS: Remember to unequip all items of the character before doing this.
Now for step 2.
We now know how many you have of each item. Now we need to remove all your items and equipment.
There are two ways of doing this, but they pretty much require as much work.
You add a "Item management" command, in that one you choose the item and remove a set number. The first way to do it is just removing 999 of them, they will most likely be 0 left. Or you can do it the nice and formal way and remove the number stored in the variable for the item. What? You're too lazy to do that... Go figure.
So you add an item management for all the items in your game where you remove all.
Step3.
This is the opposite to step2, you get your items back after getting out of prison.
You add item management command.
Pick your item
Add as many as the value stored in the variable that checked for how many you have.
So, the variable for potion is 50 from before.
You go to the item management. Potion - Add - value stored in Variable: Potions in party
You will now recieve 50 potions.
Rinse and repeat for all the items in your game.
So, we began by storing how many items you had.
Then we removed all items you had
Then we added as many items as the variable had stored.
That's the really long and complicated way of doing this. If you have 300 items you'll have to make all of the steps for each item. Store it in a variable, remove items, add items.
Good luck!
Logged
Cool RPGM Project!
Sprite till you die
Oh my god, this was ...10 years ago...
SqareMan
Initiate
Posts: 40
Re: Jail (Rm2k3)
«
Reply #2 on:
April 25, 2010, 09:06:39 PM »
Thank you!
Logged
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
Jail (Rm2k3)