Yanfly's augment attachments: Make augments change variables

Dirge

Sound Engineer
Veteran
Joined
Apr 5, 2015
Messages
413
Reaction score
284
First Language
English, German
Primarily Uses
N/A
Hi!

I'm trying to have an augment that changes specific variables on attachment, and changes them back on detachment. But it needs to change a different variable based on the actor ID of the actor holding the item the augment is attached to.

With me so far? Cool. Here's my current notetag setup for it:


<Augment Attach Eval: Utility>
if (user.actorId == 1) {
$gameVariables.setValue (302, $gameVariables.value (302)+10)
}else if (user.actorId == 2) {
$gameVariables.setValue (312, $gameVariables.value (312)+10)
}else if (user.actorId == 3) {
$gameVariables.setValue (322, $gameVariables.value (322)+10)
}else{
$gameVariables.setValue (332, $gameVariables.value (332)+10)
}
</Augment Attach Eval: Utility>
<Augment Detach Eval: Utility>
if (user.actorId == 1) {
$gameVariables.setValue (302, $gameVariables.value (302)-10)
}else if (user.actorId == 2) {
$gameVariables.setValue (312, $gameVariables.value (312)-10)
}else if (user.actorId == 3) {
$gameVariables.setValue (322, $gameVariables.value (322)-10)
}else{
$gameVariables.setValue (332, $gameVariables.value (332)-10)
}
</Augment Detach Eval: Utility>

However, when I attach the augment, it gives me an error: "User not defined"

I had an epiphany about this while I was in the shower (actual shower thoughts! lol). I think it's throwing a "user not defined" error because the user.actorId parameter is trying to find an actual user associated with the item, but nobody is actually "using" the item, it's just being attached as an augment.

So rather than checking for the user.actorId, it needs to identify the actor by some other parameter. Unfortunately, we're pretty firmly in the "Dirge no longer has a clue what he's doing" realm of JS...

Which brings me to my question. How can I have it identify which actor is using the item the augment is going to be attached to, and modify a particular variable based on that?
 

Naveed

Veteran
Veteran
Joined
Nov 2, 2013
Messages
314
Reaction score
146
First Language
English
Primarily Uses
RMMV
The issue is, as you said, that the augments attached to an item, not to an actor. Hence there is no code to reference which actor has the attachment, since technically none of the actors have the attachment. You can also think that augments can be attached to items that are not equipped by anybody. What then?

If you could specify exactly what you're trying to achieve by changing the variables, maybe I could recommend an alternative approach.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
After a good night's sleep I am still not able to work out the solution.
It's a problem that was partly solved yesterday. Modification of Yanfly's status menu core so that it would show Element damage amplification instead of resistance rates.
In the end we were able to work out a solution by accessing game variables, but in the solution the weapon augments still don't work...

It would be working easily with the augments inflicting states, but I'm afraid too many states would make the game laggy.
 
Last edited:

Dirge

Sound Engineer
Veteran
Joined
Apr 5, 2015
Messages
413
Reaction score
284
First Language
English, German
Primarily Uses
N/A
@Naveed What Poryg said, basically, yep. The variables in question pertain to a status menu showing element amplification rates.

@Poryg I think the state idea might work - I don't think we'll have TOO many states going at any one time. I'll build that and test it tomorrow, thanks for the idea.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
States would make it easy. Because States allow you to use user.
So if you let these augments apply states, then just replace <Augment attach eval> with <Custom Apply State> and <Augment detach eval> with <Custom Remove Effect>, it should work.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,015
Members
137,563
Latest member
MinyakaAeon
Top