hikaru909

Villager
Member
Joined
Jan 10, 2016
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
Is it possible to change equipped clothing using the Buff & States Core? My idea is that I am having a character transform and, on top of that, it changes their clothing (and it changes back when it wears off). Is such a thing possible with the B & S Core, or is does it require custom scripting along with the core?
 

rainyday

Veteran
Veteran
Joined
Nov 5, 2019
Messages
77
Reaction score
51
First Language
English
Primarily Uses
RMMV
This should do it, although it assumes you have the armors you want to swap to in your inventory and that the actor in question can equip them.
Code:
<Custom Apply Effect>
//Gets the user's starting body armor
user._startingClothes = user._equips[3]._itemId;
user._startingHelm = user._equips[2]._itemId;
//Changes the user's body and head armor to the new armor, in this case 20 for the body and 34 for the helm
user.changeEquip(3,$dataArmors[20]);
user.changeEquip(2,$dataArmors[34]);
</Custom Apply Effect>
<Custom Victory Effect>
user.changeEquip(3,$dataArmors[user._startingClothes]);
user.changeEquip(2,$dataArmors[user._startingHelm]);
user.removeState(stateId);
</Custom Victory Effect>
<Custom Leave Effect>
user.changeEquip(3,$dataArmors[user._startingClothes]);
user.changeEquip(2,$dataArmors[user._startingHelm]);
</Custom Leave Effect>
<Custom Escape Effect>
user.changeEquip(3,$dataArmors[user._startingClothes]);
user.changeEquip(2,$dataArmors[user._startingHelm]);
</Custom Escape Effect>

If you don't want the user's to be able to equip those armors outside of the state, then use this code instead
Code:
<Custom Apply Effect>
//Gives the party the items to equip
user._bodyArmorToSwapTo = $dataArmors[20];
user._headArmorToSwapTo = $dataArmors[34];
$gameParty.gainItem(user._bodyArmorToSwapTo, 1);
$gameParty.gainItem(user._headArmorToSwapTo, 1);
//Gets the user's starting body armor
user._startingClothes = user._equips[3]._itemId;
user._startingHelm = user._equips[2]._itemId;
//Changes the user's body and head armor to the new armor, in this case 20 for the body and 34 for the helm
user.changeEquip(3,$dataArmors[20]);
user.changeEquip(2,$dataArmors[34]);
</Custom Apply Effect>
<Custom Victory Effect>
user.changeEquip(3,$dataArmors[user._startingClothes]);
user.changeEquip(2,$dataArmors[user._startingHelm]);
$gameParty.loseItem(user._bodyArmorToSwapTo, 1);
$gameParty.loseItem(user._headArmorToSwapTo, 1);
user.removeState(stateId);
</Custom Victory Effect>
<Custom Leave Effect>
user.changeEquip(3,$dataArmors[user._startingClothes]);
user.changeEquip(2,$dataArmors[user._startingHelm]);
$gameParty.loseItem(user._bodyArmorToSwapTo, 1);
$gameParty.loseItem(user._headArmorToSwapTo, 1);
</Custom Leave Effect>
<Custom Escape Effect>
user.changeEquip(3,$dataArmors[user._startingClothes]);
user.changeEquip(2,$dataArmors[user._startingHelm]);
$gameParty.loseItem(user._bodyArmorToSwapTo, 1);
$gameParty.loseItem(user._headArmorToSwapTo, 1);
</Custom Escape Effect>

If you want to have it so that weapons, shields, etc are also changed, then copy the lines that edit the head and body armor and change the names and numbers to whatever equipment type you want
 

hikaru909

Villager
Member
Joined
Jan 10, 2016
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
<Custom Apply Effect> //Gives the party the items to equip user._bodyArmorToSwapTo = $dataArmors[20]; user._headArmorToSwapTo = $dataArmors[34]; $gameParty.gainItem(user._bodyArmorToSwapTo, 1); $gameParty.gainItem(user._headArmorToSwapTo, 1); //Gets the user's starting body armor user._startingClothes = user._equips[3]._itemId; user._startingHelm = user._equips[2]._itemId; //Changes the user's body and head armor to the new armor, in this case 20 for the body and 34 for the helm user.changeEquip(3,$dataArmors[20]); user.changeEquip(2,$dataArmors[34]); </Custom Apply Effect> <Custom Victory Effect> user.changeEquip(3,$dataArmors[user._startingClothes]); user.changeEquip(2,$dataArmors[user._startingHelm]); $gameParty.loseItem(user._bodyArmorToSwapTo, 1); $gameParty.loseItem(user._headArmorToSwapTo, 1); user.removeState(stateId); </Custom Victory Effect> <Custom Leave Effect> user.changeEquip(3,$dataArmors[user._startingClothes]); user.changeEquip(2,$dataArmors[user._startingHelm]); $gameParty.loseItem(user._bodyArmorToSwapTo, 1); $gameParty.loseItem(user._headArmorToSwapTo, 1); </Custom Leave Effect> <Custom Escape Effect> user.changeEquip(3,$dataArmors[user._startingClothes]); user.changeEquip(2,$dataArmors[user._startingHelm]); $gameParty.loseItem(user._bodyArmorToSwapTo, 1); $gameParty.loseItem(user._headArmorToSwapTo, 1); </Custom Escape Effect>
That one worked wonders. Thanks a ton man.
 

Latest Threads

Latest Profile Posts

I'm listening to iiluminaughtii talking about the secrets behind shady businesses and scams. Meanwhile I'm writing a fanfic about Sephiroth from FF7, one specifically for my stepmom. I'll get to give it to her, too, because my boss said I could take the holidays off! Dec. 22-27 I will be in Orlando, and maybe Fort Myers too, visiting my dad and stepmom!
Of course, I bought a handful of games on the Steam Black Friday sale. Will I try them? Will I complete any? Who knows...
I don't really have any neat updates today about how I screwed up programming... But if you want to observe the intensenes of me programming, then you can check out my stream :)
New Weapons.gif
No more spam from me today, I promise! Just wanted to upload this, people have been giving me feedback that my weapon sprites (which were RTP) clashed badly with my battlers for ages, so today I finally took the plunge and updated them! Really happy with how they came out :D :D
So Facebook fraudulently took money from me. They even went through my PayPal accounts to find a card that had the money on it. Thinking about deleting my Facebook account because this doesn't happen on twitter, not even close.

Forum statistics

Threads
117,003
Messages
1,103,724
Members
152,898
Latest member
grimstoneriq
Top