Jump to content
Sign in to follow this  
Kirin

Rokan's Highlight New Items 1.00

Recommended Posts

This script was not written by me! I simply translated it from Japanese and posted it here to share! Do NOT ask me for support, I'm not a scripter (I'll try, but most likely fail)!

 

Okay, next bit. This script is:

 

Highlight New Items

Version 1.00

by Rokan of

att4iv.jpg

 

回想領域 - Kaisou-Ryouiki

Reflection Domain

 

Updated: 2011/12/18

 

Terms and Conditions found on his site (Translated by me)

 

 

  • RGSS2: You must be a registered user of RPG Maker VX.
  • RGSS3: You must be a registered user of RPG Maker VX Ace.
  • Photos: Feel free to use as you please.
  • Modifications are allowed freely.
  • Redistribution of original materials is forbidden; allowed after modification.
  • I am not responsible for any damage or ill events that arise from using my materials.
  • Please backup your work before use.
  • Please read through all the instructions.
  • Free for commercial use.
  • Credits and reporting usages are not necessary.
  • No requests accepted.
  • All support and/or bug reports are to be done in public on my site.
  • Please use common sense.

 

 

I have not officially asked permission from him, but I assume that translating it counts as a modification and I am thus allowed. If this bothers anyone, I have no problem with asking him formally.

 

Now, script time. Some of you might remember a time in games when new items were highlighted in the inventory, alerting you to the fact that hey, you've got new loot. This script emulates that by changing the color of the text, drawing attention to it in a visible manner. Here's a screenie:

 

22jk76.jpg

 

Features

 

  • Allows you to highlight newly acquired items.
  • Allows you to 'wipe' the history of new items, un-highlighting all highlighted items.
  • Lets you determine a maximum number of highlight items (Number of items registered in the history).
  • Allows you to change the color of the text, which is drawn from the windowskin.
  • Has a switch you can turn on to disable registering of new items.

 

Nostalgic, isn't it? In fact, even some modern games have a feature like this, so you know at a glance what you just looted from a window of about thirty items. Right then, here's the actual translated script (Note, I only translated the important bits; everything after the configuration area is still Japanese, but it's nothing important for the non-coder). All the instructions are in the header of the script, so please read carefully.

 

 

=begin
     RGSS3

     * Highlight New Items in Inventory *

     Highlights the names of new items in the inventory in a different
  color to improve player usability. 

     â— Important â—=======================================================
     After a certain number of items has been registered as 'new', older 
  items will be un-emphasized and newer items will be emphasized. 
     --------------------------------------------------------------------
     'Oldest' in this case refers to the last item that is new, not the
  first item that was registered. 
     --------------------------------------------------------------------
     For example: 

     A => B => C => A => D => E => F

     In the above example, the first item obtained is A, but another A is
  obtained after C. Since A is now 'newer', B is now the oldest 
  item in the history, and will be the next to be de-emphasized. 
     ====================================================================

     â— Event Command â—===================================================
  Place the following in a script call to clear the 'history' of new
  items: 

  clear_new_item
     --------------------------------------------------------------------
     New Games in particular highlight every item you get initially as 
  new, so this script needs to be called. 
     ====================================================================

     â— Notice â—==========================================================
     Please start a new game to avoid errors. 
     ====================================================================

     ver1.00

     Last Update : 2011/12/18
     12/18 : Created script. 

     Written by Rokan   http://kaisou-ryouiki.sakura.ne.jp/
     Translated by kirinelf
=end

#===================================
#  â— Configuration Block
#===================================
module Rokan
module Put_New_Item
 # Number of items to register as new. 
 # (This setting determines the highest number of highlighted items)
 MNIS = 5
 # Font color of highlighted items. 
 # (Determined from the WindowSkin)
 PIFC = 3
 # ID of the switch to disable memory.
 # (If this switch is on, new items will not be registered and highlighted)
 DEIS = 5
end
end
#============================================================================
#  Do not edit anything past this point unless you know what you're doing!
#============================================================================

$rsi ||= {}
$rsi["æ–°è¦å…¥æ‰‹ã‚¢ã‚¤ãƒ†ãƒ å¼·èª¿è¡¨ç¾"] = true

class Game_Party < Game_Unit
 #--------------------------------------------------------------------------
 # ◠インクルード Rokan::Put_New_Item
 #--------------------------------------------------------------------------
 include Rokan::Put_New_Item
 #--------------------------------------------------------------------------
 # â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 alias _new_item_initialize initialize
 def initialize
   _new_item_initialize
   clear_new_item
 end
 #--------------------------------------------------------------------------
 # â— æ–°è¦å…¥æ‰‹ã‚¢ã‚¤ãƒ†ãƒ ã®åˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def clear_new_item
   @get_newer_items = []
 end
 #--------------------------------------------------------------------------
 # â— æ–°è¦å…¥æ‰‹ã‚¢ã‚¤ãƒ†ãƒ ã§ã‚ã‚‹ã‹
 #--------------------------------------------------------------------------
 def new_item?(item)
   @get_newer_items.include?(new_item_obj(item))
 end
 #--------------------------------------------------------------------------
 # â— æ–°è¦å…¥æ‰‹ã‚¢ã‚¤ãƒ†ãƒ ã‚’登録ã•れる形ã«ã—ã¦è¿”ã™
 #--------------------------------------------------------------------------
 def new_item_obj(item)
   case item
   when RPG::Item
     [0, item.id]
   when RPG::Weapon
     [1, item.id]
   when RPG::Armor
     [2, item.id]
   else
     nil
   end
 end
 #--------------------------------------------------------------------------
 # â— æ–°è¦å…¥æ‰‹é…列を更新ã™ã‚‹ã‹ã©ã†ã‹
 #--------------------------------------------------------------------------
 def update_new_item?
   !$game_switches[DEIS] && !SceneManager.scene_is?(Scene_Equip)
 end
 #--------------------------------------------------------------------------
 # â— æ–°è¦å…¥æ‰‹é…åˆ—ã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_new_item(item, amount)
   if update_new_item?
     if amount > 0
       set_new_item(new_item_obj(item))
     elsif item_number(item).zero?
       remove_new_item(new_item_obj(item))
     end
   end
 end
 #--------------------------------------------------------------------------
 # â— æ–°è¦å…¥æ‰‹ã‚¢ã‚¤ãƒ†ãƒ æƒ…å ±ã®è¿½åŠ 
 #--------------------------------------------------------------------------
 def set_new_item(new_item)
   @get_newer_items.delete(new_item)
   @get_newer_items << new_item
   @get_newer_items.shift if @get_newer_items.size > MNIS
 end
 #--------------------------------------------------------------------------
 # â— æ–°è¦å…¥æ‰‹ã‚¢ã‚¤ãƒ†ãƒ æƒ…å ±ã®å‰Šé™¤
 #--------------------------------------------------------------------------
 def remove_new_item(new_item)
   @get_newer_items.delete(new_item)
 end
 #--------------------------------------------------------------------------
 # ◠アイテムã®å¢—加(減少)
 #--------------------------------------------------------------------------
 alias _put_newitem_gain_item gain_item
 def gain_item(item, amount, include_equip = false)
   _put_newitem_gain_item(item, amount, include_equip)
   update_new_item(item, amount)
 end
end

class Game_Interpreter
 #--------------------------------------------------------------------------
 # â— æ–°è¦å…¥æ‰‹ã‚¢ã‚¤ãƒ†ãƒ æƒ…å ±ã®ã‚¯ãƒªã‚¢
 #--------------------------------------------------------------------------
 def clear_new_item
   $game_party.clear_new_item
 end
end

class Window_Base < Window
 #--------------------------------------------------------------------------
 # ◠インクルード Rokan::Put_New_Item
 #--------------------------------------------------------------------------
 include Rokan::Put_New_Item
 #--------------------------------------------------------------------------
 # â— å„種文字色ã®å–å¾—
 #--------------------------------------------------------------------------
 def putitem_color;      text_color(PIFC);   end;    # アイテム強調色
 #--------------------------------------------------------------------------
 # ◠アイテムæç”»è‰²ã®å–å¾—
 #--------------------------------------------------------------------------
 def item_color(item)
   if item.is_a?(RPG::Skill)
     normal_color
   else
     if SceneManager.scene_is?(Scene_Shop)
       normal_color
     elsif !$game_party.new_item?(item)
       normal_color
     else
       putitem_color
     end
   end
 end
 #--------------------------------------------------------------------------
 # ◠アイテムåã®æç”»ã€€â€»å†å®šç¾©
 #--------------------------------------------------------------------------
 def draw_item_name(item, x, y, enabled = true, width = 172)
   return unless item
   draw_icon(item.icon_index, x, y, enabled)
   change_color(item_color(item), enabled)
   draw_text(x + 24, y, width, line_height, item.name)
 end
end

 

 

Enjoy!

 

I personally don't think you need a demo for this, but hey. Some people. So here you go.

 

Demo - Mediafire

 

FAQ

Q: Where do I put this script?

A: Above Main, under Materials.

 

Q: How do I use this script?

A: It's essentially plug and play, unless you want to play around with the script. What's important is to remember to either reassign the switch that turns off the script or leave switch ID 5 free for it to use.

 

Credit and Thanks

- Rokan, for making this script.

- Kirin (me), for translating this.

- Enterbrain, for once again making an awesome maker.

- Google Translate, for helping me with minor translations.

- The makers of the Rikai-chan addon for Mozilla and the Rikai-kun extension for Chrome, for giving us an awesome Japanese translator.

Edited by kirinelf

Share this post


Link to post
Share on other sites

That's one thing the script doesn't do. xD It stays highlighted until you either clear the history or you get enough new items the old ones are de-emphasized.

Share this post


Link to post
Share on other sites

Oh, okay, thanks.

Still using this, I loved it in Final Fantasy 13,

and now I'm happy it auto-unhighlights stuff.

That always bugged me in FF13 when i had to hover over EVERY piece of equipment or weapon even though I knew what it did.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×