firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
419
Reaction score
60
First Language
English
Primarily Uses
RMMV
I've looked through the forum a bit and searched for a possible answer, but nothing really helped me. I have both AttachAugments and ItemPicture from Yanfly... You can use them together to change the picture that an item uses after you attach an augment. It's a pretty cool feature and had a lot of uses.

But it also has its drawbacks. If I want to use the augment on another type of item, say instead of a sword I use it on a staff. but the image will always be of the sword regardless of what you attach it to. I could make multiple augments and just make them exclusive to the weapon/item type, but that's tedious and time consuming.

I tried using the lunatic function on it and got something like this:

<Augment Attach Eval: Armament>
if (actor.isWtypeEquipped(1)) {
item.applyAugmentSetPictureImg(item, "Force3", 0, true);
}
if (actor.isWtypeEquipped(2)) {
item.applyAugmentSetPictureImg(item, "Power1_", 0, true);
}
</Augment Attach Eval: Armament>

The problem is... this doesn't work and I can't figure out how to make it work. Thus, come to the forums and hope the gurus that are here can help me out.

Thank you
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,936
Reaction score
3,138
First Language
English
Primarily Uses
RMMV
The problem is... this doesn't work and I can't figure out how to make it work.
In your notetags, what is actor? I don't see anything in the Attachable Augment documentation that says there's any actor variable inside those notetags, so the engine has no idea what that word means.

Why don't you just check the weapon type of the item? Try something like:
Code:
if (item.isWeapon() && $dataWeapons[item.itemId()].wtypeId==1)
 

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
419
Reaction score
60
First Language
English
Primarily Uses
RMMV
In your notetags, what is actor? I don't see anything in the Attachable Augment documentation that says there's any actor variable inside those notetags, so the engine has no idea what that word means.

Why don't you just check the weapon type of the item? Try something like:
Code:
if (item.isWeapon() && $dataWeapons[item.itemId()].wtypeId==1)
Well, I have no doubt that the code you gave me will work for the weapon type check, but I think the rest of the code is wrong or something since it still doesn't work...
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,936
Reaction score
3,138
First Language
English
Primarily Uses
RMMV
Well, I have no doubt that the code you gave me will work for the weapon type check, but I think the rest of the code is wrong or something since it still doesn't work...
I did not look up the other functions you called, I presumed you had reason to believe those were correct and had used them other places.

Why don't you do something more basic to make sure the code is actually being run?

Code:
if (item.isWeapon() && $dataWeapons[item.itemId()].wtypeId==1)
    $gameVariables.setValue(10, 1000);

Then slap an NPC event on the map that does a Show Text and says what the value of variable 10 is.
 

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
419
Reaction score
60
First Language
English
Primarily Uses
RMMV
I did not look up the other functions you called, I presumed you had reason to believe those were correct and had used them other places.

Why don't you do something more basic to make sure the code is actually being run?

Code:
if (item.isWeapon() && $dataWeapons[item.itemId()].wtypeId==1)
    $gameVariables.setValue(10, 1000);

Then slap an NPC event on the map that does a Show Text and says what the value of variable 10 is.
Ok, so I tested this just like you suggested and found that it doesn't work... But I went further and tested this code:
Code:
if ($gameVariables.value(1) === 0)
    $gameVariables.setValue(1, 250)

To see if the Eval could handle an if/else conditional branch in the first place... I found out that it does handle them since this simple code worked. So, I tried this simple code with my other factors:
Code:
item.applyAugmentSetPictureImg(mainItem, text, slot, true)
I found out that this is flawed. I also found out that the Eval function will only work until it doesn't... this means that if the Eval Line works it will run the line, but as soon as it hits a bad line it can't run the entire Eval stops and doesn't continue.

So i'm thinking of doing something a little simpler for this Eval -
Code:
if ($gameVariables.value(1) === 1)
     item.applyAugmentSetPictureImg(mainItem, text, slot, true)
I'll change the variable to match the item as needed, but the problem now is the second part... This:
Code:
item.applyAugmentSetPictureImg(mainItem, text, slot, true)
Since this doesn't work at all, I don't know how to make it work since I have very limited JS experience.

Any Suggestions?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,936
Reaction score
3,138
First Language
English
Primarily Uses
RMMV
It's wrong because of item

The applyAugmentSetPictureImg() isn't a method of items, it's a method of the ItemManager.

Change it to this.applyAugmentSetPictureImg
 

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
419
Reaction score
60
First Language
English
Primarily Uses
RMMV
It's wrong because of item

The applyAugmentSetPictureImg() isn't a method of items, it's a method of the ItemManager.

Change it to this.applyAugmentSetPictureImg
Ok... I think I'm getting the arguments wrong since it's still not doing what I want it to do... I put this in the Eval:
Code:
this.applyAugmentSetPictureImg(mainItem, 'Force3', slot, true)
Force3 is the name of the picture file I'm trying to change it to.

Just for reference, this is a snippet from the Augment Plugin that deals with the Change Picture, it's where I got the above code from.
Code:
if (Imported.YEP_X_ItemPictureImg) {
    // CHANGE PICTURE IMAGE: x
    if (line.match(/CHANGE PICTURE IMAGE:[ ](.*)/i)) {
      var text = String(RegExp.$1).trim();
      return this.applyAugmentSetPictureImg(mainItem, text, slot, true);
    } else if (line.match(/CANCEL PICTURE IMAGE:[ ](.*)/i)) {
      var text = String(RegExp.$1).trim();
      return this.applyAugmentSetPictureImg(mainItem, text, slot, false);
    }
I'm either not using it right, or I grabbed the wrong line.

I tried change this: this.applyAugmentSetPictureImg to this: ItemManager.applyAugmentSetPictureImg to see if that would work, but it didn't... Still at a loss.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,936
Reaction score
3,138
First Language
English
Primarily Uses
RMMV
Slot is not a word, it's the number of the slot you're augmenting.

If you don't know what that is, it looks like you should be able to use the variable slotId
 

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
419
Reaction score
60
First Language
English
Primarily Uses
RMMV
Slot is not a word, it's the number of the slot you're augmenting.

If you don't know what that is, it looks like you should be able to use the variable slotId
That worked... Thank you so much for helping me!
 

Latest Threads

Latest Posts

Latest Profile Posts

Hello! Can anyone help me? I followed making cooking tutorial for RPG Maker MV. But for some reason buff state that food gives doesn't work in overworld. It disappears. What am I supposed to do?
A shotgun is not a rifle. Huh.
SIGH its so hard to convince my friend that making a game for fun and making one to sell takes different planning. I don't care about weird bothersome ways of doing things in a game made for fun, but when you are planning to market it, there is some stuff that you just have to streamline or cut out.
It might be a little bit boring and tedious, but building that database of armor, items, weapons and skills are super important.

Forum statistics

Threads
124,391
Messages
1,163,298
Members
163,192
Latest member
Princess_Shinra
Top