Maliki79

Mal_lastitemRegister

Aug 2nd, 2020
2,148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // Maliki's Last Item Register
  3. // Mal_lastitemRegister.js
  4. // version 1.0
  5. //=============================================================================
  6. /*:  
  7.  * @plugindesc This plugin snippet gives users the ability to record the last item recieved
  8.  * into a variable.  From there, the data can be more freely used.
  9.  * @author Maliki79
  10.  *
  11.  * @help Version 1.0
  12.  * First, choose a variable to store the item data.
  13.  * After a game is started, once an item is obtained, it will have all data copied into the variable.
  14.  * You will then need to manipulate the data for your needs.
  15.  * For example, if you wanted to put the ID in Variable 100, you would make the script call:
  16.  * $GameVariables.setValue(100, $gameVariables.value(x).id)
  17.  * Where x is the variable number you chose.
  18.  *
  19.  * @param chosenVariable
  20.  * @type number
  21.  * @min 1
  22.  * @desc Chosen Variable to store item values.
  23.  * @default 1
  24. */
  25. var newestItemV = (PluginManager.parameters('Mal_lastitemRegister').chosenVariable) || 1;
  26. console.log(newestItemV);
  27. var MalRegisterNewItem = Game_Party.prototype.registerNewItem;
  28. Game_Party.prototype.registerNewItem = function(baseItem, newItem) {
  29.     MalRegisterNewItem.call(this, baseItem, newItem);
  30.     $gameVariables.setValue(newestItemV, newItem);
  31.     console.log($gameVariables.value(newestItemV);
  32. };
Advertisement
Add Comment
Please, Sign In to add comment