Checking or force-removing Attached Augment (Yanfly)

hadecynn

Abyss of Oblivion
Veteran
Joined
Dec 4, 2015
Messages
316
Reaction score
994
First Language
English
Primarily Uses
RMMV
This is about @Yanfly Attached Augment plugin.


I have a system where players can trade-in certain pieces of equipment for other pieces, but if the piece traded in has augments attached, those augments are also gone forever. Ideally I would want the game to automatically detach all the Augments and place them back into the inventory, but if that doesn't work, to at least setup a conditional check where the game will tell the player to remove all augments on the piece they want to trade in if the game detects any augment attached to the piece in question.


So I'm wondering how to go about either of these two methods with scripts.
 


1. To check if a certain Augment is being equipped and return a value that I can use for conditional processing.


2. To force detach all the Augments that the player has put onto their equipment. 


Thanks for the help!
 

TakaDynasty

Apologetic Lurker
Veteran
Joined
Dec 21, 2016
Messages
41
Reaction score
8
First Language
English
Primarily Uses
I dug through the augments code and found this:


ItemManager.removeAllAugments = function(item) {
var augments = [];
this.checkAugmentSlots(item);
var length = item.augmentSlotItems.length;
for (var i = 0; i < length; ++i) {
var augment = this.removeAugmentFromSlot(item, i);
augments.push(augment);
}
return augments;
};




This is the key, I wager, I just don't quite know how with my expertise. Ostensibly, you'd script your shop events to call this function when an item is sold, but unfortunately you'd have to ask someone else how to do that. I'm such a JavaScript newbie. :|

(If you already knew this then I'm afraid I have no answers at all, haha. I wish I knew how to alter shop event script, but alas...)

Edit: Whoops, I misread a bit. If it's not a matter of SELLING the item, it might be a bit more doable. Perhaps working the above function into the trade-in code somewhere might work. But even that's a long shot, as I'm rather JavaScript illiterate.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Julian Brooks wrote on Hudell's profile.
Hi, I'm trying to use the Orange Mapshot plugin on Mac, but it isn't working. Could you assist? I'm attempting to do Parallax Mapping. Thanks.
I can't believe my dlc flopped that hard. It's depressing. I'm a fricking failure at being a musician.
Person: "Taxes are bs and money is, too! Anarchy!!" *Literally anything goes wrong* Same Person: "Why hasn't the government fixed this???"
Stream will be live shortly with a session of Haunting Ground! Feel free to drop by!

Forum statistics

Threads
94,354
Messages
920,173
Members
124,111
Latest member
Azarae
Top