Charas-Project

Game Creation => Requests => Topic started by: daoman89 on January 10, 2013, 01:19:57 AM

Title: Equipment Storage Help!!
Post by: daoman89 on January 10, 2013, 01:19:57 AM
It's me again!  :D  Anyways, I was wondering if anybody knew how to store equipment in variables when they are forced to unequip them so that way they can automatically be put back on.  For RPGmaker2003.  I don't wanna hurt my brain trying to figure out too much on my own when I can easily ask this wonderful community!
Title: Re: Equipment Storage Help!!
Post by: Prpl_Mage on January 10, 2013, 01:43:02 AM
To just answer your question a bit quickly before bed.
Each item have a value (equal to the number in the items tab), don't worry about it though because the maker knows that for you.

For example when using the change class command all items are unequipped.
So store the value of all the hero's equipment in the same ammount of variables.
How?
Variable operations: Var set equal to value of hero: HERO1: weapon number
So the varaible will have the same value as the item have in the list. If club is number 17, the value of the variable will be 17.
Rinse and repeat for all item slots.
What now?
Now you go through whatever it is you want to happen.

Okay, that's done, so how do I get my hero dressed again?
Go to the "Change equipment" command, HERO1, equip ID stored in variable - choose the correct varaible = success!

It's great! The maker can both remember and recreate the information about items equipped!
Title: Re: Equipment Storage Help!!
Post by: daoman89 on January 10, 2013, 02:01:06 AM
Great!! Thanks Purp!  I was staring at my screen trying to figure out what the storage numbers were lol.  I would've figured it out in a few days, but its always easier to ask around ya know?
Title: Re: Equipment Storage Help!!
Post by: daoman89 on January 10, 2013, 02:21:02 AM
I think I did it right.  I stored  all 5 equipments to 5 separate variables.  It says it can't find the script. 
Title: Re: Equipment Storage Help!!
Post by: drenrin2120 on January 10, 2013, 02:27:48 AM
Find the script? You're using rm2k3, right?
Title: Re: Equipment Storage Help!!
Post by: daoman89 on January 10, 2013, 02:30:50 AM
Yeah.  I did what Purp said unless he forgot something.  It says the script can't find the item basically.
Title: Re: Equipment Storage Help!!
Post by: daoman89 on January 10, 2013, 02:34:57 AM
"Event Script referenced an item that does not exist."
Title: Re: Equipment Storage Help!!
Post by: drenrin2120 on January 10, 2013, 02:37:39 AM
Ah, I see. check your variable set commands and make sure everything is correct. You can also try a debug event that sets all the variables you're working with and does nothing else, then press f9 to see if they are set correctly. I believe if any of those variables are set to 0 (and obviously if they're set to a number higher than the max number of items in the database) you get that error message because 0 is nothing, that item index doesn't exist.

Also, it sounds stupid, but check EVERYTHING in your set variable command. Make sure it's "Set" and not like, multiply. It can be easy to forget something as simple as that.
Title: Re: Equipment Storage Help!!
Post by: daoman89 on January 10, 2013, 02:42:21 AM
I moved the equipment variable setting above the class change event.  It seemed to fix the problem.  Now I just need to try it with only 1 thing equipped to see if it goes nuts.
Title: Re: Equipment Storage Help!!
Post by: drenrin2120 on January 10, 2013, 02:47:19 AM
Oh, I think I see what's happening. You may want to place conditional events that check if the variable equals 0. If nothing is equipped, I believe the maker automatically sets the variable to 0.
Title: Re: Equipment Storage Help!!
Post by: daoman89 on January 10, 2013, 02:51:42 AM
Yep, and the error message pops back up.  So how can we make it so it will ignore that if their is zeros...  If statement?
Title: Re: Equipment Storage Help!!
Post by: drenrin2120 on January 10, 2013, 02:59:33 AM
Only reequip if the varible is not equal to zero.
Title: Re: Equipment Storage Help!!
Post by: daoman89 on January 10, 2013, 03:02:20 AM
Yeah i said if variable blah blah is equal to 0, unequip. and the else part is the stored variable of that equipment.
Title: Re: Equipment Storage Help!!
Post by: drenrin2120 on January 10, 2013, 03:13:28 AM
You dont need conditionals for setting the variables, only one conditional for each variable when equipping. If variable does not equal zero, equip index. You dont need an else because nothing will happen if the variable equals 0
Title: Re: Equipment Storage Help!!
Post by: daoman89 on January 10, 2013, 03:45:28 AM
All right, I'll get rid of the unequips
Title: Re: Equipment Storage Help!!
Post by: Prpl_Mage on January 10, 2013, 08:28:23 AM
Seems like you figured it out.

And yes, if no item is equipped things go crappy crap, since the value becomes 0 and there is no item with the index 0. So in the equip part you test if the value is greater than 0, if not you don't equip anything.

Did you store the info of equipment before changing the class the first try? And is everything working now?
Title: Re: Equipment Storage Help!!
Post by: daoman89 on January 10, 2013, 05:49:01 PM
Yeah, everything is functioning properly haha thanks