Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

RESOLVED: Wrong number of arguments? What?

I keep getting this script error whenever I finish a battle. It tells me there's a wrong number of arguments (3 of 0) on line 192 of scene_battle 2. That line says this:

@result_window = Window_BattleResult.new(exp, gold, treasures)

It also does it when I try and use the /Name command with Dubealex's AMS, only then it says (4 of 0) instead of (3 of 0).

The scripts I'm using are:

Custom Shop System
Rune's CMS
Dubealex's AMS
DREAM v3
Juan's Custom Gameover Screen
I also had Blizz's easy lvl up notifier, but took it out because i thought that was the problem.

Thanks in advance =P.

Also, is this supposed to be in script support? Sorry if so, wasn't sure because it wasn't a problem I had trying to script, just a script error =P.
 
This is a scripting question, yeah it does belong in script support, although I don't think it makes too much of a difference, except you might not get much support. Report your post and the mods will move it if they think it belongs elsewhere.

ONTOPIC: You'll also need to post the code to these scripts. I've only ever heard of the AMS. I don't claim to know much at all about scripting, though, so I can't really help you. :cheers:
 
nope. plagiarism would be posting them and claiming you created them. All those scripts have been posted for general use, so you can re-post them.

You can also just post links to where you got the scripts.

The best option would be to compress your game (not encrypted), upload it, and post a link to it. That way whoever looks at your problem will be looking at how you've implemented all of the scripts.

Be Well
 
Leon's Custom Shop System:
#===============================================================================
# Leon's Shopping System
#-------------------------------------------------------------------------------
# 3/10/2007
# v. 1.0
#-------------------------------------------------------------------------------
# Instructions:
# Place above main, and below the other default scripts.
# (Yes, that is all of the instructions)
#
# Features:
# Replaces the default shop system.
#
#===============================================================================


#===============================================================================
# Window_Shop_Info
#===============================================================================
class Window_Shop_Info < Window_Base
def initialize
super(160, 0, 480, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end

def refresh(selection = 0)
self.contents.clear
if selection == 0
self.contents.draw_text(0, 0, 448, 32, "Buy, sell, or leave?", 1)
else
self.contents.draw_text(0, 0, 448, 32, "Press 'Z' for character compatabilitiy.", 1)
end
end
end
#===============================================================================
# END Window_Shop_Info
#===============================================================================


#===============================================================================
# Window_Shop_Option
#===============================================================================
class Window_Shop_Option < Window_Selectable
def initialize
super(0, 0, 160, 128)
@option = ["Buy", "Sell", "Leave"]
@item_max = @option.size
self.contents = Bitmap.new(width - 32, height - 32)
self.index = 0
self.active = true
refresh
end

def refresh
self.contents.clear
for i in 0...@option.size
y = i * 32
self.contents.draw_text(0, y, 128, 32, @option, 1)
end
end
end
#===============================================================================
# END Window_Shop_Option
#===============================================================================


#===============================================================================
# Window_Shop_Gold
#===============================================================================
class Window_Shop_Gold < Window_Base
def initialize
super(0, 128, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end

def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 60, 32, $data_system.words.gold + ":")
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 128, 32, $game_party.gold.to_s, 2)
end
end
#===============================================================================
# END Window_Shop_Gold
#===============================================================================


#===============================================================================
# Window_Shop_Own
#===============================================================================
class Window_Shop_Own < Window_Base
def initialize
super(0, 192, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
item = nil
refresh(item)
end

def refresh(item)
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 48, 32, "Own:")
if item == nil
return
end
self.contents.font.color = normal_color
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
self.contents.draw_text(0, 0, 128, 32, number.to_s, 2)
end
end
#===============================================================================
# END Window_Shop_Own
#===============================================================================


#===============================================================================
# Window_Shop_List
#===============================================================================
class Window_Shop_List < Window_Selectable
def initialize(shop_goods)
super(160, 64, 480, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.active = false
self.index = 0
self.visible = false
@shop_goods = shop_goods
@sell = false
end

def item
if @data != nil
return @data[index]
end
end

def refresh
@sell = false
@option_index = nil
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for goods_item in @shop_goods
case goods_item[0]
when 0
item = $data_items[goods_item[1]]
when 1
item = $data_weapons[goods_item[1]]
when 2
item = $data_armors[goods_item[1]]
end
if item != nil
@data.push(item)
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end

def refresh_sell(option_index)
@sell = true
@option_index = option_index
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items)
end
end
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons)
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors)
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end

def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if @option_index == nil
if item.price <= $game_party.gold and number < 99
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
else
self.contents.font.color = normal_color
end
x = 4
y = index * 32
if item.price == 0
self.contents.font.color = disabled_color
else
self.contents.font.color = normal_color
end
if @sell == false
if item.price <= $game_party.gold and number < 99
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
end
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
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)
if @option_index == nil
self.contents.draw_text(x + 350, y, 88, 32, item.price.to_s, 2)
else
item_price = (item.price / 2).round
self.contents.draw_text(x + 350, y, 88, 32, item_price.to_s, 2)
end
end
end
#===============================================================================
# END Window_Shop_List
#===============================================================================


#===============================================================================
# Window_Shop_Description_Item
#===============================================================================
class Window_Shop_Description_Item < Window_Base
def initialize
super(90, 256, 460, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
item = nil
refresh(item)
end

def refresh(item)
self.contents.clear
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(0, 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(28, 0, 120, 32, item.name)
self.contents.draw_text(0, 32, 428, 32, item.description)
self.contents.font.color = system_color
self.contents.draw_text(0, 64, 120, 32, "Range:")
self.contents.draw_text(0, 96, 140, 32, "% HP Recovered:")
self.contents.draw_text(0, 128, 140, 32, "% SP Recovered:")
self.contents.draw_text(230, 96, 120, 32, "HP Recovered:")
self.contents.draw_text(230, 128, 120, 32, "SP Recovered:")
self.contents.font.color = normal_color
self.contents.draw_text(150, 96, 90, 32, item.recover_hp_rate.to_s)
self.contents.draw_text(150, 128, 90, 32, item.recover_sp_rate.to_s)
self.contents.draw_text(360, 96, 90, 32, item.recover_hp.to_s)
self.contents.draw_text(360, 128, 90, 32, item.recover_sp.to_s)
case item.scope
when 0
self.contents.draw_text(70, 64, 120, 32, "None")
when 1
self.contents.draw_text(70, 64, 120, 32, "One Enemy")
when 2
self.contents.draw_text(70, 64, 120, 32, "All Enemies")
when 3
self.contents.draw_text(70, 64, 120, 32, "One Ally")
when 4
self.contents.draw_text(70, 64, 120, 32, "All Allies")
when 5
self.contents.draw_text(70, 64, 120, 32, "One Dead Ally")
when 6
self.contents.draw_text(70, 64, 120, 32, "All Dead Allies")
when 7
self.contents.draw_text(70, 64, 120, 32, "User")
end
end
end
#===============================================================================
# END Window_Shop_Description_Item
#===============================================================================


#===============================================================================
# Window_Shop_Description_Equipment
#===============================================================================
class Window_Shop_Description_Equipment < Window_Base
def initialize
super(0, 256, 640, 224)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
item = nil
refresh(item)
end

def refresh(item)
self.contents.clear
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(0, 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(28, 0, 120, 32, item.name)
self.contents.draw_text(0, 32, 460, 32, item.description)
self.contents.font.color = system_color
if item.is_a?(RPG::Weapon)
self.contents.draw_text(0, 64, 75, 32, "Attack:")
self.contents.draw_text(0, 96, 120, 32, "Phys. Def:")
self.contents.draw_text(0, 128, 120, 32, "Mag. Def:")
self.contents.draw_text(165, 64, 120, 32, "Str:")
self.contents.draw_text(165, 96, 120, 32, "Dex:")
self.contents.draw_text(165, 128, 120, 32, "Agi:")
self.contents.draw_text(165, 160, 120, 32, "Int:")
self.contents.draw_text(290, 64, 120, 32, "Elements:")
self.contents.draw_text(470, 64, 120, 32, "Inflicts:")
else
self.contents.draw_text(0, 64, 120, 32, "Phys. Def:")
self.contents.draw_text(0, 96, 120, 32, "Mag. Def:")
self.contents.draw_text(0, 128, 120, 32, "Evade:")
self.contents.draw_text(0, 160, 120, 32, "Auto:")
self.contents.draw_text(165, 64, 120, 32, "Str:")
self.contents.draw_text(165, 96, 120, 32, "Dex:")
self.contents.draw_text(165, 128, 120, 32, "Agi:")
self.contents.draw_text(165, 160, 120, 32, "Int:")
self.contents.draw_text(370, 64, 120, 32, "Guards Against:")
end
self.contents.font.color = normal_color
if item.is_a?(RPG::Weapon)
self.contents.draw_text(60, 64, 75, 32, item.atk.to_s)
self.contents.draw_text(90, 96, 75, 32, item.pdef.to_s)
self.contents.draw_text(90, 128, 75, 32, item.mdef.to_s)
self.contents.draw_text(195, 64, 50, 32, item.str_plus.to_s, 2)
self.contents.draw_text(195, 96, 50, 32, item.dex_plus.to_s, 2)
self.contents.draw_text(195, 128, 50, 32, item.agi_plus.to_s, 2)
self.contents.draw_text(195, 160, 50, 32, item.int_plus.to_s, 2)
self.contents.font.size = 14
for i in 0...item.element_set.size
x = 265 + i % 2 * 75
y = 80 + i / 2 * 14
self.contents.draw_text(x, y, 120, 32, $data_system.elements[item.element_set])
end
for i in 0...item.plus_state_set.size
x = 445 + i % 2 * 75
y = 80 + i / 2 * 14
self.contents.draw_text(x, y, 120, 32, $data_states[item.plus_state_set].name)
end
else
self.contents.draw_text(90, 64, 75, 32, item.pdef.to_s)
self.contents.draw_text(90, 96, 75, 32, item.mdef.to_s)
self.contents.draw_text(60, 128, 75, 32, item.eva.to_s)
if $data_states[item.auto_state_id] != nil
self.contents.draw_text(55, 160, 75, 32, $data_states[item.auto_state_id].name)
end
self.contents.draw_text(195, 64, 50, 32, item.str_plus.to_s, 2)
self.contents.draw_text(195, 96, 50, 32, item.dex_plus.to_s, 2)
self.contents.draw_text(195, 128, 50, 32, item.agi_plus.to_s, 2)
self.contents.draw_text(195, 160, 50, 32, item.int_plus.to_s, 2)
self.contents.font.size = 14
@defense = []
for i in 0...item.guard_element_set.size
@defense.push($data_system.elements[item.guard_element_set])
end
for i in 0...item.guard_state_set.size
@defense.push($data_states[item.guard_state_set].name)
end
for i in 0...@defense.size
x = 265 + i % 4 * 80
y = 80 + i / 4 * 14
self.contents.draw_text(x + 15, y, 85, 32, @defense)
end
end
self.contents.font.size = 22
end
end
#===============================================================================
# END Window_Shop_Description_Equipment
#===============================================================================


#===============================================================================
# Window_Shop_Actors
#===============================================================================
class Window_Shop_Actors < Window_Base
def initialize
super(84, 32, 472, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.active = false
self.z += 100
item = nil
refresh(item)
end

def refresh(item)
self.contents.clear
if item == nil
return
end
for i in 0...$game_party.actors.size
x = i%2 * 236
y = i/2 * 192
draw_actor_graphic($game_party.actors, x + 16, y + 48)
draw_actor_name($game_party.actors, x + 48, y + 8)
pdef1 = item.pdef
mdef1 = item.mdef
str1 = item.str_plus
dex1 = item.dex_plus
agi1 = item.agi_plus
int1 = item.int_plus
atk2 = 0
eva2 = 0
pdef2 = 0
mdef2 = 0
str2 = 0
dex2 = 0
agi2 = 0
int2 = 0
if item.is_a?(RPG::Weapon)
if $data_weapons[$game_party.actors.weapon_id] != nil
atk1 = item.atk
atk2 = $data_weapons[$game_party.actors.weapon_id].atk
pdef2 = $data_weapons[$game_party.actors.weapon_id].pdef
mdef2 = $data_weapons[$game_party.actors.weapon_id].mdef
str2 = $data_weapons[$game_party.actors.weapon_id].str_plus
dex2 = $data_weapons[$game_party.actors.weapon_id].dex_plus
agi2 = $data_weapons[$game_party.actors.weapon_id].agi_plus
int2 = $data_weapons[$game_party.actors.weapon_id].int_plus
end
else
eva1 = item.eva
case item.kind
when 0
if $data_armors[$game_party.actors.armor1_id] != nil
eva2 = $data_armors[$game_party.actors.armor1_id].eva
pdef2 = $data_armors[$game_party.actors.armor1_id].pdef
mdef2 = $data_armors[$game_party.actors.armor1_id].mdef
str2 = $data_armors[$game_party.actors.armor1_id].str_plus
dex2 = $data_armors[$game_party.actors.armor1_id].dex_plus
agi2 = $data_armors[$game_party.actors.armor1_id].agi_plus
int2 = $data_armors[$game_party.actors.armor1_id].int_plus
end
when 1
if $data_armors[$game_party.actors.armor2_id] != nil
eva2 = $data_armors[$game_party.actors.armor2_id].eva
pdef2 = $data_armors[$game_party.actors.armor2_id].pdef
mdef2 = $data_armors[$game_party.actors.armor2_id].mdef
str2 = $data_armors[$game_party.actors.armor2_id].str_plus
dex2 = $data_armors[$game_party.actors.armor2_id].dex_plus
agi2 = $data_armors[$game_party.actors.armor2_id].agi_plus
int2 = $data_armors[$game_party.actors.armor2_id].int_plus
end
when 2
if $data_armors[$game_party.actors.armor3_id] != nil
eva2 = $data_armors[$game_party.actors.armor3_id].eva
pdef2 = $data_armors[$game_party.actors.armor3_id].pdef
mdef2 = $data_armors[$game_party.actors.armor3_id].mdef
str2 = $data_armors[$game_party.actors.armor3_id].str_plus
dex2 = $data_armors[$game_party.actors.armor3_id].dex_plus
agi2 = $data_armors[$game_party.actors.armor3_id].agi_plus
int2 = $data_armors[$game_party.actors.armor3_id].int_plus
end
when 3
if $data_armors[$game_party.actors.armor4_id] != nil
eva2 = $data_armors[$game_party.actors.armor4_id].eva
pdef2 = $data_armors[$game_party.actors.armor4_id].pdef
mdef2 = $data_armors[$game_party.actors.armor4_id].mdef
str2 = $data_armors[$game_party.actors.armor4_id].str_plus
dex2 = $data_armors[$game_party.actors.armor4_id].dex_plus
agi2 = $data_armors[$game_party.actors.armor4_id].agi_plus
int2 = $data_armors[$game_party.actors.armor4_id].int_plus
end
end
end
color1 = Color.new(25, 210, 25, 255)
color2 = Color.new(210, 25, 25, 255)
if $game_party.actors.equippable?(item)
self.contents.font.color = normal_color
# PDEF
if (pdef1 - pdef2) > 0
self.contents.font.color = color1
elsif (pdef1 - pdef2) < 0
self.contents.font.color = color2
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x + 25, y + 80, 70, 32, (pdef1 - pdef2).to_s, 2)
# MDEF
if (mdef1 - mdef2) > 0
self.contents.font.color = color1
elsif (mdef1 - mdef2) < 0
self.contents.font.color = color2
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x + 25, y + 112, 70, 32, (mdef1 - mdef2).to_s, 2)
# STR
if (str1 - str2) > 0
self.contents.font.color = color1
elsif (str1 - str2) < 0
self.contents.font.color = color2
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x + 125, y + 48, 70, 32, (str1 - str2).to_s, 2)
# DEX
if (dex1 - dex2) > 0
self.contents.font.color = color1
elsif (dex1 - dex2) < 0
self.contents.font.color = color2
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x + 125, y + 80, 70, 32, (dex1 - dex2).to_s, 2)
# AGI
if (agi1 - agi2) > 0
self.contents.font.color = color1
elsif (agi1 - agi2) < 0
self.contents.font.color = color2
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x + 125, y + 112, 70, 32, (agi1 - agi2).to_s, 2)
# INT
if (int1 - int2) > 0
self.contents.font.color = color1
elsif (int1 - int2) < 0
self.contents.font.color = color2
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x + 125, y + 144, 70, 32, (int1 - int2).to_s, 2)
if item.is_a?(RPG::Weapon)
self.contents.font.color = system_color
self.contents.draw_text(x, y + 48, 80, 32, "Atk:")
self.contents.draw_text(x, y + 80, 80, 32, "Pdef:")
self.contents.draw_text(x, y + 112, 80, 32, "Mdef:")
self.contents.draw_text(x + 110, y + 48, 80, 32, "Str:")
self.contents.draw_text(x + 110, y + 80, 80, 32, "Dex:")
self.contents.draw_text(x + 110, y + 112, 80, 32, "Agi:")
self.contents.draw_text(x + 110, y + 144, 80, 32, "Int:")
self.contents.font.color = normal_color
# ATTACK
if (atk1 - atk2) > 0
self.contents.font.color = color1
elsif (atk1 - atk2) < 0
self.contents.font.color = color2
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x + 25, y + 48, 70, 32, (atk1 - atk2).to_s, 2)
# ELSE if armor...
else
self.contents.font.color = system_color
self.contents.draw_text(x, y + 48, 80, 32, "Eva:")
self.contents.draw_text(x, y + 80, 80, 32, "Pdef:")
self.contents.draw_text(x, y + 112, 80, 32, "Mdef:")
self.contents.draw_text(x + 110, y + 48, 80, 32, "Str:")
self.contents.draw_text(x + 110, y + 80, 80, 32, "Dex:")
self.contents.draw_text(x + 110, y + 112, 80, 32, "Agi:")
self.contents.draw_text(x + 110, y + 144, 80, 32, "Int:")
self.contents.font.color = normal_color
if (eva1 - eva2) > 0
self.contents.font.color = color1
elsif (eva1 - eva2) < 0
self.contents.font.color = color2
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x + 25, y + 48, 70, 32, (eva1 - eva2).to_s, 2)
end
else
self.contents.font.color = disabled_color
self.contents.draw_text(x + 10, y + 80, 120, 32, "Cannot Equip")
self.contents.font.color = normal_color
end
end
end
end
#===============================================================================
# END Window_Shop_Actors
#===============================================================================


#===============================================================================
# Window_Shop_Amount
#===============================================================================
class Window_Shop_Amount < Window_Selectable

attr_accessor :amount

def initialize
super(80, 208, 480, 96)
@item_max = 1
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.z += 100
@amount = 1
item = $data_items[1]
option_index = 0
refresh(item, option_index)
end

def refresh(item, option_index)
self.contents.clear
if item == nil
return
end
if option_index == nil
return
end
if option_index == 0
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 200, 32, "How many?")
self.contents.font.color = normal_color
if $game_party.gold < (@amount * item.price)
self.contents.font.color = disabled_color
end
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(0, 36, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(28, 32, 120, 32, item.name)
self.contents.draw_text(335, 32, 10, 32, "x")
self.contents.draw_text(280, 32, 30, 32, @amount.to_s, 2)
self.cursor_rect.set(284, 32, 32, 32)
self.contents.draw_text(370, 32, 70, 32, (@amount * item.price).to_s, 2)
else
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 200, 32, "How many?")
self.contents.font.color = normal_color
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(0, 36, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(28, 32, 120, 32, item.name)
self.contents.draw_text(335, 32, 10, 32, "x")
self.contents.draw_text(280, 32, 30, 32, @amount.to_s, 2)
self.cursor_rect.set(284, 32, 32, 32)
self.contents.draw_text(370, 32, 70, 32, (@amount * (item.price / 2)).to_s, 2)
end
end
end
#===============================================================================
# END Window_Shop_Amount
#===============================================================================


#===============================================================================
# Scene_Shop
#===============================================================================
class Scene_Shop
def main
@counter = 0
@info_window = Window_Shop_Info.new
@option_window = Window_Shop_Option.new
@gold_window = Window_Shop_Gold.new
@own_window = Window_Shop_Own.new
@list_window = Window_Shop_List.new($game_temp.shop_goods)
@desc_item_window = Window_Shop_Description_Item.new
@desc_equip_window = Window_Shop_Description_Equipment.new
@actor_window = Window_Shop_Actors.new
@amount_window = Window_Shop_Amount.new

Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze

@info_window.dispose
@option_window.dispose
@gold_window.dispose
@own_window.dispose
@list_window.dispose
@desc_item_window.dispose
@desc_equip_window.dispose
@actor_window.dispose
@amount_window.dispose
end

def update
@info_window.update
@option_window.update
@gold_window.update
@own_window.update
@list_window.update
@desc_item_window.update
@desc_equip_window.update
@actor_window.update
@amount_window.update

if @option_window.active
update_option
return
end

if @list_window.active
update_list
return
end

if @actor_window.visible
update_actors
return
end

if @amount_window.active and @option_window.index == 0
update_amount
return
end

if @amount_window.active and @option_window.index == 1
update_sell
return
end
end

def update_option
@info_window.refresh(0)
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
case @option_window.index
when 0
$game_system.se_play($data_system.decision_se)
@list_window.refresh
@option_window.active = false
@list_window.visible = true
@list_window.active = true
@list_window.index = 0
when 1
$game_system.se_play($data_system.decision_se)
@list_window.refresh_sell(@option_window.index)
@option_window.active = false
@list_window.visible = true
@list_window.active = true
@list_window.index = 0
when 2
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
end
end

def update_list
@info_window.refresh(1)
@item = @list_window.item
if @counter != 1
if @item.is_a?(RPG::Item)
@desc_item_window.refresh(@item)
@counter = 1
else
@desc_equip_window.refresh(@item)
@counter = 1
end
end
@own_window.refresh(@list_window.item)
if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN) or Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN)
@counter = 0
end
if @item.is_a?(RPG::Item)
if @counter != 1
@desc_item_window.refresh(@item)
@counter = 1
end
@desc_item_window.visible = true
@desc_equip_window.visible = false
else
if @counter != 1
@desc_equip_window.refresh(@item)
@counter = 1
end
@desc_item_window.visible = false
@desc_equip_window.visible = true
end
if Input.trigger?(Input::B)
@counter = 0
$game_system.se_play($data_system.cancel_se)
@desc_item_window.visible = false
@desc_equip_window.visible = false
@desc_item_window.refresh(nil)
@desc_equip_window.refresh(nil)
@option_window.active = true
@list_window.visible = false
@list_window.active = false
@own_window.refresh(nil)
return
end
if Input.trigger?(Input::A)
unless @item.is_a?(RPG::Item)
$game_system.se_play($data_system.decision_se)
@actor_window.refresh(@item)
@actor_window.visible = true
@list_window.active = false
return
else
$game_system.se_play($data_system.buzzer_se)
end
end
if Input.trigger?(Input::C)
if @item == nil or @item.id == 0 or @item.price == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if @option_window.index == 0
case @item
when RPG::Item
if $game_party.item_number(@item.id) >= 99
$game_system.se_play($data_system.buzzer_se)
return
end
when RPG::Weapon
if $game_party.weapon_number(@item.id) >= 99
$game_system.se_play($data_system.buzzer_se)
return
end
when RPG::Armor
if $game_party.armor_number(@item.id) >= 99
$game_system.se_play($data_system.buzzer_se)
return
end
end
end
$game_system.se_play($data_system.decision_se)
@amount_window.visible = true
@amount_window.active = true
@list_window.active = false
return
end
end

def update_actors
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@actor_window.visible = false
@list_window.active = true
end
end

def update_amount
@amount_window.refresh(@item, @option_window.index)
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@amount_window.amount = 1
@amount_window.visible = false
@amount_window.active = false
@list_window.active = true
return
end
if Input.trigger?(Input::C)
if $game_party.gold >= (@amount_window.amount * @item.price)
$game_system.se_play($data_system.decision_se)
$game_party.lose_gold(@amount_window.amount * @item.price)
case @item
when RPG::Item
$game_party.gain_item(@item.id, @amount_window.amount)
when RPG::Weapon
$game_party.gain_weapon(@item.id, @amount_window.amount)
when RPG::Armor
$game_party.gain_armor(@item.id, @amount_window.amount)
end
@gold_window.refresh
@amount_window.amount = 1
@amount_window.visible = false
@amount_window.active = false
@list_window.active = true
@list_window.refresh
return
else
$game_system.se_play($data_system.buzzer_se)
end
end
if Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@amount_window.amount -= 1
if @amount_window.amount == 0
@amount_window.amount = 1
end
return
end
if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@amount_window.amount += 1
case @item
when RPG::Item
if ($game_party.item_number(@item.id) + @amount_window.amount) > 99
@amount_window.amount = (99 - $game_party.item_number(@item.id))
end
when RPG::Weapon
if ($game_party.weapon_number(@item.id) + @amount_window.amount) > 99
@amount_window.amount = (99 - $game_party.weapon_number(@item.id))
end
when RPG::Armor
if ($game_party.armor_number(@item.id) + @amount_window.amount) > 99
@amount_window.amount = (99 - $game_party.armor_number(@item.id))
end
end
return
end
if Input.trigger?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@amount_window.amount += 10
case @item
when RPG::Item
if ($game_party.item_number(@item.id) + @amount_window.amount) > 99
@amount_window.amount = (99 - $game_party.item_number(@item.id))
end
when RPG::Weapon
if ($game_party.weapon_number(@item.id) + @amount_window.amount) > 99
@amount_window.amount = (99 - $game_party.weapon_number(@item.id))
end
when RPG::Armor
if ($game_party.armor_number(@item.id) + @amount_window.amount) > 99
@amount_window.amount = (99 - $game_party.armor_number(@item.id))
end
end
return
end
if Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@amount_window.amount -= 10
if @amount_window.amount < 1
@amount_window.amount = 1
end
return
end
end

def update_sell
@amount_window.refresh(@item, @option_window.index)
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@amount_window.amount = 1
@amount_window.visible = false
@amount_window.active = false
@list_window.active = true
return
end
if Input.trigger?(Input::C)
if @item.price == 0
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
case @item
when RPG::Item
$game_party.gain_gold(@amount_window.amount * (@item.price / 2))
$game_party.lose_item(@item.id, @amount_window.amount)
when RPG::Weapon
$game_party.gain_gold(@amount_window.amount * (@item.price / 2))
$game_party.lose_weapon(@item.id, @amount_window.amount)
when RPG::Armor
$game_party.gain_gold(@amount_window.amount * (@item.price / 2))
$game_party.lose_armor(@item.id, @amount_window.amount)
end
@gold_window.refresh
@amount_window.amount = 1
@amount_window.visible = false
@amount_window.active = false
@list_window.active = true
@list_window.refresh_sell(@option_window.index)
@desc_equip_window.refresh(nil)
@desc_item_window.refresh(nil)
end
if Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@amount_window.amount -= 1
if @amount_window.amount < 1
@amount_window.amount = 1
end
end
if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
case @item
when RPG::Item
@amount_window.amount += 1
if @amount_window.amount > $game_party.item_number(@item.id)
@amount_window.amount = $game_party.item_number(@item.id)
end
when RPG::Weapon
@amount_window.amount += 1
if @amount_window.amount > $game_party.weapon_number(@item.id)
@amount_window.amount = $game_party.weapon_number(@item.id)
end
when RPG::Armor
@amount_window.amount += 1
if @amount_window.amount > $game_party.armor_number(@item.id)
@amount_window.amount = $game_party.armor_number(@item.id)
end
end
end
if Input.trigger?(Input::UP)
$game_system.se_play($data_system.cursor_se)
case @item
when RPG::Item
@amount_window.amount += 10
if @amount_window.amount > $game_party.item_number(@item.id)
@amount_window.amount = $game_party.item_number(@item.id)
end
when RPG::Weapon
@amount_window.amount += 10
if @amount_window.amount > $game_party.weapon_number(@item.id)
@amount_window.amount = $game_party.weapon_number(@item.id)
end
when RPG::Armor
@amount_window.amount += 10
if @amount_window.amount > $game_party.armor_number(@item.id)
@amount_window.amount = $game_party.armor_number(@item.id)
end
end
end
if Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@amount_window.amount -= 10
if @amount_window.amount < 1
@amount_window.amount = 1
end
end
end

end


Rune's Custom Menu Script:
#==============#
#=> CMS #3 <=#
#=> Rune <=#
#=> Feb 2008 <=#
#==============#
$LOGO = RPG::Cache.picture("Logo")

$data_mapinfos = load_data('Data/MapInfos.rxdata')

class Window_Steps
def initialize
super(0, 0, 410, 96)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
contents.clear
contents.font.color = system_color
contents.draw_text(0, 0, 378, 32, 'Location', 1)
contents.font.color = normal_color
name = $data_mapinfos[$game_map.map_id].name
contents.draw_text(0, 32, 378, 32, name, 1)
end
end

class Window_GName < Window_Base
def initialize
super(0, 0, 250, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 218, 32, "Menu", 1)
end
end

class Window_GLogo < Window_Base
def initialize
super(0, 0, 250, 320)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.blt(0, 0, $LOGO, Rect.new(0, 0, 220, 288))
end
end

class Window_MenuStatus < Window_Selectable
def initialize
super(0, 0, 230, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors
draw_actor_graphic(actor, x - 40, y + 75)
draw_actor_name(actor, x - 60, y - 5)
draw_actor_class(actor, x - 20, y + 19)
draw_actor_level(actor, x + 30, y - 5)
draw_actor_state(actor, x + 54, y + 19)
draw_actor_hp(actor, x - 16, y + 43)
draw_actor_sp(actor, x - 16, y + 67)
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end

class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
end
def main
s1 = "Inventory"
s2 = "Skills"
s3 = "Equipment"
s4 = "Stats"
s5 = "Save"
s6 = "Quit"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
@command_window.x = 480
@command_window.height = 32 * 7 + 1
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(4)
end
@playtime_window = Window_PlayTime.new
@playtime_window.x = 480
@playtime_window.y = 288
@steps_window = Window_Steps.new
@steps_window.x = 230
@steps_window.y = 384
@gold_window = Window_Gold.new
@gold_window.x = 480
@gold_window.y = 224
@status_window = Window_MenuStatus.new
@status_window.x = 0
@status_window.y = 0
@gnam_window = Window_GName.new
@gnam_window.x = 230
@gnam_window.y = 0
@glog_window = Window_GLogo.new
@glog_window.x = 230
@glog_window.y = 64
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@playtime_window.dispose
@steps_window.dispose
@gold_window.dispose
@status_window.dispose
@gnam_window.dispose
@glog_window.dispose
end
def update
@command_window.update
@playtime_window.update
@steps_window.update
@gold_window.update
@status_window.update
@gnam_window.update
@glog_window.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end


Dubealex's Advanced Message Script:
#===================================================
# ■ AMS - Advanced Message Script - R4 [Update #2]
#===================================================
# For more infos and update, visit:
# http://www.dubealex.com (Creation Asylum)
#
# Edited, Fixed and Enhanced by: Dubealex
# Original Script Core by: XRXS Scripter (Jap Dudes)
# HTML Hexadecimal color feature from: Phylomorphis
#
# Special Thanks:
# Rabu: For enabling the Show Face feature in an encrypted project
#
# To found all my new features, search the following: #NEW
# To configure the button to skip the dialog, search: #SKIP_TEXT_CODE
#
# May 18, 2005
#===================================================

LETTER_BY_LETTER_MODE = true #Set the letter by letter mode ON/OFF

#===================================================
# ▼ CLASS AMS Begins
#===================================================
class AMS

attr_accessor :name_box_x_offset
attr_accessor :name_box_y_offset
attr_accessor :font_type
attr_accessor :name_font_type
attr_accessor :font_size
attr_accessor :name_font_size
attr_accessor :message_box_opacity
attr_accessor :name_box_skin
attr_accessor :name_box_text_color
attr_accessor :message_box_text_color
attr_accessor :message_box_skin
attr_accessor :name_box_width
attr_accessor :name_box_height
attr_accessor :message_width
attr_accessor :message_height
attr_accessor :message_x
attr_accessor :message_y_bottom
attr_accessor :message_y_middle
attr_accessor :message_y_top
attr_accessor :event_message_x_ofset
attr_accessor :event_message_y_ofset

def initialize

@name_box_x_offset = 0 #Choose the X axis offset of the name bos. default= 0
@name_box_y_offset = -10 #Choose the Y axis offset of the name bos. default= -10
@name_box_width = 8 #Choose the width of the Name Box. default= 8
@name_box_height = 26 #Choose the height of the Name Box. default= 26

@font_type = "Tahoma" #Choose the Font Name (Case Sensitive) for message box
@name_font_type = "Tahoma" #Choose the Font Name (Case Sensitive) for Name Box
@font_size = 22 #Choose the default Font Size for message box text
@name_font_size = 22 #Choose the deafault Font Size for Name Box text
@name_box_text_color=0 #Choose the Text Color of the Name Box
@message_box_text_color=0 #Choose the Text Color of the Message Box

@message_box_opacity = 160 #Choose the opacity of the message window. Default=160
@message_box_skin = "sys08" #Choose the WindowSkin for the Message Box
@name_box_skin = "001-Blue01" #Choose the WindowSkin for the Name Box

@message_width = 480 #Choose the width size of the message box. Default=480
@message_height = 160 #Choose the height size of the message box. Default=160
@message_x = 80 #Choose the X position of the message box. Default=80
@message_y_bottom = 304 #Choose the Y bottom position of the message box. Default=304
@message_y_middle = 160 #Choose the Y middle position of the message box. Default=160
@message_y_top = 16 #Choose the Y top position of the message box. Default=16

@event_message_x_ofset = 0 #Choose the X position offset of the event message. Default=0
@event_message_y_ofset = 48 #Choose the Y position offset of the event message. Default=48

end
end
#===================================================
# ▲ CLASS AMS Ends
#===================================================


#===================================================
# ▼ Class Window_Message Begins
#===================================================
class Window_Message < Window_Selectable

alias xrxs9_initialize initialize

def initialize

@alex_skip = false

xrxs9_initialize

if $soundname_on_speak == nil then
$soundname_on_speak = ""
end

$gaiji_file = "./Graphics/Gaiji/sample.png"

if FileTest.exist?($gaiji_file)
@gaiji_cache = Bitmap.new($gaiji_file)
else
@gaigi_cache = nil
end
@opacity_text_buf = Bitmap.new(32, 32)
end


#--------------------------------------------------------------------------

alias xrxs9_terminate_message terminate_message

def terminate_message

if @name_window_frame != nil
@name_window_frame.dispose
@name_window_frame = nil
end

if @name_window_text != nil
@name_window_text.dispose
@name_window_text = nil
end
xrxs9_terminate_message
end

#--------------------------------------------------------------------------

def refresh

self.contents.clear
self.contents.font.color = text_color($ams.message_box_text_color)
self.contents.font.name = $ams.font_type
self.contents.font.size = $ams.font_size
self.windowskin = RPG::Cache.windowskin($ams.message_box_skin)
@x = @y = @max_x = @max_y = @indent = @lines = 0
@face_indent = 0
@opacity = 255
@cursor_width = 0
@write_speed = 0
@write_wait = 0
@mid_stop = false
@face_file = nil
@popchar = -2

if $game_temp.choice_start == 0
@x = 8
end

if $game_temp.message_text != nil
@now_text = $game_temp.message_text
if (/\A\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then
@face_file = $1 + ".png"
@x = @face_indent = 128
if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
end
@now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
end

begin
last_text = @now_text.clone
@now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
end until @now_text == last_text
@now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
$game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
end

#NEW
#Dubealex's Stop Skip Text ON-OFF
@now_text.gsub!(/\\[%]/) { "\100" }
#End new command

#NEW
#Dubealex's Show Monster Name Feature
@now_text.gsub!(/\\[Mm]\[([0-9]+)\]/) do
$data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].name : ""
end
#End new command

#NEW
#Dubealex's Show Item Price Feature
@now_text.gsub!(/\\[Pp]rice\[([0-9]+)\]/) do
$data_items[$1.to_i] != nil ? $data_items[$1.to_i].price : ""
end
#End new command

#NEW
#Dubealex's Show Hero Class Name Feature
@now_text.gsub!(/\\[Cc]lass\[([0-9]+)\]/) do
$data_classes[$data_actors[$1.to_i].class_id] != nil ? $data_classes[$data_actors[$1.to_i].class_id].name : ""
end
#End new command

#NEW
#Dubealex's Show Current Map Name Feature
@now_text.gsub!(/\\[Mm]ap/) do
$game_map.name != nil ? $game_map.name : ""
end
#End new command

#NEW
#Dubealex's Choose Name Box Text Color
@now_text.gsub!(/\\[Zz]\[([0-9]+)\]/) do
$ams.name_box_text_color=$1.to_i
@now_text.sub!(/\\[Zz]\[([0-9]+)\]/) { "" }
end
#End new command

name_window_set = false
if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil
name_window_set = true
name_text = $1
@now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
end

if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
@popchar = $1.to_i
if @popchar == -1
@x = @indent = 48
@y = 4
end
@now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
end

@max_choice_x = 0
if @popchar >= 0
@text_save = @now_text.clone
@max_x = 0
@max_y = 4
for i in 0..3
line = @now_text.split(/\n/)[3-i]
@max_y -= 1 if line == nil and @max_y <= 4-i
next if line == nil
line.gsub!(/\\\w\[(\w+)\]/) { "" }
cx = contents.text_size(line).width
@max_x = cx if cx > @max_x
if i >= $game_temp.choice_start
@max_choice_x = cx if cx > @max_choice_x
end
end
self.width = @max_x + 32 + @face_indent
self.height = (@max_y - 1) * 32 + 64
@max_choice_x -= 68
@max_choice_x -= @face_indent*216/128
else
@max_x = self.width - 32 - @face_indent
for i in 0..3
line = @now_text.split(/\n/)
next if line == nil
line.gsub!(/\\\w\[(\w+)\]/) { "" }
cx = contents.text_size(line).width
if i >= $game_temp.choice_start
@max_choice_x = cx if cx > @max_choice_x
end
end
@max_choice_x += 8
end
@cursor_width = 0
@now_text.gsub!(/\\\\/) { "\000" }
@now_text.gsub!(/\\[Cc]\[([0123456789ABCDEF#]+)\]/) { "\001[#{$1}]" }
@now_text.gsub!(/\\[Gg]/) { "\002" }
@now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
@now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }

#NEW
#Dubealex's Permanent Color Change
@now_text.gsub!(/\\[Cc]olor\[([0-9]+)\]/) do
$ams.message_box_text_color= $1.to_i
@now_text.sub!(/\\[Cc]\[([0-9]+)\]/) { "" }
end
#End of new command

#NEW
#Dubealex's Font Change Feature
@now_text.gsub(/\\[Tt]\[(.*?)\]/) do
buftxt = $1.to_s
$ams.font_type = buftxt
@now_text.sub!(/\\[Tt]\[(.*?)\]/) { "" }
end
#End of new command

@now_text.gsub!(/\\[.]/) { "\005" }
@now_text.gsub!(/\\[|]/) { "\006" }
@now_text.gsub!(/\\[>]/) { "\016" }
@now_text.gsub!(/\\[<]/) { "\017" }
@now_text.gsub!(/\\[!]/) { "\020" }
@now_text.gsub!(/\\[~]/) { "\021" }
@now_text.gsub!(/\\[Ee]\[([0-9]+)\]/) { "\022[#{$1}]" }
@now_text.gsub!(/\\[Ii]/) { "\023" }
@now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
@now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
@now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
@now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "\027[#{$1}]" }

reset_window

if name_window_set
color=$ams.name_box_text_color
off_x = $ams.name_box_x_offset
off_y = $ams.name_box_y_offset
space = 2
x = self.x + off_x - space / 2
y = self.y + off_y - space / 2
w = self.contents.text_size(name_text).width + $ams.name_box_width + space
h = $ams.name_box_height + space
@name_window_frame = Window_Frame.new(x, y, w, h)
@name_window_frame.z = self.z + 1
x = self.x + off_x + 4
y = self.y + off_y
@name_window_text = Air_Text.new(x, y, name_text, color)
@name_window_text.z = self.z + 2
end
end

reset_window

if $game_temp.choice_max > 0
@item_max = $game_temp.choice_max
self.active = true
self.index = 0
end

if $game_temp.num_input_variable_id > 0
digits_max = $game_temp.num_input_digits_max
number = $game_variables[$game_temp.num_input_variable_id]
@input_number_window = Window_InputNumber.new(digits_max)
@input_number_window.number = number
@input_number_window.x = self.x + 8
@input_number_window.y = self.y + $game_temp.num_input_start * 32
end
end

#--------------------------------------------------------------------------

def update

super

if @fade_in
self.contents_opacity += 24
if @input_number_window != nil
@input_number_window.contents_opacity += 24
end
if self.contents_opacity == 255
@fade_in = false
end
return
end
@now_text = nil if @now_text == ""

if @now_text != nil and @mid_stop == false
if @write_wait > 0
@write_wait -= 1
return
end
text_not_skip = LETTER_BY_LETTER_MODE
while true
@max_x = @x if @max_x < @x
@max_y = @y if @max_y < @y
if (c = @now_text.slice!(/./m)) != nil
if c == "\000"
c = "\\"
end

if c == "\001"
@now_text.sub!(/\[([0123456789ABCDEF#]+)\]/, "")
temp_color = $1
color = temp_color.to_i
leading_x = temp_color.to_s.slice!(/./m)
if leading_x == "#"
self.contents.font.color = hex_color(temp_color)
next
end
if color >= 0 and color <= 7
self.contents.font.color = text_color(color)
end
next
end

if c == "\002"
if @gold_window == nil and @popchar <= 0
@gold_window = Window_Gold.new
@gold_window.x = 560 - @gold_window.width
if $game_temp.in_battle
@gold_window.y = 192
else
@gold_window.y = self.y >= 128 ? 32 : 384
end
@gold_window.opacity = self.opacity
@gold_window.back_opacity = self.back_opacity
end
c = ""
end

if c == "\003"
@now_text.sub!(/\[([0-9]+)\]/, "")
speed = $1.to_i
if speed >= 0 and speed <= 19
@write_speed = speed
end
c = ""
end

if c == "\004"
@now_text.sub!(/\[(.*?)\]/, "")
buftxt = $1.dup.to_s
if buftxt.match(/\//) == nil and buftxt != "" then
$soundname_on_speak = "Audio/SE/" + buftxt
else
$soundname_on_speak = buftxt.dup
end
c = ""
elsif c == "\004"
c = ""
end

if c == "\005"
@write_wait += 5
c = ""
end

if c == "\006"
@write_wait += 20
c = ""
end

if c == "\016"
text_not_skip = false
c = ""
end

if c == "\017"
text_not_skip = true
c = ""
end

if c == "\020"
@mid_stop = true
c = ""
end

if c == "\021"
terminate_message
return
end

if c == "\023"
@indent = @x
c = ""
end

if c == "\024"
@now_text.sub!(/\[([0-9]+)\]/, "")
@opacity = $1.to_i
color = self.contents.font.color
self.contents.font.name = $ams.font_type
self.contents.font.size = $ams.font_size
self.contents.font.color = Color.new(color.red, color.green, color.blue, color.alpha * @opacity / 255)
c = ""
end

if c == "\025"
@now_text.sub!(/\[([0-9]+)\]/, "")
self.contents.font.size = [[$1.to_i, 6].max, 32].min
c = ""
end

if c == "\026"
@now_text.sub!(/\[([0-9]+)\]/, "")
@x += $1.to_i
c = ""
end

if c == "\027"
@now_text.sub!(/\[(.*?)\]/, "")
@x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)
if $soundname_on_speak != ""
Audio.se_play($soundname_on_speak)
end
c = ""
end

if c == "\030"
@now_text.sub!(/\[(.*?)\]/, "")
self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
if $soundname_on_speak != ""
Audio.se_play($soundname_on_speak)
end
@x += 24
c = ""
end

if c == "\n"
@lines += 1
@y += 1
@x = 0 + @indent + @face_indent
if @lines >= $game_temp.choice_start
@x = 8 + @indent + @face_indent
@cursor_width = @max_choice_x
end
c = ""
end

if c == "\022"
@now_text.sub!(/\[([0-9]+)\]/, "")
@x += gaiji_draw(4 + @x, @y * line_height + (line_height - self.contents.font.size), $1.to_i)
c = ""
end

#NEW
#Dubealex's Text Skip On/OFF Command
if c == "\100"
if @alex_skip==false
@alex_skip=true
else
@alex_skip=false
end
c = ""
end
#end of new command

if c != ""
self.contents.draw_text(0+@x, 32 * @y, 40, 32, c)
@x += self.contents.text_size(c).width
if $soundname_on_speak != "" then
Audio.se_play($soundname_on_speak)
end
end

#SKIP_TEXT_CODE

# B = Escape, 0 (On The NumPad), X
# C = Enter, Space Bar and C
# A = Shift, Z

if Input.press?(Input::C) # <-- Change the value on that line
if @alex_skip==false
text_not_skip = false
end
end
else
text_not_skip = true
break
end

if text_not_skip
break
end
end
@write_wait += @write_speed
return
end

if @input_number_window != nil
@input_number_window.update
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
$game_variables[$game_temp.num_input_variable_id] =
@input_number_window.number
$game_map.need_refresh = true
@input_number_window.dispose
@input_number_window = nil
terminate_message
end
return
end

if @contents_showing
if $game_temp.choice_max == 0
self.pause = true
end

if Input.trigger?(Input::B)
if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
$game_system.se_play($data_system.cancel_se)
$game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
terminate_message
end
end

if Input.trigger?(Input::C)
if $game_temp.choice_max > 0
$game_system.se_play($data_system.decision_se)
$game_temp.choice_proc.call(self.index)
end
if @mid_stop
@mid_stop = false
return
else
terminate_message
end
end
return
end

if @fade_out == false and $game_temp.message_text != nil
@contents_showing = true
$game_temp.message_window_showing = true
refresh
Graphics.frame_reset
self.visible = true
self.contents_opacity = 0
if @input_number_window != nil
@input_number_window.contents_opacity = 0
end
@fade_in = true
return
end

if self.visible
@fade_out = true
self.opacity -= 48
if self.opacity == 0
self.visible = false
@fade_out = false
$game_temp.message_window_showing = false
end
return
end
end

#--------------------------------------------------------------------------

def get_character(parameter)

case parameter
when 0
return $game_player
else
events = $game_map.events
return events == nil ? nil : events[parameter]
end
end

#--------------------------------------------------------------------------

def reset_window

#MESSAGE_SIZE
#MESSAGE_POSITION

if @popchar >= 0
events = $game_map.events
if events != nil
character = get_character(@popchar)
x = [[character.screen_x - $ams.event_message_x_ofset - self.width / 2, 4].max, 636 - self.width].min
y = [[character.screen_y - $ams.event_message_y_ofset - self.height, 4].max, 476 - self.height].min
self.x = x
self.y = y
end
elsif @popchar == -1
self.x = -4
self.y = -4
self.width = 648
self.height = 488
else
if $game_temp.in_battle
self.y = 16
else
case $game_system.message_position
when 0
self.y = $ams.message_y_top
when 1
self.y = $ams.message_y_middle
when 2
self.y = $ams.message_y_bottom
end
self.x = $ams.message_x
if @face_file == nil
self.width = $ams.message_width
self.x = $ams.message_x
else
if self.width <= 600
self.width = 600
self.x -=60
end
end
self.height = $ams.message_height
end
end
self.contents = Bitmap.new(self.width - 32, self.height - 32)
self.contents.font.color = text_color($ams.message_box_text_color)
self.contents.font.name = $ams.font_type
self.contents.font.size = $ams.font_size
if @face_file != nil
self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
end
if @popchar == -1
self.opacity = 255
self.back_opacity = 0
elsif $game_system.message_frame == 0
self.opacity = 255
self.back_opacity = $ams.message_box_opacity
else
self.opacity = 0
self.back_opacity = $ams.message_box_opacity
end
end

#--------------------------------------------------------------------------

def gaiji_draw(x, y, num)

if @gaiji_cache == nil
return 0
else
if @gaiji_cache.width < num * 24
return 0
end

if self.contents.font.size >= 20 and self.contents.font.size <= 24
size = 24
else
size = self.contents.font.size * 100 * 24 / 2200
end

self.contents.stretch_blt(Rect.new(x, y, size, size), @gaiji_cache, Rect.new(num * 24, 0, 24, 24))

if $soundname_on_speak != "" then
Audio.se_play($soundname_on_speak)
end
return size
end
end

#--------------------------------------------------------------------------

def line_height
return 32

if self.contents.font.size >= 20 and self.contents.font.size <= 24
return 32
else
return self.contents.font.size * 15 / 10
end
end

#--------------------------------------------------------------------------

def ruby_draw_text(target, x, y, str,opacity)

sizeback = target.font.size
target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
rubysize = [rubysize, 6].max
opacity = [[opacity, 0].max, 255].min
split_s = str.split(/,/)
split_s[0] == nil ? split_s[0] = "" : nil
split_s[1] == nil ? split_s[1] = "" : nil

height = sizeback + rubysize
width = target.text_size(split_s[0]).width

target.font.size = rubysize
ruby_width = target.text_size(split_s[1]).width
target.font.size = sizeback

buf_width = [target.text_size(split_s[0]).width, ruby_width].max

width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0

if opacity == 255
target.font.size = rubysize
target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
target.font.size = sizeback
target.draw_text(x, y, width, target.font.size, split_s[0])
return width
else
if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
@opacity_text_buf.dispose
@opacity_text_buf = Bitmap.new(buf_width, height)
else
@opacity_text_buf.clear
end
@opacity_text_buf.font.size = rubysize
@opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
@opacity_text_buf.font.size = sizeback
@opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
if sub_x >= 0
target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
else
target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
end
return width
end
end

#--------------------------------------------------------------------------

def convart_value(option, index)
option == nil ? option = "" : nil
option.downcase!

case option
when "i"
unless $data_items[index].name == nil
r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
end
when "w"
unless $data_weapons[index].name == nil
r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
end
when "a"
unless $data_armors[index].name == nil
r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
end
when "s"
unless $data_skills[index].name == nil
r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
end
else
r = $game_variables[index]
end

r == nil ? r = "" : nil
return r
end

#--------------------------------------------------------------------------

def dispose
terminate_message

if @gaiji_cache != nil
unless @gaiji_cache.disposed?
@gaiji_cache.dispose
end
end

unless @opacity_text_buf.disposed?
@opacity_text_buf.dispose
end

$game_temp.message_window_showing = false
if @input_number_window != nil
@input_number_window.dispose
end
super
end

#--------------------------------------------------------------------------

def update_cursor_rect
if @index >= 0
n = $game_temp.choice_start + @index
self.cursor_rect.set(8 + @indent + @face_indent, n * 32, @cursor_width, 32)
else
self.cursor_rect.empty
end
end
end
#=========================================
# ▲ CLASS Window_Message Ends
#=========================================


#=========================================
# ▼ Class Window_Frame Begins
#=========================================
class Window_Frame < Window_Base

def initialize(x, y, width, height)
super(x, y, width, height)
self.windowskin = RPG::Cache.windowskin($ams.name_box_skin)
self.contents = nil
end

#--------------------------------------------------------------------------

def dispose
super
end
end
#=========================================
# ▲ CLASS Window_Frame Ends
#=========================================


#=========================================
# ▼ CLASS Game_Map Additional Code Begins
#=========================================
class Game_Map

#Dubealex's Addition (from XRXS) to show Map Name on screen
def name
$map_infos[@map_id]
end
end
#=========================================
# ▲ CLASS Game_Map Additional Code Ends
#=========================================


#=========================================
# ▼ CLASS Scene_Title Additional Code Begins
#=========================================
class Scene_Title

#Dubealex's Addition (from XRXS) to show Map Name on screen
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end

#Dubealex's addition to save data from the AMS in the save files
$ams = AMS.new

end
#=========================================
# ▲ CLASS Scene_Title Additional Code Ends
#=========================================


#=========================================
# ▼ CLASS Window_Base Additional Code Begins
#=========================================
class Window_Base < Window

#Dubealex Addition (from Phylomorphis) to use HTML Hex Code Colors
def hex_color(string)
red = 0
green = 0
blue = 0
if string.size != 6
print("Hex strings must be six characters long.")
print("White text will be used.")
return Color.new(255, 255, 255, 255)
end
for i in 1..6
s = string.slice!(/./m)
if s == "#"
print("Hex color string may not contain the \"#\" character.")
print("White text will be used.")
return Color.new(255, 255, 255, 255)
end
value = hex_convert(s)
if value == -1
print("Error converting hex value.")
print("White text will be used.")
return Color.new(255, 255, 255, 255)
end
case i
when 1
red += value * 16
when 2
red += value
when 3
green += value * 16
when 4
green += value
when 5
blue += value * 16
when 6
blue += value
end
end
return Color.new(red, green, blue, 255)
end

#--------------------------------------------------------------------------

def hex_convert(character)
case character
when "0"
return 0
when "1"
return 1
when "2"
return 2
when "3"
return 3
when "4"
return 4
when "5"
return 5
when "6"
return 6
when "7"
return 7
when "8"
return 8
when "9"
return 9
when "A"
return 10
when "B"
return 11
when "C"
return 12
when "D"
return 13
when "E"
return 14
when "F"
return 15
end
return -1
end
end
#=========================================
# ▲ CLASS Window_Base Additional Code Ends
#=========================================


#=========================================
# ▼ Class Air_Text Begins
#=========================================
class Air_Text < Window_Base

def initialize(x, y, designate_text, color=0)

super(x-16, y-16, 32 + designate_text.size * 12, 56)
self.opacity = 0
self.back_opacity = 0
self.contents = Bitmap.new(self.width - 32, self.height - 32)
w = self.contents.width
h = self.contents.height
self.contents.font.name = $ams.name_font_type
self.contents.font.size = $ams.name_font_size
self.contents.font.color = text_color(color)
self.contents.draw_text(0, 0, w, h, designate_text)
end

#--------------------------------------------------------------------------

def dispose
self.contents.clear
super
end
end
#==========================================
# ▲ CLASS Air_Text Ends
#==========================================


#===================================================
# ▼ CLASS Scene_Save Additional Code Begins
#===================================================
class Scene_Save < Scene_File

alias ams_original_write_save_data write_save_data

def write_save_data(file)
ams_original_write_save_data(file)
Marshal.dump($ams, file)
end

end
#===================================================
# ▲ CLASS Scene_Save Additional Code Ends
#===================================================


#===================================================
# ▼ CLASS Scene_Load Additional Code Begins
#===================================================
class Scene_Load < Scene_File

alias ams_original_read_save_data read_save_data

def read_save_data(file)
ams_original_read_save_data(file)
$ams = Marshal.load(file)
end

end
#===================================================
# ▲ CLASS Scene_Load Additional Code Ends
#===================================================


Blizzards DREAM Data encryption v3
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# DREAM controller for Save Files by Blizzard
# Version: 3.0b
# Type: Encryptor / Decryptor
# uses DREAM v4.1 or higher
# Date 22.7.2006
# Date v2.0: 25.1.2007
# Date v3.0: 20.8.2007
# Date v3.0b: 24.9.2007
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# This work is protected by the following license:
# #----------------------------------------------------------------------------
# #
# # Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# # ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# #
# # You are free:
# #
# # to Share - to copy, distribute and transmit the work
# # to Remix - to adapt the work
# #
# # Under the following conditions:
# #
# # Attribution. You must attribute the work in the manner specified by the
# # author or licensor (but not in any way that suggests that they endorse you
# # or your use of the work).
# #
# # Noncommercial. You may not use this work for commercial purposes.
# #
# # Share alike. If you alter, transform, or build upon this work, you may
# # distribute the resulting work only under the same or similar license to
# # this one.
# #
# # - For any reuse or distribution, you must make clear to others the license
# # terms of this work. The best way to do this is with a link to this web
# # page.
# #
# # - Any of the above conditions can be waived if you get permission from the
# # copyright holder.
# #
# # - Nothing in this license impairs or restricts the author's moral rights.
# #
# #----------------------------------------------------------------------------
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# DO TOUCH THE VALUE BELOW! If you change the required version to a lower
# value your script WILL malfunction, because older DREAM version don't have
# all the methods and functions required by this script.
Required_DREAM_Version = 4.1
#
#
# Special Thanks to:
#
# - the makers of the XVI32 Hex Editor
# (without it, I couldn't have tested this script)
#
#
# Compatibility:
#
# 98% compatible with SDK 1.x. 90% compatible with SDK 2.x. 99% compatible
# with everything else. WILL corrupt your old savegames. Can cause
# incompatibility issues with custom save screens. NEEDS DREAM of the
# provided version or higher. Files will be saved into dream4 format with
# .dream4 extension. Cannot decode dream2 and dream3 files where extra data
# was added, but normal dream2 and dream3 files can be decoded.
#
#
# Features:
#
# - uses the Double Random Encryption Algorythm Module (DREAM) to encrypt
# important save data every time it is saved
# - makes it harder to hack saved files (even experienced hackers will have a
# hard time hacking important data from save files encrypted with DREAM)
# - great for RMXP MMORPGs as alternative for saving data on the server
#
# new in v2.0:
# - uses DREAM v3.0 which is far more powerful than DREAM v2.0, because the
# .dream3 format is a format in which ALL the saved data is encrypted
# - your savefiles will be saved into files with .dream3 extension
#
# new in v3.0:
# - uses the even more powerful DREAM v4.0
# - faster, better, safer:
# -> new, much faster algorithm which's speed doesn't depend on the chosen
# encryption pattern anymore
# -> re-coded to avoid the built-in RGSS bug with conditioning
# -> new additional encryption of encrypted data
# - your savefiles will be saved now into files with .dream4 extension
# - displays "File corrupted!" instead of crashing when files are corrupted
# - can decode dream2 and dream3 format
#
# new in v3.0b:
# - now uses DREAM v4.1
# - direct implementation into DREAM
# - now beta
#
#
# Configuration:
#
# Open the Scene_Title script and find these lines or similar:
#
# for i in 0..3
# if FileTest.exist?("Save#{i+1}.rxdata")
# @continue_enabled = true
# end
# end
#
# Change this line:
# if FileTest.exist?("Save#{i+1}.rxdata")
# into this one:
# if FileTest.exist?("#{SAVE_NAME}#{i+1}.dream4")
#
# Change SAVE_NAME to the name your savefiles should have. i.e. Making it
# "The Last_Elf" will make your savefiles look like "The Last_Elf.dream4".
#
# Find the part that needs to be configured and add additional data if you
# are using additional savedata. Include all additional data AS STRINGS in
# the array EXTRA_DATA. Example:
#
# EXTRA_DATA = ['$game_weapons', '$game_armors', '$game_items']
#
#
# IMPORTANT NOTES:
#
# This script will encrypt all save data and render them 100% unusable by any
# earlier version of your game that DOES NOT have this script. If you are
# using save-game update of earlier versions, this script will make further
# updates of old savegames IMPOSSIBLE, because they can't be loaded at all.
# Please use a DREAM save file converter to convert usual save files into a
# DREAM readable format. Note that this version of this script can also READ
# save files encrypted in dream2 and dream3 format only if their extension is
# being changed to .dream4 and their names are changed like configured below.
# Note that any extra data from dream2 and dream3 files will not be read.
# This script will save any files into .dream4 format. Changing this script
# can easily destroy your savefiles and it is not recommended.
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

EXTRA_DATA = []
SAVE_NAME = 'Save'

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#==============================================================================
# module DREAM
#==============================================================================

module DREAM

def self.self_extract
data = load_data('Data/DREAM_ext.rb')
file = File.open('DREAM_ext.rb', 'wb')
file.write(data)
file.close
require File.expand_path('DREAM_ext.rb')
load_DREAM
end

end

DREAM.self_extract

#==============================================================================
# Scene_File
#==============================================================================

class Scene_File

def make_filename(file_index)
return "#{SAVE_NAME}#{file_index + 1}.dream4"
end

end

#==============================================================================
# Scene_Save
#==============================================================================

class Scene_Save < Scene_File

def write_save_data(file)
DREAM.save_game(file)
end

end

#==============================================================================
# Scene_Load
#==============================================================================

class Scene_Load < Scene_File

def read_save_data(file)
DREAM.load_game(file)
end

end

#==============================================================================
# Window_SaveFile
#==============================================================================

class Window_SaveFile < Window_Base

def initialize(file_index, filename)
super(0, 64 + file_index%4*104, 640, 104)
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
end
@file_index, @filename = file_index, "#{SAVE_NAME}#{file_index + 1}.dream4"
@time_stamp, @file_exist = Time.at(0), FileTest.exist?(@filename)
if @file_exist
begin
file = File.open(@filename, 'r')
@time_stamp = file.mtime
@characters, @frame_count, @game_system, @game_switches,
@game_variables, @game_party, @game_map, @game_player = DREAM.data(file)
@total_sec = @frame_count / Graphics.frame_rate
file.close
refresh
rescue
@file_exist = false
refresh
self.contents.draw_text(4, 20, 600, 32, 'File corrupted!', 1)
time_string = @time_stamp.strftime('%Y/%m/%d %H:%M')
self.contents.draw_text(4, 40, 600, 32, time_string, 2)
end
else
refresh
end
@selected = false
end

end

Juan's Custom Gameover Script:
#==============================================================================
# ** Juan's Custom Gameover
#------------------------------------------------------------------------------
# Juan
# Version 1.0
# Date 9/1/08
#==============================================================================
#
#
# Compatibility:
#This script should be 100% compatibly with everything except other custom
#gameover scripts.
#
#
# Features:
#
# -> menu commands "Return to title", "Load Game", "End Game"
# -> The load menu is disabled if theres no save files.
#
# Version History
#
# Version 1.0
#-> This script was first made
#
#
#Instructions
#Configure these parts
# # The number of save files starts from 0 not 1 keep that in mine.
# Save_Files_Number = 3
# #The name of your savefiles (usually "Save")
# Save_Name = 'Save'
# #The extension of your savefiles (usually "rxdata")
# Save_Data = 'rxdata'
#
#
#
#FAQ (Frequently Asked Questions):
#None so far
#
#
#Credits
#Juan I made this script.
#Starrodkirby86 for help with positioning.
#
#
#Author's Notes
#Any bugs
#Report them here:
#http://forum.chaos-project.com/index.php?topic=11.0
#or
#Email me
#juanpena119@yahoo.com
#Thats it
#enjoy
#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
# This class performs game over screen processing.
#==============================================================================

class Scene_Gameover
# The number of save files starts from 0 not 1 keep that in mine.
Save_Files_Number = 3
#The name of your savefiles (usually "Save")
Save_Name = 'Save'
#The extension of your savefiles (usually "rxdata")
Save_Data = 'rxdata'
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make command window
s1 = 'Return to title'
s2 = 'Load Game'
s3 = 'End Game'
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.index = @menu_index
#@command_window.x = 200
#@command_window.y = 200
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
@continue = (0..Save_Files_Number).any? {|i|
FileTest.exist?("#{Save_Name}#{i + 1}.#{Save_Data}")}
# If there are no save files disable load.
@command_window.disable_item(2) unless @continue
# Make game over graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
# Stop BGM and BGS
$game_system.bgm_play(nil)
$game_system.bgs_play(nil)
# Play game over ME
$game_system.me_play($data_system.gameover_me)
# Execute transition
Graphics.transition(120)
# Main loop
loop {
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
break if $scene != self
}
# Prepare for transition
Graphics.freeze
# Dispose of game over graphic
@command_window.dispose
@sprite.bitmap.dispose
@sprite.dispose
# Execute transition
Graphics.transition(40)
# Prepare for transition
Graphics.freeze
# If battle test
if $BTEST
$scene = nil
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
# If command window is active: call update_command
if @command_window.active
update_command
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to title screen
$scene = Scene_Title.new
# If C button was pressed
elsif Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0 # Return to title
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_Title.new
when 1 # Load Game
unless @continue
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to load game screen
$scene = Scene_Load.new
when 2 # End Game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to title screen
$scene = nil
end
end
end
end

That's alot of lines XD. Good luck finding the problem =P. Thanks for the jelp though, anybody that decides to do this ^_^.

Also, when I try to use the \name command for Dube's AMS, I get the argument message, only with line 1014 of the AMS, which says this:

super(x-16, y-16, 32 + designate_text.size * 12, 56)
 

Taylor

Sponsor

Wrong number of arguments means you are specifying the calling of something - be it a scene, window, or whatever - and what you specify in the brackets is unequal to the number of values in the thing itself.

Usually these values are in the initialize definition, or the 'super' line. So in the case of Window_BattleResult.new(exp, gold, treasures), you are asking for three arguments - exp, gold and treasures - but the Window doesn't have the definitions that allows you to ask for them - so this is where the zero comes in.

I could be completely wrong mind you. This is just what I've learnt from my own observations. I'm certainly no experienced scripter.
 
If I had to guess the "Window_Base < Window" partway down Dubealex's AMS is breaking the Window_Base class and overwriting its old methods, which might mess up its initialize (hence messing up the "super(x-16, y-16, 32 + designate_text.size * 12, 56)" in a subclass of Window_Base); but I feel like that shouldn't happen, or at least if it did Dubealex would have noticed it before releasing it so I'm not really sure. Those are the only 5 scripts you have right? No others/no editing to the defaults?
 
[rgss]class Window < Window_Base
def initialize
super(0, 0, 64, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
end
end
[/rgss]
This worries me. Did you mean to put something instead of just "Window" there?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top