- 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?
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?
