Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

[Scripting] Item Icon ID

Status
Not open for further replies.

LTN Games

Master Mind
Resource Team
Xy$
0.01
How do I get the current item gained, icon id? I have my window now displaying the item + amount you gain, but I'm unsure of how to get the icon associated with that item to display as well.

This is what I have for the gain item method. I use gameSystem variables to set the item and the amount arguments into variables which are then displayed in my window. I can't seem to figure out how to get the icon id associated with the current item gained. I've looked over the core scripts but still cannot find it. Any help or guidance will be appreciated.
Thanks :D

JavaScript:
//--------------------------------------
// Alias Nethod: gainItem
//------------------------------------------------------------------------------
LTN.WindowPop_oldGP_gainItem = Game_Party.prototype.gainItem;
//------------------------------------------------------------------------------
Game_Party.prototype.gainItem = function(item, amount, includeEquip) {
  if(LTN.Param.autoPop == 'On') {
      $gameSystem._currentPop = 'Item';
      $gameSystem._popTimer = 150;
      $gameSystem._autoItem = item.name;
      $gameSystem._autoAmount = amount;
      console.log('Auto Pop Initialized');
  }
  $gameMap.requestRefresh();
  LTN.WindowPop_oldGP_gainItem.call(this, item, amount, includeEquip);
};
[doublepost=1448043358,1448042018][/doublepost]I figured it out lol. It was really simple and I would have never figured it out if I never looked at another plugin that uses this method.
All I had to do was put .iconIndex after item. So
JavaScript:
 $gameSystem._autoIconID = item.iconIndex;
So I will be marking this as answered and locking this thread. If for some reason you want this re-opened please report the post. Thanks.
 
Status
Not open for further replies.
Top