Я что-то не могу найти тему про косяки в скриптах, поэтому напишу сюда.
Есть у меня скрипт, который вывешивает над эвентами любой текст. Проблема в том, что при открытии диалогового окна любой прозрачности этот текст все равно висит, перекрывая написанное в диалоговом окне.
Пример:
Мне нужно это исправить - текст должен пропадать, затемняться, whatever.
Код скрипта:
Код:#============================================================================== # ** Event Text Display v2 #============================================================================== # Author: Áص¹ (RGSS) # Edited by Death10 (RGSS3) # Edited by Emerald (v2) # # http://itbinhdan.com #------------------------------------------------------------------------------ # Instructions #------------------------------------------------------------------------------ # Create a new comment in an event with one of the following tags: # <ETD> - Upper line of text. # <NN> - Lower line of text. # <ETDB> - Background file. # Note that EVERYTHING in the comment is used for the text/filename if one of # the tags is present. # # Instructions for module ETD are above every constant. # In the text, the following stuff have a function: # # \\ - Becomes a singe '\'. # \V[x] - Becomes the value of variable with ID x. # \N[x] - Becomes the name of actor x. # \P[x] - Becomes the name of party member x. # \G - Displays current amount of gold. # \C[x] - Changes the font color to color x. Use -1 for STANDARD_COLOR. # # Actors and followers only: # \HP - Becomes own HP. # \MHP - Becomes own Max HP. # \MP - Becomes own MP. # \MMP - Becomes own max MP. # \L - Becomes own Level. #============================================================================ # # CONFIGURATION # #============================================================================ module ETD # An array containing fonts. If one the left one doesn't exist, the one to the # right will be used instead. Leave nil for the system fonts. STANDARD_FONT = nil # Red, Blue, Green, Opacity. Use \c[-1] for standard color. STANDARD_COLOR = Color.new(255,255,255,255) # Standard max distance for the name box to appear. Doesn't apply for the player # and followers. VIEW_DISTANCE = 6 # Text to display above actors. # actor_id => ["line_1", "line_2", "background filename"] # actor_id 0 is used for actors which IDs aren't present in the list. # If it's not the last entry to the list, add a comma after the ']'. ACTOR_TEXT = { 0 => ["", "", ""] } # Text to display above actors. # actor_id => ["line_1", "line_2", "background filename"] # actor_id 0 is used for actors which IDs aren't present in the list. # If it's not the last entry to the list, add a comma after the ']'. FOLLOWER_TEXT = { 0 => ["I'm a followah!", "", ""] } # Text to display above actors. # vehicle_type => ["line_1", "line_2", "background filename"] # vehicle type :all is used for vehicles which types aren't in the list. # If it's not the last entry to the list, add a comma after the ']'. VEHICLE_TEXT = { :all => ["", "", ""], :boat => ["", "", ""], :ship => ["", "", ""], :airship => ["", "", ""] } end #============================================================================== # Game_Vehicle #============================================================================== class Game_Vehicle attr_reader :type end #============================================================================== # Sprite_Character #============================================================================== class Sprite_Character < Sprite_Base alias eme_etd_init initialize def initialize(viewport, character = nil) @display_box = false @etd_max_distance = ETD::VIEW_DISTANCE eme_etd_init(viewport, character) end alias eme_etd_dispose dispose def dispose eme_etd_dispose @etd_text.dispose if @etd_text != nil @etd_background.dispose if @etd_background != nil end def init_etd_sprite @etd_text = Sprite.new @etd_text.bitmap = Bitmap.new(544, 32) @etd_text.bitmap.font.size = 16 @etd_text.z = 301 @etd_background = Sprite.new @etd_background.bitmap = Bitmap.new(1, 1) @etd_background.z = 300 end def init_etd_text @etd_text_1 = "" @etd_text_2 = "" @etd_text_back = "" @etd_max_distance = ETD::VIEW_DISTANCE if character.is_a?(Game_Event) for a in 0...character.list.size if character.list[a].code == 108 copy = character.list[a].parameters[0].upcase if copy.include?("<ETD>") @etd_text_1 = character.list[a].parameters[0].gsub(/<[Ee][Tt][Dd]>/) {""} elsif copy.include?("<NN>") @etd_text_2 = character.list[a].parameters[0].gsub(/<[Nn][Nn]>/) {""} elsif copy.include?("<ETDB>") @etd_text_back = character.list[a].parameters[0].gsub(/<[Ee][Tt][Dd][Bb]>/) {""} end end end elsif character.is_a?(Game_Vehicle) if ETD::VEHICLE_TEXT.has_key?(character.type) @etd_text_1 = ETD::VEHICLE_TEXT[character.type][0] @etd_text_2 = ETD::VEHICLE_TEXT[character.type][1] @etd_text_back = ETD::VEHICLE_TEXT[character.type][2] else @etd_text_1 = ETD::VEHICLE_TEXT[:all][0] @etd_text_2 = ETD::VEHICLE_TEXT[:all][1] @etd_text_back = ETD::VEHICLE_TEXT[:all][2] end elsif character.is_a?(Game_Player) if ETD::ACTOR_TEXT.has_key?(character.actor.id) @etd_text_1 = ETD::ACTOR_TEXT[character.actor.id][0] @etd_text_2 = ETD::ACTOR_TEXT[character.actor.id][1] @etd_text_back = ETD::ACTOR_TEXT[character.actor.id][2] else @etd_text_1 = ETD::ACTOR_TEXT[0][0] @etd_text_2 = ETD::ACTOR_TEXT[0][1] @etd_text_back = ETD::ACTOR_TEXT[0][2] end elsif character.is_a?(Game_Follower) and character.actor != nil if ETD::FOLLOWER_TEXT.has_key?(character.actor.id) @etd_text_1 = ETD::FOLLOWER_TEXT[character.actor.id][0] @etd_text_2 = ETD::FOLLOWER_TEXT[character.actor.id][1] @etd_text_back = ETD::FOLLOWER_TEXT[character.actor.id][2] else @etd_text_1 = ETD::FOLLOWER_TEXT[0][0] @etd_text_2 = ETD::FOLLOWER_TEXT[0][1] @etd_text_back = ETD::FOLLOWER_TEXT[0][2] end end end def refresh_etd_sprite @etd_text.bitmap.clear create_etd_background etd_display_text(@etd_text_1, 0) etd_display_text(@etd_text_2, 14) end def create_etd_text init_etd_sprite if @etd_text == nil temporare_1, temporare_2, temporare_3 = @etd_text_1, @etd_text_2, @etd_text_back init_etd_text refresh_etd_sprite if temporare_1 != @etd_text_1 or temporare_2 != @etd_text_2 or temporare_3 != @etd_text_back @etd_text.x = self.x - 272 @etd_text.y = self.y - self.height - 32 @etd_background.x = @etd_text.x + @etd_text.width / 2 - @etd_background.width / 2 @etd_background.y = @etd_text.y + @etd_text.height / 2 - @etd_background.height / 2 end def create_etd_background @etd_background.bitmap.clear @etd_background.bitmap = Cache.system(@etd_text_back) end def etd_display_text(string, y) init_etd_sprite if @etd_text == nil string = convert_escape_characters(string) string = extra_convert(string) if character.is_a?(Game_Player) or character.is_a?(Game_Follower) temporare = string.to_s.clone temporare.gsub!(/\eC\[(\d+)\]/i) { "" } @x_pos = 272 - @etd_text.bitmap.text_size(temporare).width / 2 @etd_text.bitmap.font.color.set(ETD::STANDARD_COLOR) @etd_text.bitmap.font.name = ETD::STANDARD_FONT if ETD::STANDARD_FONT != nil process_character(string.slice!(0, 1), string, y) until string.empty? end def text_color(n) return ETD::STANDARD_COLOR if n == -1 Cache.system("Window").get_pixel(64 + (n % 8) * 8, 96 + (n / 8) * 8) end def convert_escape_characters(text) result = text.to_s.clone result.gsub!(/\\/) { "\e" } result.gsub!(/\e\e/) { "" } result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] } result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) } result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) } result.gsub!(/\eG/i) { Vocab::currency_unit } result end def extra_convert(text) result = text.to_s.clone result.gsub!(/\eH\eP/i) { character.actor.hp } result.gsub!(/\eM\eH\eP/i) { character.actor.maxhp } result.gsub!(/\eM\eP/i) { character.actor.mp } result.gsub!(/\eM\eM\eP/i) { character.actor.maxmp } result.gsub!(/\eL/i) { character.actor.level } result end def process_character(c, text, y) case c when "\e" code = text.slice!(/^[\$\.\|\^!><\{\}\\]|^[A-Z]+/i) case code.upcase when 'C' param = text.slice!(/^\[\d+\]/)[/\d+/].to_i rescue -1 @etd_text.bitmap.font.color.set(text_color(param)) end else process_normal_character(c, y) end end def process_normal_character(c, y) text_width = @etd_text.bitmap.text_size(c) .width @etd_text.bitmap.draw_text(@x_pos, y, text_width * 2, 16, c, 1) @x_pos += text_width end alias eme_etd_update update def update eme_etd_update create_etd_text if @display_box create_etd_text unless character.is_a?(Game_Event) or character.is_a?(Game_Vehicle) distance_check if character.is_a?(Game_Event) or character.is_a?(Game_Vehicle) end def distance_check player_x = $game_player.x; own_x = self.x / 32 + 1; dif_x = own_x - player_x dif_x *= -1 if dif_x < 0 if dif_x > @etd_max_distance etd_hide_box else player_y = $game_player.y; own_y = self.y / 32 + 1; dif_y = own_y - player_y dif_y *= -1 if dif_y < 0 if dif_y > @etd_max_distance etd_hide_box else if !@display_box and @etd_text != nil @etd_text.opacity = 255 if @etd_text != nil @etd_background.opacity = 255 if @etd_background != nil $game_variables[1] = @etd_text_back if character.id == 2 end @display_box = true end end end def etd_hide_box if @display_box @etd_text.opacity = 0 if @etd_text != nil @etd_background.opacity = 0 if @etd_background != nil @display_box = false end end end
Проекты:
Мини-игры: El Presidente -- Red & Blue -- Roll Me Away -- Wizard's Revenge
На перерыве: Mémoire
Кажется, заброшены: Street Magic -- Hack in the Dark
Проекты:
Мини-игры: El Presidente -- Red & Blue -- Roll Me Away -- Wizard's Revenge
На перерыве: Mémoire
Кажется, заброшены: Street Magic -- Hack in the Dark
Короче семерка меня реально задрала...
RPG Maker XP 1.0.0 J шикарно запускается, я могу строить проект, могу изменять, что захочу, короче КП и все такое, но вот при попытке запуска самого проекта (игры), мне выдает неизвестную ошибку, после которой единственный вариант это закрыть программу.
Одним предложением: Могу запустить редактор, но не могу запустить игры.
Жду способ решения, время пошло...
© Надо преуспеть в своей задаче и... мы будем знать, что она то, что намного ближе к тому, чтобы быть тогда...
Нахер семерку?
Проекты:
Мини-игры: El Presidente -- Red & Blue -- Roll Me Away -- Wizard's Revenge
На перерыве: Mémoire
Кажется, заброшены: Street Magic -- Hack in the Dark
Блади, заебись ответил, а теперь чего нибудь по существу, что-бы хоть как-то потом заработало...
© Надо преуспеть в своей задаче и... мы будем знать, что она то, что намного ближе к тому, чтобы быть тогда...
Ты хотя бы текст ошибки написал
Проекты:
Мини-игры: El Presidente -- Red & Blue -- Roll Me Away -- Wizard's Revenge
На перерыве: Mémoire
Кажется, заброшены: Street Magic -- Hack in the Dark
То есть это тебя вообще не смутило ?...
(с) мне выдает неизвестную ошибку, после которой единственный вариант это закрыть программу.
ps: Если бы я знал код ошибки я и без помощи бы справился...
© Надо преуспеть в своей задаче и... мы будем знать, что она то, что намного ближе к тому, чтобы быть тогда...
Эту тему просматривают: 14 (пользователей: 0 , гостей: 14)
Социальные закладки