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 Posts

Latest Profile Posts

Another week has gone by. Maybe you made changes to your project/s. Maybe you didn't. Nonetheless, THAT IS NO EXCUSE TO NOT BACK THEM UP O_O!
Told my five year old she couldn't have any more candy as it was nearly bed time. She looked at me and said "Don't you know people die with no food?"
Need Antidote for a cold. x,x
Just bought another dlc off of steam. I'm loving these "POP!" packs :)
Every once in awhile, somebody reminds me events don't normally pass through each other. What's next? Maps with borders? Weirdos. :LZSwink:

Forum statistics

Threads
93,438
Messages
912,385
Members
122,957
Latest member
ShellShaded
Top