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

Updated my state Stacker Script on itch.io, github is down for some reason (probs just me).
Wife watching Locke and Key. This show is so bad!! You can't just acclimate to discovering magic or magical worlds in less than 60 seconds.
I think I still prefer RPG Maker over Dreams. Been playing around with it, and the controls are really the biggest flaw for me.
Watching Dragon Quest: Your Story on Netflix and already like 5 mins in we've passed over like 3 hours of gameplay.

Forum statistics

Threads
94,330
Messages
919,962
Members
124,080
Latest member
FoxAldrinXii
Top