08-14-2005, 01:00 PM
Item (Dictionairy) Encyclopedy Script v1.4
by: GoldenShadow
Requested by: Anaxim
Thanks to: Makeamidget and Dark Akiko
Aug 14 2005
[Warning=GoldenShadow]There's a demo for this. Scroll to the end of this post.[/Warning]
You probably have seen another script like this, but here's my version.
It's not only for items, but weapons and armors/shields/etc too.
Just switch windows.
If you don't want that, remove lines for the Y button.
I won't explain anything here. View the demo for full information.
It's not encrypted so, as you would expect from a demo, you can view the stuff..
Have fun.
Here's the script for the people who rather not download the demo.
Chances are, there are bugs. Contact me if there are any.
Note: Press S to switch between item lists: Item, Armors, Etc.
Note: Press A to see % info
by: GoldenShadow
Requested by: Anaxim
Thanks to: Makeamidget and Dark Akiko
Aug 14 2005
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
[Warning=GoldenShadow]There's a demo for this. Scroll to the end of this post.[/Warning]
You probably have seen another script like this, but here's my version.
It's not only for items, but weapons and armors/shields/etc too.
Just switch windows.
If you don't want that, remove lines for the Y button.
I won't explain anything here. View the demo for full information.
It's not encrypted so, as you would expect from a demo, you can view the stuff..
Have fun.
Here's the script for the people who rather not download the demo.
Chances are, there are bugs. Contact me if there are any.
Note: Press S to switch between item lists: Item, Armors, Etc.
Note: Press A to see % info
Object Encyclopedy Script v1.4
Code:
#=============================================================
# <> Item Encyclopedy v1.4 - At request from Anaxim
# ==> You can delete all the comments except the copyright and creator info. Thanks.
# ==> Do not rip, repost or any other way of reproducing without proper credit. Thanks.
# ShadowClan Technologies © 2003-2005 - All rights reserved. Asylum rules :)
#-----------------------------------------------------------------------------------------------------------------------
# * Preperations! READ CAREFULLY!!
# Look up in the script editor list: Interpreter 4.
# And then go to this definition: def command_126
# After finding it, add this line JUST ABOVE 'return true'
# $item_dict.add_item(@parameters[0], 0)
# Then go to def command_127 and add this:
# $item_dict.add_item(@parameters[0], 1)
# And finally, at command_128, this:
# $item_dict.add_item(@parameters[0], 2)
# I'll make a demo for this, so you can see how it is supposed to be.
#
# * How to use
# Set up in title screen or somewhere near intro of game:
# $item_dict = Item_Dict.new
# Then just call up to see dictionairy:
# $scene = Scene_ItemDict.new
# That would be it.
# Adding items is just adding items as you normally would in events.
#
# Thats all.
#
# If you come across any bugs, feel free to PM or post it.
#-----------------------------------------------------------------------------------------------------------------------
# * Suggestions? ==> PM or post in the section where this is posted.
# * Created by: GoldenShadow (invincible_p0wer_@hotmail.com)
# * Credits: Makeamidget, Anaxim and Dark Akiko
#=============================================================
class Item_Dict
attr_accessor :dict_items
attr_accessor :dict_wpns
attr_accessor :dict_armr
attr_accessor :show_type
def initialize
@dict_items = []
@dict_wpns = []
@dict_armr = []
@show_type = 0
end
def add_item(item_id, type)
if type == 0
if @dict_items.include?(item_id)
return
elsif !item_id.is_a?(Numeric)
return
elsif item_id == 0
return
else
@dict_items[item_id] = true
end
elsif type == 1
if @dict_wpns.include?(item_id)
return
elsif !item_id.is_a?(Numeric)
return
elsif item_id == 0
return
else
@dict_wpns[item_id] = true
end
elsif type == 2
if @dict_armr.include?(item_id)
return
elsif !item_id.is_a?(Numeric)
return
elsif item_id == 0
return
else
@dict_armr[item_id] = true
end
end
end
end
class Window_ItemStat < Window_Base
def initialize(item)
super(320, 64, 320, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
@item = item
refresh
end
def refresh
self.contents.clear
if @item == nil or @item.id == 0 or @item.name == "???"
self.contents.font.size += 2
self.contents.draw_text(0, 0, self.width - 40, 32, "Unknown Object", 1)
self.contents.font.size -= 2
else
if @item.is_a?(RPG::Item)
self.contents.font.size += 2
self.contents.draw_text(0, 0, self.width - 40, 32, "#{@item.name} Information", 1)
self.contents.font.size -= 2
self.contents.draw_text(4, 96, self.width - 40, 32, "HP Restore: #{@item.recover_hp}")
self.contents.draw_text(4, 128, self.width - 40, 32, "SP Restore: #{@item.recover_sp}")
self.contents.draw_text(4, 160, self.width - 40, 32, "HP Restore %: #{@item.recover_hp_rate}")
self.contents.draw_text(4, 192, self.width - 40, 32, "SP Restore %: #{@item.recover_sp_rate}")
self.contents.draw_text(4, 224, self.width - 40, 32, "Accuracy: #{@item.hit}")
self.contents.draw_text(4, 256, self.width - 40, 32, "Price: #{@item.price}")
elsif @item.is_a?(RPG::Weapon)
self.contents.font.size += 2
self.contents.draw_text(0, 0, self.width - 40, 32, "#{@item.name} Information", 1)
self.contents.font.size -= 2
self.contents.draw_text(4, 96, self.width - 40, 32, "Attack: #{@item.atk}")
self.contents.draw_text(4, 128, self.width - 40, 32, "Strength: #{@item.str_plus}")
self.contents.draw_text(4, 160, self.width - 40, 32, "Phys. Defense: #{@item.pdef}")
self.contents.draw_text(4, 192, self.width - 40, 32, "Mag. Defense: #{@item.mdef}")
self.contents.draw_text(4, 224, self.width - 40, 32, "Agility: #{@item.agi_plus}")
self.contents.draw_text(4, 256, self.width - 40, 32, "Intelligence: #{@item.int_plus}")
self.contents.draw_text(4, 288, self.width - 40, 32, "Dexterity: #{@item.dex_plus}")
self.contents.draw_text(4, 320, self.width - 40, 32, "Price: #{@item.price}")
elsif @item.is_a?(RPG::Armor)
if @item.kind < 3
self.contents.font.size += 2
self.contents.draw_text(0, 0, self.width - 40, 32, "#{@item.name} Information (Armor)", 1)
self.contents.font.size -= 2
self.contents.draw_text(4, 96, self.width - 40, 32, "Evade: #{@item.eva}")
self.contents.draw_text(4, 128, self.width - 40, 32, "Strength Add: #{@item.str_plus}")
self.contents.draw_text(4, 160, self.width - 40, 32, "Phys. Defense Add: #{@item.pdef}")
self.contents.draw_text(4, 192, self.width - 40, 32, "Mag. Defense Add: #{@item.mdef}")
self.contents.draw_text(4, 224, self.width - 40, 32, "Agility Add: #{@item.agi_plus}")
self.contents.draw_text(4, 256, self.width - 40, 32, "Intelligence Add: #{@item.int_plus}")
self.contents.draw_text(4, 288, self.width - 40, 32, "Price: #{@item.price}")
else
self.contents.font.size += 2
self.contents.draw_text(0, 0, self.width - 40, 32, "#{@item.name} Information (Accessory)", 1)
self.contents.font.size -= 2
self.contents.draw_text(4, 96, self.width - 40, 32, "Evade: #{@item.eva}")
self.contents.draw_text(4, 128, self.width - 40, 32, "Strength Add: #{@item.str_plus}")
self.contents.draw_text(4, 160, self.width - 40, 32, "Phys. Defense Add: #{@item.pdef}")
self.contents.draw_text(4, 192, self.width - 40, 32, "Mag. Defense Add: #{@item.mdef}")
self.contents.draw_text(4, 224, self.width - 40, 32, "Agility Add: #{@item.agi_plus}")
self.contents.draw_text(4, 256, self.width - 40, 32, "Intelligence Add: #{@item.int_plus}")
self.contents.draw_text(4, 288, self.width - 40, 32, "Price: #{@item.price}")
end
end
end
end
end
class Window_ItemAchieve < Window_Base
def initialize
super(0, 0, 320, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
def refresh
self.contents.clear
@total = $data_items.size
@now = 0
case $item_dict.show_type
when 0
for i in 0...$item_dict.dict_items.size
if $item_dict.dict_items[i] == true
@now += 1
end
end
when 1
for i in 0...$item_dict.dict_weapons.size
if $item_dict.dict_weapons[i] == true
@now += 1
end
end
when 2
for i in 0...$item_dict.dict_armors.size
if $item_dict.dict_armors[i] == true
@now += 1
end
end
end
@amount = (@total / 100) * @now
self.contents.draw_text(4, 0, self.width - 40, 32, "Objects achieved: #{@amount}% (#{@now}/#{@total})")
end
end
class Window_ItemList < Window_Selectable
def initialize
super(0, 64, 320, 416)
@column_max = 1
@data = []
refresh
self.index = 0
end
def item
return @data[self.index]
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
case $item_dict.show_type
when 0
@data = []
for i in 1...$data_items.size
if $item_dict.dict_items[i] == true
@data.push($data_items[i])
else
@data.push("???")
end
end
when 1
@data = []
for i in 1...$data_weapons.size
if $item_dict.dict_wpns[i] == true
@data.push($data_weapons[i])
else
@data.push("???")
end
end
when 2
@data = []
for i in 1...$data_armors.size
if $item_dict.dict_armr[i] == true
@data.push($data_armors[i])
else
@data.push("???")
end
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
self.contents.font.color = normal_color
x = 4
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if item != "???"
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
else
self.contents.draw_text(x + 28, y, 212, 32, "???", 0)
end
end
def update_help
if self.item == "???"
@help_window.set_text("Item not yet acquired or found.")
else
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
end
class Scene_ItemDict
def main
@help_window = Window_Help.new
@item_window = Window_ItemList.new
@item_window.active = true
@status_window = Window_ItemStat.new($data_items[@item_window.item.id])
@item_window.help_window = @help_window
@achieve_window = Window_ItemAchieve.new
@achieve_window.active = false
@achieve_window.visible = false
@achieve_window.x = 320 - @achieve_window.width / 2
@achieve_window.y = 240 - @achieve_window.width / 2
@achieve_window.z = 9999
Graphics.transition # transing it, so it updates
loop do
Graphics.update
Input.update
update # updating the stuff, see def update
if $scene != self
break
end
end
Graphics.freeze # when closing, freeze it all first
@help_window.dispose
@status_window.dispose
@item_window.dispose
@achieve_window.dispose
end
def update
@help_window.update
@status_window.update
@item_window.update
@achieve_window.update
case $item_dict.show_type
when 0
@type = $data_items[@item_window.item.id]
when 1
@type = $data_weapons[@item_window.item.id]
when 2
@type = $data_armors[@item_window.item.id]
end
if @active_id != @item_window.item.id
@status_window.dispose
@status_window = Window_ItemStat.new(@type)
@status_window.refresh
@active_id = @item_window.item.id
end
if @achieve_window.active
update_achieve
return
end
if @item_window.active
update_command
return
end
end
def update_command
if Input.trigger?(Input::B)
$scene = Scene_Map.new # previous scene, change to whatever you want
elsif Input.trigger?(Input::Y)
if $item_dict.show_type == 2
$item_dict.show_type = 0
else
$item_dict.show_type += 1
end
@item_window.dispose
@item_window = Window_ItemList.new
@item_window.help_window = @help_window
@active_id = 0
elsif Input.trigger?(Input::X)
@item_window.active = false
@achieve_window.active = true
@achieve_window.visible = true
end
end
def update_achieve
if Input.trigger?(Input::B)
@achieve_window.visible =false
@achieve_window.active = false
@item_window.active = true
end
end
end
# thanks to makeamidget for this little thingy here
class Interpreter
alias dict_command_126 command_126
alias dict_command_127 command_127
alias dict_command_128 command_128
def command_126
dict_command_126
$item_dict.add_item(@parameters[0], 0)
end
def command_127
dict_command_127
$item_dict.add_item(@parameters[0], 1)
end
def command_128
dict_command_128
$item_dict.add_item(@parameters[0], 2)
end
end
# FINAL UPDATE: 16th August @ 1:06 CET