"Equip and Un-Equip" a specific Item?

Status
Not open for further replies.

whotfisjojo

Swallow the Green Goo? >Yyeesss >NO!!!
Member
Joined
Jun 5, 2019
Messages
23
Reaction score
6
First Language
English
Primarily Uses
RMVXA
Is it possible? The character is a vampire so the item I want to give him is an umbrella so he wont burn in the sun. However, since it is a large sprite, I want it to be able to "change actor graphic", so his sprite will change to the umbrella holding spritesheet I created for this specifically. I know you can only equip/un-equip armor, but armor doesn't seem to have an option to change actor graphic. (I really don't like the "Equipment" window's UI anyways...)(With the item I changed the effect to common event, which I have set to change actor's graphic.)

Is there an option to unequip or "put away" item? It's important that it's something that can be used in a conditional branch, because I have it set if he walks with the umbrella in the sun he won't get burned, but otherwise he will.

Thank you! :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,807
Reaction score
12,225
First Language
English
Primarily Uses
RMMV
You can't equip items ... not sure if there's a script out there that might allow it?

One option might be to have two Umbrella items. Call one "Umbrella" and give it to the player when they obtain the item. Call the other "Put away Umbrella". Set them both to be consumable, and attach a (different) common event to each.

On the "Umbrella" common event, change the sprite to the one with the umbrella, turn on a switch to say the umbrella is in use (this is what you can use in your conditional branch), and give the player a "Put away Umbrella" item.

On the "Put away Umbrella" common event, change the sprite to the one without the umbrella, turn the switch off, and give the player an "Umbrella" item.

This means the "Umbrella" item will only be available after it's been initially obtained, and while it isn't being used. The "Put away Umbrella" item will only be available when the umbrella is being used.



The alternative, which would allow you to use the umbrella as equipment, is to add the following tiny script:

Code:
class Scene_Menu < Scene_MenuBase
  def return_scene
    $game_switches[1] = true
    SceneManager.return
  end
end
change the 1 to an available switch, and add a parallel process common event conditioned by that switch. This will turn the switch on when the player returns to the map after being in the menu. So add to the common event any commands you want (if player has umbrella equipped, change sprite to umbrella sprite, else change sprite to no umbrella sprite), and then turn the switch off so it only runs once.
 
Last edited:

whotfisjojo

Swallow the Green Goo? >Yyeesss >NO!!!
Member
Joined
Jun 5, 2019
Messages
23
Reaction score
6
First Language
English
Primarily Uses
RMVXA
Wow, I feel like so stupid for not realizing that first! Crazy easy!

Since it was a consumable, I was confused at first why it still burned when he walked in the sun, but then I realized that all he had in his inventory was "put away umbrella" which meant that I could set the conditional branch for the sunburn to "put away umbrella" instead of "umbrella" to null the sunburn while the umbrella was out!

Amazing! Thank you so much! :) <3 <3

Edit: Solved!
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,807
Reaction score
12,225
First Language
English
Primarily Uses
RMMV
It doesn't have to be consumable. You could set it to not consumable, then in your events when you give the other item, take this item away. I only said to make it consumable to remove the need for that one extra step in each event.

just report your first post to the mods and let them know it's solved, and they'll close the thread for you.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,301
Reaction score
7,876
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

Writing out an idea for the No Travel Game Jam. I have a general plot and challenge written out, it's just a matter of filling the rest in and making it interesting.
A definite difficult time right now. How is everyone doing during this pandemic? I already have seen furloughs and layoffs.
Hollow 1977 wrote on Archeia's profile.
Hope you and your family are doing well during this difficult time. :)
My elderly neighbor whom I've been buying groceries for just got carried out of his home on a stretcher by guys with hazmat suits. Considering I've been his only point of contact for the past month it's probably safe to say my boss was right to tell me to stay home once I developed a mild cough after all.
Damn. All these new features to the forums. Takes some getting used to.

Forum statistics

Threads
95,642
Messages
930,674
Members
125,963
Latest member
highchloride
Top