Страница 413 из 643 ПерваяПервая ... 313363403411412413414415423463513 ... ПоследняяПоследняя
Показано с 4,121 по 4,130 из 6423

Тема: Общие вопросы

  1. #4121
    Маститый Аватар для Yuryol
    Информация о пользователе
    Регистрация
    06.03.2014
    Адрес
    Красноярск
    Сообщений
    1,420
    Записей в дневнике
    44
    Репутация: 60 Добавить или отнять репутацию

    По умолчанию

    Цитата Сообщение от Alisa Посмотреть сообщение
    Подскажите пожалуйста. Есть ли способ, поймать значение переменной движущегося события?
    Например, в героя летит камень, стоит событие, при котором, если Х героя на карте и Y героя на карте совпадают с текущим положением события на карте.
    Условия совпали = отнять одну жизнь.
    я же тебе кидал вроде демку выстрелов.то же самое

  2. #4122
    Авторитет Аватар для Bloody
    Информация о пользователе
    Регистрация
    22.04.2008
    Сообщений
    1,752
    Записей в дневнике
    94
    Репутация: 36 Добавить или отнять репутацию

    По умолчанию

    Я что-то не могу найти тему про косяки в скриптах, поэтому напишу сюда.

    Есть у меня скрипт, который вывешивает над эвентами любой текст. Проблема в том, что при открытии диалогового окна любой прозрачности этот текст все равно висит, перекрывая написанное в диалоговом окне.

    Пример:


    Мне нужно это исправить - текст должен пропадать, затемняться, 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

  3. #4123
    Администратор Аватар для Пётр
    Информация о пользователе
    Регистрация
    24.04.2014
    Адрес
    Краснодар
    Сообщений
    3,940
    Записей в дневнике
    6
    Репутация: 132 Добавить или отнять репутацию

    По умолчанию

    А это поменять на меньше не пробовал, чтобы текст за окном был?
    @etd_text.z = 301

  4. #4124
    Маститый Аватар для Alisa
    Информация о пользователе
    Регистрация
    29.08.2013
    Сообщений
    1,425
    Записей в дневнике
    8
    Репутация: 76 Добавить или отнять репутацию

    По умолчанию

    Цитата Сообщение от Yuryol Посмотреть сообщение
    я же тебе кидал вроде демку выстрелов.то же самое
    Юр, помню. Des вон скриптик показал замечательный, всё равно спасибо за помощь.

  5. #4125
    Авторитет Аватар для Bloody
    Информация о пользователе
    Регистрация
    22.04.2008
    Сообщений
    1,752
    Записей в дневнике
    94
    Репутация: 36 Добавить или отнять репутацию

    По умолчанию

    Цитата Сообщение от peter8031983 Посмотреть сообщение
    А это поменять на меньше не пробовал, чтобы текст за окном был?
    Поменял, теперь всё как надо, спасибо)
    Проекты:
    Мини-игры: El Presidente -- Red & Blue -- Roll Me Away -- Wizard's Revenge
    На перерыве: Mémoire
    Кажется, заброшены: Street Magic -- Hack in the Dark

  6. #4126

    По умолчанию

    Короче семерка меня реально задрала...
    RPG Maker XP 1.0.0 J шикарно запускается, я могу строить проект, могу изменять, что захочу, короче КП и все такое, но вот при попытке запуска самого проекта (игры), мне выдает неизвестную ошибку, после которой единственный вариант это закрыть программу.
    Одним предложением: Могу запустить редактор, но не могу запустить игры.
    Жду способ решения, время пошло...

    © Надо преуспеть в своей задаче и... мы будем знать, что она то, что намного ближе к тому, чтобы быть тогда...

  7. #4127
    Авторитет Аватар для Bloody
    Информация о пользователе
    Регистрация
    22.04.2008
    Сообщений
    1,752
    Записей в дневнике
    94
    Репутация: 36 Добавить или отнять репутацию

    По умолчанию

    Нахер семерку?
    Проекты:
    Мини-игры: El Presidente -- Red & Blue -- Roll Me Away -- Wizard's Revenge
    На перерыве: Mémoire
    Кажется, заброшены: Street Magic -- Hack in the Dark

  8. #4128

    По умолчанию

    Блади, заебись ответил, а теперь чего нибудь по существу, что-бы хоть как-то потом заработало...

    © Надо преуспеть в своей задаче и... мы будем знать, что она то, что намного ближе к тому, чтобы быть тогда...

  9. #4129
    Авторитет Аватар для Bloody
    Информация о пользователе
    Регистрация
    22.04.2008
    Сообщений
    1,752
    Записей в дневнике
    94
    Репутация: 36 Добавить или отнять репутацию

    По умолчанию

    Ты хотя бы текст ошибки написал
    Проекты:
    Мини-игры: El Presidente -- Red & Blue -- Roll Me Away -- Wizard's Revenge
    На перерыве: Mémoire
    Кажется, заброшены: Street Magic -- Hack in the Dark

  10. #4130

    По умолчанию

    То есть это тебя вообще не смутило ?...
    (с) мне выдает неизвестную ошибку, после которой единственный вариант это закрыть программу.

    ps: Если бы я знал код ошибки я и без помощи бы справился...

    © Надо преуспеть в своей задаче и... мы будем знать, что она то, что намного ближе к тому, чтобы быть тогда...

Страница 413 из 643 ПерваяПервая ... 313363403411412413414415423463513 ... ПоследняяПоследняя

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 10 (пользователей: 0 , гостей: 10)

Метки этой темы

Социальные закладки

Социальные закладки

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •  
Общие вопросы