Main Menu

Cursed Weapons (Unequippable) and Equip / Unequip with a Script?

Started by Heretic86, September 26, 2011, 09:27:02 AM

0 Members and 1 Guest are viewing this topic.

Heretic86

Two questions, anyone know of a Cursed Weapons script that makes a cursed weapon Unequippable, and Question 2, how do you Equip / Unequip Weapons with a Script?  Like character.weapon.equip = true or something?
Heretic's Vehicles XP (Boat and Magic Carpet)

Heretic's Collection XP Ver 2.3 - Updated to include Dynamic Lighting, Moving Platforms, Vehicles, and much much more!

modern algebra

Firstly, I'll mention that you can equip/unequip weapons through an event command, in case you had accidentally missed it and all you had wanted to do was unequip through an event and thought you needed a script.

The code for unequipping through a script call, however, is:


actor.change_equip (equip_type, nil, false)


where actor is a Game_Actor object (like $game_actors[y] or $game_party.members[0], etc.). equip_type is 0-4 depending on what type you are unequipping. Weapons are 0, Shields are 1, Helmets are 2, Body Armor is 3, Accessories are 4. nil and false are just values and you leave them. You can exclude false generally unless you have a custom script which, for some reason, reverses the presumption.

So to unequip a weapon off of the lead actor in the party, it would be:


$game_party.members[0].change_equip (0, nil)


If using two weapons style, then you could remove that weapon with:


$game_party.members[0].change_equip (1, nil)


You can use the same method to also equip new weapons and replace nil with an RPG::Weapon/Armor object ($data_weapons[1-999] or $data_armors[1-999]). However, it will probably be easier to use the following method unless you are already using the RPG::Weapon/Armor object.


$game_party.members[0].change_equip_by_id (equip_type, 1-999)


where 1-999 is any id within that range and it will return the weapon/armor with that ID. equip_type is the same as in the previous method.


As for cursed weapons, look in the RMVX Script Index. I know there is something there.

Heretic86

Wow!  Thanks a ton for the detailed response!  I forgot to mention I was using XP, cuz I know the script structure for VX is different.

I'll take a look at that link...
Heretic's Vehicles XP (Boat and Magic Carpet)

Heretic's Collection XP Ver 2.3 - Updated to include Dynamic Lighting, Moving Platforms, Vehicles, and much much more!

pacdiggity

[spoiler=Oh.]PAC's ISaE Addons (Item, Skill and Equip Addons) has a 'sticky equipment' feature, which is basically cursed equipment with a funky name. So you don't have to download the demo, here it is.
Oh, it exceeds the character limit. Fetch it from PasteBin.
\sticky
Place this in a weapon or armor's notebox to make it a sticky piece, meaning that it cannot be unequipped from the equip menu. It can still be unequipped
via event commands.
\unsticky
Place this in an item or skill's notebox to make it able to remove sticky equipment. If you want to remove all sticky pieces equipped to an actor, use:
$game_actors[ACTOR_ID].unequip_sticky_equips
[/spoiler]

Okay, you using XP changes everything. I can't help you there.
it's like a metaphor or something i don't know

Infinate X

Did you run a google search? 90% of the times when I've used it for RPG Maker purposes I've discovered a new forum I've never heard of :D

Heretic86

Quote from: Infinate X on September 26, 2011, 09:22:11 PM
Did you run a google search? 90% of the times when I've used it for RPG Maker purposes I've discovered a new forum I've never heard of :D

Ok, I tried Player[0].Google.Search, but I get a script error!  :P
Heretic's Vehicles XP (Boat and Magic Carpet)

Heretic's Collection XP Ver 2.3 - Updated to include Dynamic Lighting, Moving Platforms, Vehicles, and much much more!

pacdiggity

No, that's not how you do a Google search. It's:
Google.search(Player[0])
Jeez, everyone should know this stuff.
it's like a metaphor or something i don't know

Heretic86

Well, now that I have a little more time to go back to working on this, I looked around, several other msg boards, and did find a couple of Cursed Items scripts, but every single one was for VX!  Does anyone know of any Cursed Items / Weapons scripts for XP?
Heretic's Vehicles XP (Boat and Magic Carpet)

Heretic's Collection XP Ver 2.3 - Updated to include Dynamic Lighting, Moving Platforms, Vehicles, and much much more!