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

My kitty still young (3-4 months), I think I could teach her some funny tricks... like: "Play dead-ly good music for my games"
Here's a quality DPS class idea: The Beekeeper, who uses the "Bees!!" skill to attack and poison enemies.
Please don't create long, boring cutscenes in which characters do nothing but stand around talking.
What if I took a lesson from Half Minute Hero? Let the player get dumb powerful each area, but reset them down to just slightly stronger than before for the next map?
Been averaging 2-3 hours sleep for almost a month now. Starting to space out all the time ^^;

Forum statistics

Threads
94,266
Messages
919,497
Members
123,985
Latest member
Azer
Top