Hier dreht sich alles um die RPG-Maker-Reihe von ASCII/Enterbrain. Der RPG-Maker ist ein Tool, mit dem du dir dein eigenes kleines Rollenspiel erstellen kannst. Du findest hier alles, was du dazu brauchst. Aber natürlich umfasst die Community noch mehr!
Hallo Leute, ich hatte mein Projekt für ein paar Jahre pausiert, bin aber nun dabei, weiterzumachen und so gut wie von Grund an neu zu starten. Einige Scripte würde ich aber gerne wieder übernehmen, was mich zu meinem Problem führt. Ich benutze zu Zeit das ToS Menü von Vash, welches nach meiner Erinnerung auch funktionierte. Nun habe ich aber das Problem, dass das Spiel einfriert, wenn ich das Menü ein zweites Mal öffne. Ich hoffe, ihr könnt mir dabei helfen. Seltsamerweise tritt das Problem nur in meinem 20x15 großem Debug-Room auf, in nur ein paar NPCs stehen, die aber alle nur Texte verwenden.
hier mal das Script
Code:
#============================================================ # ToS Menu_Compilations # Compilated By: Vash (aka Vash-X) # Released on: Dec. 27, 2005 # Last Updates: Jan. 4, 2006, March 2, 2006 # Recent Updates: April 14, 2006 # Version: 1.3.1 # Credits: Many Sources (Don't remember all) # Cursor Script by squall #============================================================
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Window_Base < Window
def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4) w = width * actor.hp / actor.maxhp hp_color_1 = Color.new(255, 0, 0, 192) hp_color_2 = Color.new(255, 255, 0, 192) self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128)) draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2) x -= 1 y += (height/4).floor self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128)) draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2) x -= 1 y += (height/4).ceil self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128)) draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2) x -= 1 y += (height/4).ceil self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128)) draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2) end
def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4) w = width * actor.sp / actor.maxsp hp_color_1 = Color.new( 0, 0, 255, 192) hp_color_2 = Color.new( 0, 255, 255, 192) self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128)) draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2) x -= 1 y += (height/4).floor self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128)) draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2) x -= 1 y += (height/4).ceil self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128)) draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2) x -= 1 y += (height/4).ceil self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128)) draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2) end
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color) distance = (start_x - end_x).abs + (start_y - end_y).abs if end_color == start_color for i in 1..distance x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i self.contents.fill_rect(x, y, width, width, start_color) end else for i in 1..distance x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i r = start_color.red * (distance-i)/distance + end_color.red * i/distance g = start_color.green * (distance-i)/distance + end_color.green * i/distance b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a)) end
def draw_actor_level(actor, x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 40, 32, " Lv.") self.contents.font.color = normal_color self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2) end
def draw_actor_hp(actor, x, y, width = 144) self.contents.font.color = system_color self.contents.draw_text(x, y, 32, 32, $data_system.words.hp) if width - 32 >= 108 hp_x = x + width - 108 flag = true elsif width - 32 >= 48 hp_x = x + width - 48 flag = false end self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2) if flag self.contents.font.color = normal_color self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1) self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s) end end
def draw_actor_sp(actor, x, y, width = 144) self.contents.font.color = system_color self.contents.draw_text(x, y, 32, 32, $data_system.words.sp) if width - 32 >= 108 sp_x = x + width - 108 flag = true elsif width - 32 >= 48 sp_x = x + width - 48 flag = false end self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2) if flag self.contents.font.color = normal_color self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1) self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s) end end end end end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Sprite_Cursor < Sprite #-------------------------------------------------------------------------- # ● instances #-------------------------------------------------------------------------- attr_accessor :true_x attr_accessor :true_y #-------------------------------------------------------------------------- # ● initialize #-------------------------------------------------------------------------- def initialize(x = 0, y = 0) super() self.x = @true_x = x self.y = @true_y = y self.z = 10000 self.bitmap = RPG::Cache.windowskin("cursor") rescue Bitmap.new(32, 32) end #-------------------------------------------------------------------------- # ● update #-------------------------------------------------------------------------- def update super
if self.y < @true_y n = (@true_y - self.y) / 3 n = 1 if n == 0 self.y += n elsif self.y > @true_y n = (self.y - @true_y) / 3 n = 1 if n == 0 self.y -= n end
if self.x < @true_x n = (@true_x - self.x) / 3 n = 1 if n == 0 self.x += n elsif self.x > @true_x n = (self.x - @true_x) / 3 n = 1 if n == 0 self.x -= n end end end
class Window_Selectable < Window_Base #-------------------------------------------------------------------------- # ● instances #-------------------------------------------------------------------------- attr_reader :index attr_reader :help_window attr_accessor :cursor alias update_cursor_moves update #-------------------------------------------------------------------------- # ● initialize #-------------------------------------------------------------------------- def initialize(x, y, width, height) super(x, y, width, height) @item_max = 1 @column_max = 1 @index = -1 @cursor = Sprite_Cursor.new(x, y) update_cursor end #-------------------------------------------------------------------------- # ● x= #-------------------------------------------------------------------------- def x=(x) super @cursor.x = x if !@cursor.nil? end #-------------------------------------------------------------------------- # ● y= #-------------------------------------------------------------------------- def y=(y) super @cursor.y = y if !@cursor.nil? end #-------------------------------------------------------------------------- # ● visible= #-------------------------------------------------------------------------- def visible=(visible) super if !@cursor.nil? and visible == false @cursor.visible = false end end #-------------------------------------------------------------------------- # ● dispose #-------------------------------------------------------------------------- def dispose @cursor.dispose super end #-------------------------------------------------------------------------- # ● update_cursor_rect #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty return end row = @index / @column_max if row < self.top_row self.top_row = row end if row > self.top_row + (self.page_row_max - 1) self.top_row = row - (self.page_row_max - 1) end cursor_width = self.width / @column_max - 32 x = @index % @column_max * (cursor_width + 32) y = @index / @column_max * 32 - self.oy self.cursor_rect.set(x, y, cursor_width, 32) end #-------------------------------------------------------------------------- # ● update_cursor #-------------------------------------------------------------------------- def update_cursor @cursor.true_x = self.cursor_rect.x + self.x - 8 @cursor.true_y = self.cursor_rect.y + self.y + 16 @cursor.update @cursor.visible = (self.visible and self.index >= 0) end #-------------------------------------------------------------------------- # ● update #-------------------------------------------------------------------------- def update update_cursor_moves update_cursor end end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Game_Party attr_reader :battle_count alias initialize_para_battle_count initialize def initialize initialize_para_battle_count @battle_count = 0 end def increase_battle_count @battle_count = [@battle_count + 1, 9999999].min end end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆ class Scene_Battle
alias start_phase1_para_battle_count start_phase1 def start_phase1 @enemies_count = $game_troop.enemies.size start_phase1_para_battle_count end alias battle_end_para_battle_count battle_end def battle_end(result) case result when 0 $game_party.increase_battle_count when 1 $game_party.increase_battle_count exist_enemy = 0 for enemy in $game_troop.enemies if enemy.exist? exist_enemy += 1 end end @enemies_count = @enemies_count - exist_enemy end battle_end_para_battle_count(result) end end
end def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Window_MenuStatus < Window_Selectable def initialize super(0, 0, 480, 386) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = "Arial" #self.contents.font.size = $fontsize 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 * 93 actor = $game_party.actors[i] draw_actor_graphic(actor, x - 64, y - 0) draw_actor_name(actor, x + 45, y + 0) draw_actor_level(actor, x + 40, y + 45) draw_actor_state(actor, x + 245, y + 45) draw_actor_hp_meter_line(actor, x + 263, y + 9, 116, 8) draw_actor_sp_meter_line(actor, x + 263, y + 37, 116, 8) draw_actor_hp(actor, x + 235, y + - 8) draw_actor_sp(actor, x + 235, y + 20) self.contents.font.color = system_color self.contents.draw_text(x + 225, y + 45, 84, 32, "Nächster:") self.contents.font.color = normal_color self.contents.draw_text(x + 360, y + 45, 84, 32, actor.next_exp_s) end end def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(5, @index * 90, 32, 32) end end end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Window_MenuCommand < Window_Selectable #-------------------------------------------------------------------------- def initialize(commands) col_max = 4 super(0, 0, 640, (commands.size / col_max + 2) * 21.5 + 32) @column_max = col_max @item_max = commands.size @commands = commands self.contents = Bitmap.new(width - 32, height - 32) refresh self.index = 0 end #-------------------------------------------------------------------------- def refresh(commands = nil) @commands = commands if commands != nil self.contents.font.name = "Arial" #self.contents.font.size = $fontsize self.contents.clear for i in 0...@item_max draw_item(i, normal_color) end end #-------------------------------------------------------------------------- def draw_item(index, color) self.contents.font.color = color rect = Rect.new((index % @column_max) * ((width - 32) / @column_max), index / @column_max * 32, (width - 32) / @column_max, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index], 1) end #-------------------------------------------------------------------------- def disable_item(index) draw_item(index, disabled_color) end #-------------------------------------------------------------------------- def update_cursor_rect if @index < 0 self.cursor_rect.empty return end row = @index / @column_max if row < self.top_row self.top_row = row end if row > self.top_row + (self.page_row_max - 1) self.top_row = row - (self.page_row_max - 1) end cursor_width = (self.width - 55) / @column_max x = @index % @column_max * (cursor_width + 3) y = @index / @column_max * 32 - self.oy self.cursor_rect.set(x, y, 32, 32) end end
end def update @command_window.update @info_window.update @status_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 # Item $game_system.se_play($data_system.decision_se) $scene = Scene_Item.new when 1 # Skill $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 # Equip $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 when 3 # Status $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.index = 0 when 4 # Party Changer $game_system.se_play($data_system.decision_se) @checker = 0 @command_window.active = false @status_window.active = true @status_window.index = 0 when 5 # Save 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 6 # End $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) when 4 $game_system.se_play($data_system.decision_se) if @checker == 0 @changer = $game_party.actors[@status_window.index] @where = @status_window.index @checker = 1 else $game_party.actors[@where] = $game_party.actors[@status_window.index] $game_party.actors[@status_window.index] = @changer @checker = 0 @status_window.refresh end end return end end end
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.