PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Hilfe bei 2. Scripts!



Funky
11.03.2008, 22:16
Guten Abend,

ich habe ein Problem bei meinem Spiel, ich habe 2 Scripts eingefügt, einmal ein
Skill-Book sowie ein AUfzähler der EXP nach einem Kampf!

Beide Scripts funktionieren wunderbar, nur wird der Text nicht angezeigt, habe dafür 2 Bilder gemacht

Einmal das Skillbook:
(WIe man sieht, wird keine Fertigkeit angezeigt, obwohl erstellt!

http://pics.foruni.de/save/p_1205269833.PNG

Einmal der Aufzähler nach einem Kampf:
( Bilder und EXP Bild wird angezeigt TEXT aber nicht )

http://pics.foruni.de/save/p_1205270033.PNG

Hier sind die SCripts:

Skill-Book


fontface = "Arial"
# Change the $fontsize variable to change the font size
$fontsize = 24
module Skill_Book_Config
SHOW_COMPLETE_TYPE = 3 #図鑑完æˆçŽ‡ã®è¡¨ç¤ºæ–¹æ³•
#0:表示ãªã— 1:ç¾åœ¨æ•°/最大数 2:%表示 3:両方
DRAW_POW_ZERO = false #å¨åŠ›0ã®ã¨ããã®ã¾ã¾è¡¨ç¤ºã™ã‚‹ã‹ã©ã†ã‹
#true:ã™ã‚‹ false:ã—ãªã„
ZERO_POW_TEXT = "Arial" #å¨åŠ›0ã®æ™‚表示ã—ãªã„å ´åˆã®ä»£ã‚ã‚Šã«è¡¨ç¤ºã™ã‚‹è¨€è‘‰
end

class Window_SkillBook_Info < Window_Selectable
include Skill_Book_Config
end

class Data_SkillBook
attr_reader :skill_kind_name
attr_reader :kind_row
attr_reader :skill_id_data
attr_reader :skill_kind_element_name
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize

# ↓以下ã€è¨•å®šç”¨ã®ã„ã‚ã„ã‚
@skill_kind_name = ["Angriff", "Verteidigung", "Heilen"]
@kind_row = ["Angriff",
"Verteidigung",
"Heilen"]
@skill_kind_element_name = ["Angriff", "Verteidigung", "Heilen"]
# ↑ココã¾ã§

@skill_id_data = skill_book_id_set
end
#--------------------------------------------------------------------------
# ◠指定ã•ã‚ŒãŸç¨®é¡žè¡¨ç¤ºåã®æƒ…å ±ã‚’è¿”ã™
#--------------------------------------------------------------------------
def kind_search(name)
if @skill_kind_name.include?(name)
return [0, @skill_kind_name.index(name)]
end
end
#--------------------------------------------------------------------------
# ◠図鑑用登録無視属性å–å¾—
#--------------------------------------------------------------------------
def no_add_element
no_add = 0
# 登録無視ã®å±žæ€§IDã‚’å–å¾—
for i in 1...$data_system.elements.size
if $data_system.elements[i] =~ /図鑑登録無効/
no_add = i
break
end
end
return no_add
end

#--------------------------------------------------------------------------
# ◠指定ã•ã‚ŒãŸå±žæ€§åã®IDã‚’è¿”ã™
#--------------------------------------------------------------------------
def element_search(element_name)
return nil if element_name == nil
for i in 1...$data_system.elements.size
if $data_system.elements[i] =~ /^#{element_name}/
return i
end
end
end

#--------------------------------------------------------------------------
# ◠図鑑用スゕルID訕定
#--------------------------------------------------------------------------
def skill_book_id_set
data = []
no_add = no_add_element
if @skill_kind_element_name.size == 0
data[0] = [0]
for i in 1...$data_skills.size
skill = $data_skills[i]
next if skill.name == ""
next if skill.element_set.include?(no_add)
data[0].push(skill.id)
end
else
for i in 0...@skill_kind_element_name.size
data[i] = [0]
element_id = element_search(@skill_kind_element_name[i])
for j in 1...$data_skills.size
skill = $data_skills[j]
next if skill.name == ""
next if skill.element_set.include?(no_add)
if skill.element_set.include?(element_id)
data[i].push(skill.id)
end
end
end
end
return data
end
end

class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ◠スゕルを覚ãˆã‚‹
# skill_id : スゕル ID
#--------------------------------------------------------------------------
alias game_actor_skill_book_learn_skill learn_skill
def learn_skill(skill_id)
game_actor_skill_book_learn_skill(skill_id)
$game_system.add_skill_count(skill_id)
end
end

class Window_Base < Window
#--------------------------------------------------------------------------
# ◠基本属性表示
#--------------------------------------------------------------------------
def draw_attack_element(x, y, element_set)
elem_temp = []
for i in element_set
elem = $data_system.elements[i]
elem_temp.push("Feuer") if elem == "Feuer"
elem_temp.push("Eis") if elem == "Eis"
elem_temp.push("Blitz") if elem == "Blitz"
elem_temp.push("Wasser") if elem == "Wasser"
elem_temp.push("Erde") if elem == "Erde"
elem_temp.push("Wind") if elem == "Wind"
elem_temp.push("Licht") if elem == "Licht"
elem_temp.push("Dunkel") if elem == "Dunkel"
end
if elem_temp.size == 0
self.contents.draw_text(x, y, 64, 32, "Nichts")
return
end
ox = 0
for name in elem_temp
cx = self.contents.text_size(name).width
self.contents.draw_text(x+ox, y, cx, 32, name)
ox += cx+8
end
end
#--------------------------------------------------------------------------
# ◠敦器属性表示
#--------------------------------------------------------------------------
def draw_attack_wp_element(x, y, element_set)
elem_temp = []
for i in element_set
elem = $data_system.elements[i]
elem_temp.push("Feuer") if elem == "Feuer"
elem_temp.push("Eis") if elem == "Eis"
elem_temp.push("Blitz") if elem == "Blitz"
elem_temp.push("Wasser") if elem == "Wasser"
elem_temp.push("Erde") if elem == "Erde"
end
if elem_temp.size == 0
self.contents.draw_text(x, y, 64, 32, "Nichts")
return
end
ox = 0
for name in elem_temp
cx = self.contents.text_size(name).width
self.contents.draw_text(x+ox, y, cx, 32, name)
ox += cx+8
end
end
#--------------------------------------------------------------------------
# ◠特攻属性表示
#--------------------------------------------------------------------------
def draw_attack_weak_element(x, y, element_set)
elem_temp = []
for i in element_set
elem = $data_system.elements[i]
elem_temp.push("Untot") if elem == "Untot"
elem_temp.push("Reptil") if elem == "Reptil"
elem_temp.push("Aqua") if elem == "Aqua"
elem_temp.push("Bestie") if elem == "Bestie"
elem_temp.push("Ork") if elem == "Ork"
elem_temp.push("Avian") if elem == "Avian"
elem_temp.push("Dämon") if elem == "Dämon"
elem_temp.push("Engel") if elem == "Engel"
end
if elem_temp.size == 0
self.contents.draw_text(x, y, 64, 32, "Nichts")
return
end
ox = 0
for name in elem_temp
cx = self.contents.text_size(name).width
self.contents.draw_text(x+ox, y, cx, 32, name)
ox += cx+8
end
end
#--------------------------------------------------------------------------
# ◠ステート付与表示
#--------------------------------------------------------------------------
def draw_attack_add_state(x, y, plus_state_set)
state_temp = []
for i in plus_state_set
state = $data_states[i]
state_temp.push(state.name) if state.name != ""
end
if state_temp.size == 0
self.contents.draw_text(x, y, 64, 32, "Nichts")
return
end
ox = 0
oy = 0
for name in state_temp
cx = self.contents.text_size(name).width
if ox + cx + 4 >= self.contents.width - 128
ox = 0
oy += 1
end
self.contents.draw_text(x+ox, y+oy*32, cx, 32, name)
ox += cx+8
end
end
#--------------------------------------------------------------------------
# ◠効果範囲を返ã™
#--------------------------------------------------------------------------
def draw_scope(scope)
case scope
when 0
return "kein"
when 1
return "1 Gegner"
when 2
return "Alle Gegner"
when 3
return "1 Teammitglied"
when 4
return "Alle Teammitglieder"
when 5
return "1 totes Mitglied"
when 6
return "Alle toten Mitglieder"
when 7
return "Zauberer"
end
end
end

class Game_Temp
attr_accessor :skill_book_data
alias temp_skill_book_data_initialize initialize
def initialize
temp_skill_book_data_initialize
@skill_book_data = Data_SkillBook.new
end
end

class Game_System
attr_accessor :skill_count # å…¥æ‰‹ã‚¹ã‚•ãƒ«æƒ…å ±(図鑑用)
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias game_system_skill_book_initialize initialize
def initialize
game_system_skill_book_initialize
@skill_count = {}
end
#--------------------------------------------------------------------------
# ◠スゕルã®ç²å¾—æƒ…å ±ã®è¿½åŠ (図鑑用)
# 0:ç„¡ç²å¾— 1:ç²å¾—済
#--------------------------------------------------------------------------
def add_skill_count(skill_id, type=0)
if type == -1
@skill_count[skill_id] = 0
else
@skill_count[skill_id] = 1
end
end
#--------------------------------------------------------------------------
# ◠スゕル図鑑ã®æœ€å¤§ç™»éŒ²æ•°ã‚’å–å¾—
#--------------------------------------------------------------------------
def skill_book_max
kind_data = $game_temp.skill_book_data.skill_kind_name
size = 0
for kind in kind_data
size += skill_book_category_max(kind)
end
return size
end
#--------------------------------------------------------------------------
# ◠スゕル図鑑ã®ç¾åœ¨ç™»éŒ²æ•°ã‚’å–å¾—
#--------------------------------------------------------------------------
def skill_book_now
kind_data = $game_temp.skill_book_data.skill_kind_name
size = 0
for kind in kind_data
size += skill_book_category_now(kind)
end
return size
end
#--------------------------------------------------------------------------
# ◠スゕル図鑑ã®å®ŒæˆçŽ‡ã‚’å–å¾—
#--------------------------------------------------------------------------
def skill_book_complete_percentage
s_max = skill_book_max.to_f
s_now = skill_book_now.to_f
comp = s_now / s_max * 100
return comp.truncate
end
end
#--------------------------------------------------------------------------
# ◠スゕル図鑑ã®ã‚«ãƒ†ã‚´ãƒªãƒ¼åˆ¥æœ€å¤§ç™»éŒ²æ•°ã‚’å–å¾—
# category:カテゴリーå
#--------------------------------------------------------------------------
def skill_book_category_max(category)
id_data = $game_temp.skill_book_data.skill_id_data.dup
index = $game_temp.skill_book_data.kind_search(category)[1]
size = id_data[index].size - 1
return size
end
#--------------------------------------------------------------------------
# ◠スゕル図鑑ã®ã‚«ãƒ†ã‚´ãƒªãƒ¼åˆ¥ç¾åœ¨ç™»éŒ²æ•°ã‚’å–å¾—
# category:カテゴリーå
#--------------------------------------------------------------------------
def skill_book_category_now(category)
now_skill_info = @skill_count.keys
index = $game_temp.skill_book_data.kind_search(category)[1]
# 登録無視ã®å±žæ€§IDã‚’å–å¾—
no_add = $game_temp.skill_book_data.no_add_element
elename = $game_temp.skill_book_data.skill_kind_element_name[index]
element_id = $game_temp.skill_book_data.element_search(elename)
new_skill_info = []
for i in now_skill_info
skill = $data_skills[i]
next if skill == nil
next if skill.name == ""
next if skill.element_set.include?(no_add)
if element_id == nil or skill.element_set.include?(element_id)
new_skill_info.push(skill.id)
end
end
return new_skill_info.size
end
#--------------------------------------------------------------------------
# ◠スゕル図鑑ã®ã‚«ãƒ†ã‚´ãƒªãƒ¼åˆ¥å®ŒæˆçŽ‡ã‚’å–å¾—
# category:カテゴリーå
#--------------------------------------------------------------------------
def skill_book_category_complete_percentage(category)
s_max = skill_book_category_max(category).to_f
s_now = skill_book_category_now(category).to_f
comp = s_now / s_max * 100
return comp.truncate
end


class Interpreter
def skill_book_max(category=nil)
if category == nil
return $game_system.skill_book_max
else
return $game_system.skill_book_category_max(category)
end
end
def skill_book_now(category=nil)
if category == nil
return $game_system.skill_book_now
else
return $game_system.skill_book_category_now(category)
end
end
def skill_book_comp(category=nil)
if category == nil
return $game_system.skill_book_complete_percentage
else
return $game_system.skill_book_category_complete_percentage(category)
end
end
end

class Window_SkillBook < Window_Selectable
attr_reader :data
attr_reader :item_kind
attr_reader :item_index
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize(index=0)
super(0, 64, 640, 416)
@column_max = 2
@book_data = $game_temp.skill_book_data
@data = data_set(index)
@data.shift
#@data.sort!
@item_max = @data.size
@item_kind = index
self.index = 0
#refresh
end
def new_data_set(index)
@data = data_set(index)
@data.shift
#@data.sort!
@item_max = @data.size
end
#--------------------------------------------------------------------------
# ◠入手データをå–å¾—
#--------------------------------------------------------------------------
def data_set(index)
kind_row_data = @book_data.kind_search(@book_data.kind_row[index])
@item_kind = kind_row_data[0]
@item_index = kind_row_data[1]
data = []
case @item_kind
when 0
data = @book_data.skill_id_data[@item_index].dup
end
return data
end
#--------------------------------------------------------------------------
# ◠表示許å¯å–å¾—
#--------------------------------------------------------------------------
def show?(kind, id)
case kind
when 0
if $game_system.skill_count[id] == 0 or $game_system.skill_count[id] == nil
return false
else
return true
end
end
end
#--------------------------------------------------------------------------
# ◠アイテムå–å¾—
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
#é …ç›®æ•°ãŒ 0 ã§ãªã‘ã‚Œã°ãƒ“ットマップを作æˆã—ã€å…¨é …目をæç”»
return if @item_max == 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# â— é …ç›®ã®æç”»
# index : é …ç›®ç•ªå·
#--------------------------------------------------------------------------
def draw_item(index)
case @item_kind
when 0
item = $data_skills[@data[index]]
id = @book_data.skill_id_data[@item_index].index(item.id)
end
return if item == nil
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 32, 32, id.to_s)
if show?(@item_kind, item.id)
bitmap = RPG::Cache.icon(item.icon_name)
opacity = 255
self.contents.blt(x+48, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x+48 + 28, y, 212, 32, item.name, 0)
else
self.contents.draw_text(x+48 + 28, y, 212, 32, "Arial", 0)
return
end
end
end

class Window_SkillBook_Info < Window_Selectable
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 0+64+64, 640, 480-64-64)
@book_data = $game_temp.skill_book_data
self.contents = Bitmap.new(width - 32, height - 32)
self.index = -1
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh(item_id, item_kind, item_index)
self.contents.clear
self.contents.font.size = 22
case item_kind
when 0
draw_skill_info(item_id, item_index)
end
end
#--------------------------------------------------------------------------
# ◠スゕルæç”»
#--------------------------------------------------------------------------
def draw_skill_info(item_id, item_index)
item = $data_skills[item_id]
rect = Rect.new(4, 0, 160, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = 255
self.contents.blt(4+48, 0 + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.font.color = normal_color
id = @book_data.skill_id_data[item_index].index(item.id)
self.contents.draw_text(4, 0, 32, 32, id.to_s)
self.contents.draw_text(4+48 + 28, 0, 212, 32, item.name, 0)

cost = item.sp_cost.to_s
self.contents.draw_text(4+48 + 28 + 232, 0, 48, 32, cost.to_s, 2)

#skill_kind = skill_kind_name(item.element_set)
#self.contents.draw_text(320+96, 0, 160, 32, skill_kind, 0)
self.contents.font.color = text_color(2)
self.contents.draw_text(4, 32, 48, 32, "Effekt-Rate", 0)
self.contents.font.color = normal_color
if item.power == 0 and DRAW_POW_ZERO == false
pow = ZERO_POW_TEXT
else
pow = item.power.to_s
end
self.contents.draw_text(4+48, 32, 48, 32, pow, 2)

self.contents.font.color = system_color
self.contents.draw_text(4, 64, 48, 32, "Radius", 0)
self.contents.font.color = normal_color
self.contents.draw_text(4+96+16, 64, 128, 32, draw_scope(item.scope), 0)

self.contents.font.color = system_color
self.contents.draw_text(4, 96, 96, 32, "Element:")
self.contents.draw_text(4, 128, 96, 32, "Gut gegen:")
self.contents.draw_text(4, 160, 96, 32, "Verursacht:")
self.contents.font.color = normal_color
draw_attack_element(4+96+16, 96, item.element_set)
draw_attack_weak_element(4+96+16, 128, item.element_set)
draw_attack_add_state(4+96+16, 160, item.plus_state_set)

@help_window.set_text(item.description)
end
#--------------------------------------------------------------------------
# ◠ヘルプテゕスト更新
#--------------------------------------------------------------------------
def update_help
#ダミー
end
end


class Scene_SkillBook
include Skill_Book_Config
#--------------------------------------------------------------------------
# ◠メイン処ç†
#--------------------------------------------------------------------------
def main
# ウィンドウを作æˆ
@title_window = Window_Base.new(0, 0, 640, 64)
@title_window.contents = Bitmap.new(640 - 32, 64 - 32)
@title_window.contents.draw_text(4, 0, 320, 32, "537", 0)
draw_comp
@main_window = Window_SkillBook.new
@main_window.active = false
@main_window.index = -1
@help_window = Window_Help.new
@help_window.z = 110
@help_window.y = 64
@help_window.visible = false
command = $game_temp.skill_book_data.kind_row
@kind_window = Window_Command.new(160, command)
@kind_window.z = 110
@kind_window.x = 320 - @kind_window.width / 2
@kind_window.y = 240 - @kind_window.height / 2
@kind_window.active = true
# ã‚¤ãƒ³ãƒ•ã‚©ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’ä½œæˆ (ä¸å¯è¦–・éžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã«è¨•å®š)
@info_window = Window_SkillBook_Info.new
@info_window.z = 110
@info_window.visible = false
@info_window.active = false
# ヘルプウィンドウを関連付ã‘
@info_window.help_window = @help_window
@visible_index = 0
@now_kind = nil
# トランジション実行
Graphics.transition
# メインループ
loop do
# ゲーム画é¢ã‚’æ›´æ–°
Graphics.update
# å…¥åŠ›æƒ…å ±ã‚’æ›´æ–°
Input.update
# フレーム更新
update
# ç”»é¢ãŒåˆ‡ã‚Šæ›¿ã‚ã£ãŸã‚‰ãƒ«ãƒ¼ãƒ—を丕斕
if $scene != self
break
end
end
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@title_window.dispose
@help_window.dispose
@main_window.dispose
@kind_window.dispose
@info_window.dispose
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
# ウィンドウを更新
#@help_window.update
@main_window.update
@kind_window.update
@info_window.update
if @info_window.active
update_info
return
end
# メインウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_target を呼ã¶
if @main_window.active
update_main
return
end
# 種類ウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_kind を呼ã¶
if @kind_window.active
update_kind
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (種類ウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_kind
# C ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::C)
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
if @now_kind != @kind_window.index
@main_window.new_data_set(@kind_window.index)
@main_window.refresh
@now_kind = @kind_window.index
end
subtitle = $game_temp.skill_book_data.kind_row[@kind_window.index]
title = "Skill "+subtitle
@title_window.contents.clear
@title_window.contents = Bitmap.new(640 - 32, 64 - 32)
@title_window.contents.draw_text(4, 0, 320, 32, title, 0)
draw_comp(subtitle)
@kind_window.active = false
@kind_window.visible = false
@main_window.active = true
@main_window.index = 0
return
end
# B ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::B)
# ゕャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_main
# B ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::B)
# ゕャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
@main_window.active = false
@kind_window.active = true
@kind_window.visible = true
@main_window.index = -1
@title_window.contents.clear
@title_window.contents = Bitmap.new(640 - 32, 64 - 32)
@title_window.contents.draw_text(4, 0, 320, 32, "681", 0)
draw_comp
return
end
# C ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::C)
if @main_window.item == nil or
@main_window.show?(@main_window.item_kind, @main_window.item) == false
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
@main_window.active = false
@info_window.active = true
@info_window.visible = true
@visible_index = @main_window.index
@info_window.refresh(@main_window.item, @main_window.item_kind, @main_window.item_index)
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (インフォウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_info
# B ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::B)
# ゕャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
@main_window.active = true
@info_window.active = false
@info_window.visible = false
@help_window.visible = false
return
end
# C ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::C)
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
return
end
if Input.trigger?(Input::L)
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
loop_end = false
while loop_end == false
if @visible_index != 0
@visible_index -= 1
else
@visible_index = @main_window.data.size - 1
end
loop_end = true if @main_window.show?(@main_window.item_kind,@main_window.data[@visible_index])
end
id = @main_window.data[@visible_index]
@info_window.refresh(id, @main_window.item_kind, @main_window.item_index)
return
end
if Input.trigger?(Input::R)
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
loop_end = false
while loop_end == false
if @visible_index != @main_window.data.size - 1
@visible_index += 1
else
@visible_index = 0
end
loop_end = true if @main_window.show?(@main_window.item_kind,@main_window.data[@visible_index])
end
id = @main_window.data[@visible_index]
@info_window.refresh(id, @main_window.item_kind, @main_window.item_index)
return
end
end
def draw_comp(category=nil)
if SHOW_COMPLETE_TYPE != 0
if category == nil
case SHOW_COMPLETE_TYPE
when 1
s_now = $game_system.skill_book_now
s_max = $game_system.skill_book_max
text = s_now.to_s + "/" + s_max.to_s
when 2
comp = $game_system.skill_book_complete_percentage
text = comp.to_s + "%"
when 3
s_now = $game_system.skill_book_now
s_max = $game_system.skill_book_max
comp = $game_system.skill_book_complete_percentage
text = s_now.to_s + "/" + s_max.to_s + " " + comp.to_s + "%"
end
else
case SHOW_COMPLETE_TYPE
when 1
s_now = $game_system.skill_book_category_now(category)
s_max = $game_system.skill_book_category_max(category)
text = s_now.to_s + "/" + s_max.to_s
when 2
comp = $game_system.skill_book_category_complete_percentage(category)
text = comp.to_s + "%"
when 3
s_now = $game_system.skill_book_category_now(category)
s_max = $game_system.skill_book_category_max(category)
comp = $game_system.skill_book_category_complete_percentage(category)
text = s_now.to_s + "/" + s_max.to_s + " " + comp.to_s + "%"
end
end
if text != nil
@title_window.contents.draw_text(320, 0, 288, 32, text, 2)
end
end
end
end

Und hier der Zähler:


class Game_Actor < Game_Battler
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1

# NEW - David
$d_new_skill = nil

for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)

# NEW - David
skill = $data_skills[j.skill_id]
$d_new_skill = skill.name

end
end
end
while @exp < @exp_list[@level]
@level -= 1
end
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end

#--------------------------------------------------------------------------
# * Get the current EXP
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Get the next level's EXP
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end

end

class Window_LevelUp < Window_Base

#----------------------------------------------------------------
def initialize(actor, pos)
#change this to false to show the actor's graphic
@face = false
@actor = actor
y = (pos * 120)
super(280, y, 360, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 255
if $d_dum == false
refresh
end
end

#----------------------------------------------------------------
def dispose
super
end

#----------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.size = 18
if @face == true
draw_actor_face(@actor, 4, 0)
else
draw_actor_graphic(@actor, 50, 80)
end
draw_actor_name(@actor, 111, 0)
draw_actor_level(@actor, 186, 0)
show_next_exp = @actor.level == 99 ? "---" : "#{@actor.next_exp}"
min_bar = @actor.level == 99 ? 1 : @actor.now_exp
max_bar = @actor.level == 99 ? 1 : @actor.next_exp
draw_slant_bar(115, 80, min_bar, max_bar, 190, 6, bar_color = Color.new(0, 100, 0, 255), end_color = Color.new(0, 255, 0, 255))
self.contents.draw_text(115, 24, 300, 32, "Exp:#{@actor.now_exp}")
self.contents.draw_text(115, 48, 300, 32, "Level Up:" + show_next_exp)
end


#----------------------------------------------------------------
def level_up
self.contents.font.color = system_color
self.contents.draw_text(230, 48, 80, 32, "LEVEL UP!")
end

#----------------------------------------------------------------
def update
super
end

end # of Window_LevelUp

#=================================
#Window_EXP
# Written by: David Schooley
#=================================

class Window_EXP < Window_Base

#----------------------------------------------------------------
def initialize(exp)
super(0, 0, 280, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 255
refresh(exp)
end

#----------------------------------------------------------------
def dispose
super
end

#----------------------------------------------------------------
def refresh(exp)
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 150, 32, "Exp Earned:")
self.contents.font.color = normal_color
self.contents.draw_text(180, 0, 54, 32, exp.to_s, 2)
end

#----------------------------------------------------------------
def update
super
end

end # of Window_EXP

#=================================
#Window_Money_Items
# Written by: David Schooley
#=================================

class Window_Money_Items < Window_Base

#----------------------------------------------------------------
def initialize(money, treasures)
@treasures = treasures
super(0, 60, 280, 420)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 255
refresh(money)
end

#----------------------------------------------------------------
def dispose
super
end

#----------------------------------------------------------------
def refresh(money)
@money = money
self.contents.clear

self.contents.font.color = system_color
self.contents.draw_text(4, 4, 100, 32, "Items Found:")
self.contents.font.color = normal_color

y = 32
for item in @treasures
draw_item_name(item, 4, y)
y += 32
end

cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 340, 220-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = normal_color
self.contents.draw_text(4, 300, 220-cx-2, 32, "+ " + @money.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 340, cx + 100, 32, $data_system.words.gold, 2)
end

def update
super
end

end # of Window_Money_Items


class Scene_Battle
alias raz_battle_report_main main
alias raz_battle_report_be battle_end

def main
# NEW - David
#$battle_end = false
@lvup_window = []
@show_dummies = true # Show dummy windows or not?
raz_battle_report_main
# NEW - David
@lvup_window = nil
@level_up = nil
@ch_stats = nil
@ch_compare_stats = nil
end

def battle_end(result)
raz_battle_report_be(result)
# NEW - David
@status_window.visible = false
@spriteset.dispose
Graphics.transition
if result == 0
display_lv_up(@exp, @gold, @treasures)
loop do
Graphics.update
Input.update
if Input.trigger?(Input::C)
break
end
end
trash_lv_up
end

end

def start_phase5
@phase = 5
$game_system.me_play($game_system.battle_end_me)
$game_system.bgm_play($game_temp.map_bgm)
exp = 0
gold = 0
treasures = []
for enemy in $game_troop.enemies
unless enemy.hidden
exp += enemy.exp
gold += enemy.gold
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
end
end
treasures = treasures[0..5]

# NEW - David
@treasures = treasures
@exp = exp
@gold = gold


for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
@phase5_wait_count = 10
end

def update_phase5
if @phase5_wait_count > 0
@phase5_wait_count -= 1
if @phase5_wait_count == 0

# NEW - David
$game_temp.battle_main_phase = false
end
return
end

# NEW - David
battle_end(0)

end

def display_lv_up(exp, gold, treasures)

$d_dum = false
d_extra = 0
i = 0
for actor in $game_party.actors
# Fill up the Lv up windows
@lvup_window[i] = Window_LevelUp.new($game_party.actors[i], i)
i += 1
end

# Make Dummies
if @show_dummies == true
$d_dum = true
for m in i..3
@lvup_window[m] = Window_LevelUp.new(m, m)
end
end

@exp_window = Window_EXP.new(exp)
@m_i_window = Window_Money_Items.new(gold, treasures)
@press_enter = nil
gainedexp = exp
@level_up = [0, 0, 0, 0]
@d_new_skill = ["", "", "", ""]
@d_breakout = false
@m_i_window.refresh(gold)
wait_for_OK

@d_remember = $game_system.bgs_memorize
Audio.bgs_play("Audio/SE/032-Switch01", 100, 300)

# NEW - David
max_exp = exp
value = 28
if exp < value
value = exp
end
if value == 0
value = 1
end
for n in 0..gainedexp - (max_exp / value)
exp -= (max_exp / value)
if @d_breakout == false
Input.update
end

for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += (max_exp / value)
# Fill up the Lv up windows
if @d_breakout == false
@lvup_window[i].refresh
@exp_window.refresh(exp)
end

if actor.level > last_level
@level_up[i] = 5
Audio.se_play("Audio/SE/056-Right02.ogg", 70, 150)
if $d_new_skill
@d_new_skill[i] = $d_new_skill
end
end

if @level_up[i] == 0
@d_new_skill[i] = ""
end

if @level_up[i] > 0
@lvup_window[i].level_up
end

if Input.trigger?(Input::C) or exp <= 0
@d_breakout = true
end
end

if @d_breakout == false
if @level_up[i] >0
@level_up[i] -= 1
end
Graphics.update
end
end

if @d_breakout == true
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false
actor.exp += exp
end
end
exp = 0
break
end
end
Audio.bgs_stop
@d_remember = $game_system.bgs_restore

for i in 0...$game_party.actors.size
@lvup_window[i].refresh
end
@exp_window.refresh(exp)
Audio.se_play("Audio/SE/006-System06.ogg", 70, 150)
$game_party.gain_gold(gold)
@m_i_window.refresh(0)
Graphics.update
end

def trash_lv_up
# NEW - David
i=0

for i in 0 ... 4
@lvup_window[i].visible = false
end
@exp_window.visible = false
@m_i_window.visible = false
@lvup_window = nil
@exp_window = nil
@m_i_window = nil
end

# Wait until OK key is pressed
def wait_for_OK
loop do
Input.update
Graphics.update
if Input.trigger?(Input::C)
break
end
end
end

end

class Window_Base < Window
def draw_actor_face(actor, x, y)
bitmap = RPG::Cache.picture("Faces/" + actor.character_name)
self.contents.blt(x, y, bitmap, Rect.new(0,0,96,96))
end

#--------------------------------------------------------------------------
# * Draw Slant Bar(by SephirothSpawn)
#--------------------------------------------------------------------------
def draw_slant_bar(x, y, min, max, width = 152, height = 6,
bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
# Draw Border
for i in 0..height
self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
end
# Draw Background
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
end
# Draws Bar
for i in 1..( (min / max.to_f) * width - 1)
for j in 1..(height - 1)
r = bar_color.red * (width - i) / width + end_color.red * i / width
g = bar_color.green * (width - i) / width + end_color.green * i / width
b = bar_color.blue * (width - i) / width + end_color.blue * i / width
a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
end
end
end

end

Bitte um Hilfe!

mFg Funky

Der echte ERZENGEL
11.03.2008, 22:55
$defaultfontype = $fontface = Font.default_name = "Arial"
$defaultfontsize = $fontsize = Font.default_size = 24Wird meistens in Main über begin eingesetzt.

Funky
12.03.2008, 13:03
$defaultfontype = $fontface = Font.default_name = "Arial"
$defaultfontsize = $fontsize = Font.default_size = 24Wird meistens in Main über begin eingesetzt.

Ja die Schfrift wird doch angezeigt, im Titel und Menü überall ausser bei den 2. Scripts !
Deswegen die Frage, was an den Codes falsch liegen könnte, vllt. Font vergessen irgendetwas, deswegen brauch ich ja die Hilfe =]