Jump to content
Sign in to follow this  
roninator2

Remove Equipment

Recommended Posts

Hello everyone. Is there someone with more knowledge on scripts to help with this question?

 

I have an armor that I want removed from the actors equipment. I did not see a way in the default editor settings (Page 1, 2 or 3) to remove equipment, instead it lets you change it. While changing it to nothing may work the problem is that the armor is not one of the 5 categories for equipment.

 

From other sites http://www.rpgmakercentral.com/topic/23954-how-to-add-or-remove-equipment-of-actor-with-a-script-call/ 

I was able to piece together this - $game_actors[1].remove_equip(1, $data_armor[275])

I'm sure it will not work as the slot (1) is not the correct one and the armor to remove is a slotted item. Which can be slotted into any weapon or armor. So specifying a slot will not work.

 

I am using BlackMorning VK Equip script to have 11 equipment categories. And the slotted item is VE Materia. There is no problem with the scripts therefor I should not need to put the links here.

 

How can I remove the specific armor when it can be attached to any slot, but not actually in a slot? - $game_actors[1].remove_equip($data_armor[275]) Would that work by not specifying a slot?

 

Ideas?

 

Thanks

Share this post


Link to post
Share on other sites

Well I setup a scene to try this. (Sad that nobody has suggested anything).

I get an error "undefined method '[]' for nil:NILclass" not suer if it's for the first [1] or the second [275]

Share this post


Link to post
Share on other sites

Soooo.. I am not entirely sure if I understood your request and also not sure if you solved this, but thought I'd try to help.

I am not a scripter myself, but there are ways around without too much scripting.

 

Assuming you are running this via an event, I would go about it this way:

 

1. Run a conditional check to see if the item is in an actors item slot first:

$game_actors[x].equips[y].id == 275

​ - x is actor ID

 - y is the slot ID (weapon = 0, shield = 1, etc)

​ - 275 is the ID of the item you want removed

 

​2. If it is true, have it remove the item.

​$game_actors[x].remove_equip(y, $data_armor[275])

 - x is actor ID

 - y is the slot ID (weapon = 0, shield = 1, etc)

​ - 275 is the ID of the item you want removed

 

This method however is most effective when the equipment is only equip-able by one or a small number of possible actors and you don't have TOO many equipment slots to check.

 

It's not the most efficient I'm sure, but it should work.

Hope this helps!

 

~ Dinhbat3

Share this post


Link to post
Share on other sites

I kind of left this, as it doesn't seem to be possible. While what you suggest may work in certain circumstances, it would not work in my case. The issue is the materia script, it is armor items that you equip on top of other armor that you have equipped, but the materia could also be on a weapon. With myself having 11 equipment slots also presents a challenge. I can only see what you suggested working if I was to use multi layered conditional branches to check all slots and then recording those slots to run the command to remove armor. And I have 18 actors. Plus the item would only get removed under certain conditions in battle. And I don't think I could specify an armor slot on top of another armor slot to remove.

 

All put together, it's not really worth the effort for one thing. So I removed that materia from my game. Not going to try.

 

Thanks though.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted