RMMV HELP!! I need help on script calls for Yanfly Attach Augment plug in.

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
284
Reaction score
50
First Language
English Spanish
Primarily Uses
RMMV
Hi!! Here are the plug ins im using:


Im doing a system where I need to add/remove augments BY CODE.

At a moment, I need to check which augments a weapon has, then unattach them, and then attach them again. I know how to check which augments a weapon has and in which slot etc etc.

But i cant find the way to properly unattach and attach them with javscript. When i run the function ItemManager.removeAugmentFromSlot()

It doesnt unattach the augment, it just takes the buff (+1 att) away directly from the weapon.


Thank you!!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,524
Reaction score
2,884
First Language
English
Primarily Uses
RMMV
Rather than taking the time to dig through the code, why don't you just use Yanfly's Script Call Plugin Commands and have the code do its work for you?
 

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
284
Reaction score
50
First Language
English Spanish
Primarily Uses
RMMV
Hi ATT,

The thing is 1. there are no plug in commands for attaching or detaching specific allocated augments and 2, even if there were, I need to run the process while on the equip/main menu and you cannot run common events while on those scene menus, that's why I need to run the JavaScript code at specific moments.

I think this one is going to be difficult.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,524
Reaction score
2,884
First Language
English
Primarily Uses
RMMV
you cannot run common events while on those scene menus
I'm not sure what that has to do with it - the point of the plugin I recommended is it provides a JavaScript function to call any plugin command...so you would use it wherever you're already typing your code.

However, I understand your point that there isn't a plugin command.

When i run the function ItemManager.removeAugmentFromSlot()
It doesnt unattach the augment, it just takes the buff (+1 att) away directly from the weapon.
Right - if you read through removeAugmentFromSlot() you can see it's pretty short, and it removes the augment effects and returns the augment item to be added to the party inventory, but doesn't do anything to the item's specified slot.

Then, if you search through the plugin for removeAugmentFromSlot and what uses it, you'll see it never gets used directly from the augment menu. That uses applyAugmentEffects().

So you should try using applyAugmentEffects() with a null second argument for effectItem.
 

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
284
Reaction score
50
First Language
English Spanish
Primarily Uses
RMMV
I'm not sure what that has to do with it - the point of the plugin I recommended is it provides a JavaScript function to call any plugin command...so you would use it wherever you're already typing your code.

However, I understand your point that there isn't a plugin command.


Right - if you read through removeAugmentFromSlot() you can see it's pretty short, and it removes the augment effects and returns the augment item to be added to the party inventory, but doesn't do anything to the item's specified slot.

Then, if you search through the plugin for removeAugmentFromSlot and what uses it, you'll see it never gets used directly from the augment menu. That uses applyAugmentEffects().

So you should try using applyAugmentEffects() with a null second argument for effectItem.
Yeah, my second try was at that function the applyAugmentEffect. Maybe im looking at all of this wrong, maybe the augment plug in only handles the effect of the item on the slot and the add and removal of the item is handled in the Itemcore plug in. So maybe what im looking for is on the item core and not in the attachable augment plug in.

I will continue to look at it, I appreciate the guidance =)
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,524
Reaction score
2,884
First Language
English
Primarily Uses
RMMV
Yeah, my second try was at that function the applyAugmentEffect. Maybe im looking at all of this wrong, maybe the augment plug in only handles the effect of the item on the slot and the add and removal of the item is handled in the Itemcore plug in.
No, the Item Core doesn't know anything about augments (I presume by "removal of the item" you're talking about "removal of the augment").

You should be able to see which functions contain the code that should be doing what you want - line 742 is getting the augment that was in that slot, and line 743 is putting it into inventory, which are a part of applyAugmentEffects().

Line 789 is setting the item's slot to empty, which is a part of installAugmentToSlot, which is in turn called by applyAugmentEffects().

Looking down at the handling inside the scenes/windows created by the plugin, I don't see any calls to generic item handling functions that would affect this. So far as I can tell, this should do exactly what you're looking for:
Code:
ItemManager.applyAugmentEffects(yourItem, null, theSlotNumber, 1);

Are you saying you've tried that? What doesn't work correctly for you then?
 

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
284
Reaction score
50
First Language
English Spanish
Primarily Uses
RMMV
Yeah, I tried it and i get the error:
Code:
Uncaught SyntaxError: Unexpected token u

Unless im doing something wrong.

The augment im attaching is item number 103, and since there is only one slot on the weapon im attaching the augment, I did:

Code:
ItemManager.applyAugmentEffects(103, null, 0, 1)

Im I doing it correctly?


EDIT: Im such a dummy, I was passing the item argument as a number, I should have passed it as a variable since the item is not a number, is an object. Yes, it works now perfectly

THAAAANK YOU!!
 
Last edited:

Latest Threads

Latest Profile Posts

Watch Studio Blue play Numina by starlit in our latest RPG Maker Games Critique stream starting NOW!

Wish me luck. One of the leading experts on certain false shuffle is going to check if my skill is good enough to be called "not total trash".
Not an RPG Maker Update but I'm happy to say that I finally passed my drivers written test. Which makes me a happy guy.
FWRu-cYXkAAAUbl
Have you ever been in such a luck streak you felt fear something was wrong?

Forum statistics

Threads
123,126
Messages
1,154,184
Members
161,461
Latest member
TelorDadar69
Top