Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Zamknięty przez: Ayene
Pią 29 Kwi, 2011 16:57
Proszę o pomoc ze skryptem
Autor Wiadomość
bartek2940 




Preferowany:
RPG Maker VX

Pomógł: 1 raz
Dołączył: 10 Kwi 2010
Posty: 88
Wysłany: Czw 28 Kwi, 2011 19:01
Proszę o pomoc ze skryptem
Używam Menu z dodatkami (MOG Menu) z poprawkami od naszej ulubionej moderatorki i Map Slide (jest na Forum).

Czy można by sprawić, by w nazwie lokacji nie wyświetlał się nawias z Map Slide?
Lub jeśli nie da rady, to usunąć nazwę lokacji.

Bardzo proszę o pomoc.

Oto oba skrypty:
Spoiler:


MOG MENU z usuniętym zapisem
Spoiler:


Kod:
##################################################
# Mog Basic Menu Plus V 1.0                      #
##################################################
# By Moghunter
# korekta SaE
##############

module Szkodnik_Sae       
Lokacja = "Lokacja"
Czas_gry = "Czas Gry"
Doswiadczenie = "EXP"     
end


class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end

class Window_Base < Window

 
  def draw_actor_level_menu(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 16, y, 24, WLH, actor.level, 2)
  end
  def draw_actor_class_menu(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 85, WLH, actor.class.name)
  end   
 def exp_gauge_color1
    return text_color(30)
  end
  def exp_gauge_color2
    return text_color(31)
  end
def draw_actor_exp_meter(actor, x, y, width = 100)
  if actor.next_exp != 0
  exp = actor.now_exp
  else
  exp = 1
  end
    gw = width * exp / [actor.next_exp, 1].max
    gc1 = exp_gauge_color1
    gc2 = exp_gauge_color2
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, Szkodnik_Sae::Doswiadczenie)   
    self.contents.font.color = normal_color
    xr = x + width
    self.contents.draw_text(xr - 60, y, 60, WLH,  actor.next_rest_exp_s, 2)   
end
end

class Window_MenuStatus < Window_Selectable
  def initialize(x, y)
    super(x, y, 384, 416)
    refresh
    self.active = false
    self.index = -1
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
      x = 104
      y = actor.index * 96 + WLH / 2
      draw_actor_name(actor, x, y)
      draw_actor_class_menu(actor, x + 120, y)
      draw_actor_level_menu(actor, x + 200, y)
      draw_actor_state(actor, x, y + WLH * 2)
      draw_actor_hp(actor, x + 120, y + WLH * 1)
      draw_actor_mp(actor, x + 120, y + WLH * 2)
      draw_actor_exp_meter(actor, x , y + WLH * 1)
    end
  end
  def update_cursor
    if @index < 0               
      self.cursor_rect.empty
    elsif @index < @item_max   
      self.cursor_rect.set(0, @index * 96, contents.width, 96)
    elsif @index >= 100         
      self.cursor_rect.set(0, (@index - 100) * 96, contents.width, 96)
    else                     
      self.cursor_rect.set(0, 0, contents.width, @item_max * 96)
    end
  end
end

class Game_Map
attr_reader   :map_id
def mpname
$mpname = load_data("Data/MapInfos.rvdata")
$mpname[@map_id].name
end
end

class Window_Mapname < Window_Base
  def initialize(x, y)
    super(x, y, 160, WLH + 64)
    refresh
  end
def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, WLH, Szkodnik_Sae::Lokacja)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, WLH+2, 120, WLH, $game_map.mpname.to_s, 2)
end
end

class Window_Time < Window_Base
  def initialize(x, y)
    super(x, y, 160, WLH + 64)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, WLH, Szkodnik_Sae::Czas_gry)
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, WLH+2, 120, WLH, text, 2)
end
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end

class Scene_Menu   
  def main
    start                         
    perform_transition           
    Input.update                 
    loop do
      Graphics.update           
      Input.update             
      update                     
      break if $scene != self     
    end
    Graphics.update
    pre_terminate             
    Graphics.freeze               
    terminate                   
  end
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  def create_menu_background
    @menuback_sprite = Sprite.new
    @menuback_sprite.bitmap = $game_temp.background_bitmap
    @menuback_sprite.color.set(16, 16, 16, 128)
    update_menu_background
  end
  def create_menu_background
    @menuback_sprite = Sprite.new
    @menuback_sprite.bitmap = $game_temp.background_bitmap
    @menuback_sprite.color.set(16, 16, 16, 128)
    update_menu_background
  end
  def dispose_menu_background
    @menuback_sprite.dispose
  end
  def update_menu_background
  end
  def perform_transition
     Graphics.transition(10)
  end
  def start
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(0, 360)
    @status_window = Window_MenuStatus.new(160, 0)
    @playtime_window = Window_Time .new(0, 270)
    @mapname_window = Window_Mapname.new(0, 178)
    @status_window.openness = 0
    @playtime_window.openness = 0
    @mapname_window.openness = 0
    @gold_window.openness = 0
    @status_window.open
    @playtime_window.open
    @mapname_window.open
    @gold_window.open
  end
  def pre_terminate
    @status_window.close
    @playtime_window.close
    @mapname_window.close
    @gold_window.close
    @command_window.close
    begin
    @status_window.update
    @playtime_window.update
    @mapname_window.update
    @gold_window.update
    @command_window.update
    Graphics.update
    end until @status_window.openness == 0
  end
  def terminate
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @playtime_window.dispose
    @mapname_window.dispose
  end
  def update
    update_menu_background
    @command_window.update
    @gold_window.update
    @status_window.update
    @mapname_window.update
    @playtime_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
    @command_window.index = @menu_index
    @command_window.openness = 0
    @command_window.open
    if $game_party.members.size == 0           
      @command_window.draw_item(0, false)     
      @command_window.draw_item(1, false)     
      @command_window.draw_item(2, false)     
      @command_window.draw_item(3, false)   
    end
    if $game_system.save_disabled             
      @command_window.draw_item(4, false)     
    end
  end
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0     
        $scene = Scene_Item.new
      when 1,2,3   
        start_actor_selection
      when 4       
        $scene = Scene_End.new
      end
    end
  end
  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.index = -1
  end
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1
        $scene = Scene_Skill.new(@status_window.index)
      when 2   
        $scene = Scene_Equip.new(@status_window.index)
      when 3
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end
$mogscript = {} if $mogscript == nil
$mogscript["basic_menu_plus"] = true


i Map Slide
Spoiler:

Kod:
#==============================================================================
# Map Slide
#==============================================================================
# Author  : OriginalWij
# Version : 1.1
#==============================================================================

#==============================================================================
# NOTE: Tylko najnowsza wersja jest wersją obslugiwaną.
#
# v1.1
# - naprawiony bug z wielkością mapy
# - dodano jakąś opcję przesówania krawędzi
#==============================================================================

#==============================================================================
#
# Aby "przewijać" w nazwie mapy wpisujemy:
# Nazwę mapy [MET ID_Mapy_Dolnej ID_Mapy_Lewej ID_Mapy_Prawej ID_Mapy_Górnej] np.:
# Wyspa [MET 1 2 3 4]
# Jeśli ma nie przewijać wpisujemy ID 0 (zero)
#==============================================================================

#==============================================================================
# Konfiguracja
#==============================================================================

module OW_MAP_SLIDE
  # Przełącznik (ID) WYŁĄCZAJĄCY Skrypt
  DISABLE_SWITCH = 12
  # Szybkość przesówania się mapy (domyślnie 4)
  SLIDE_SPEED = 4
  # Włączanie krawędzi (tego dotyczy poptawka wersjii v1.1, ale nie znam zastosowania) (domyślnie True)
  MAP_EDGE = true
end

#==============================================================================
# Niżej nie tykaj!
#==============================================================================
#==============================================================================
# Game_Temp
#==============================================================================

class Game_Temp
  #--------------------------------------------------------------------------
  # Public Instance Variables                                           (New)
  #--------------------------------------------------------------------------
  attr_accessor :scroll
  attr_accessor :no_trigger
  attr_accessor :slide_x
  attr_accessor :slide_y
  #--------------------------------------------------------------------------
  # Initialize                                                          (Mod)
  #--------------------------------------------------------------------------
  alias ow_mapslide_game_temp_initialize initialize unless $@
  def initialize
    ow_mapslide_game_temp_initialize
    @scroll = @no_trigger = false
    @slide_x = @slide_y = 0
  end
end

#==============================================================================
# Game_Map
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # Map Name                                                            (New)
  #--------------------------------------------------------------------------
  def map_name
    return load_data("Data/MapInfos.rvdata")[@map_id].name
  end
end

#==============================================================================
# Game_Character
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # Public Instance Variables                                           (New)
  #--------------------------------------------------------------------------
  attr_accessor :real_x
  attr_accessor :real_y
end

#==============================================================================
# Game_Player
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # Determine if Same Position Event is Triggered                       (Mod)
  #--------------------------------------------------------------------------
  alias ow_mapslide_game_player_ceth check_event_trigger_here unless $@
  def check_event_trigger_here(triggers)
    if $game_temp.no_trigger
      $game_temp.no_trigger = false
      return false
    end
    ow_mapslide_game_player_ceth(triggers)
  end
  #--------------------------------------------------------------------------
  # Processing of Movement via input from the Directional Buttons       (Mod)
  #--------------------------------------------------------------------------
  alias ow_mapslide_game_player_move_by_input move_by_input unless $@
  def move_by_input
    return unless movable?
    return if $game_map.interpreter.running?
    if self.x == 0 or self.x == ($game_map.width - 1) or self.y == 0 or
        self.y == ($game_map.height - 1) and OW_MAP_SLIDE::MAP_EDGE
      dir = $game_player.direction
      map_id = [0] * 9
      $game_map.map_name.scan(/\[MET (\d+) (\d+) (\d+) (\d+)\]/i)
      map_id[2] = $1.to_i if self.y == ($game_map.height - 1)
      map_id[4] = $2.to_i if self.x == 0
      map_id[6] = $3.to_i if self.x == ($game_map.width - 1)
      map_id[8] = $4.to_i if self.y == 0
      if map_id[dir] == 0
        ow_mapslide_game_player_move_by_input
        return
      end
      x = $game_player.x
      y = $game_player.y
      new_map = load_data(sprintf("Data/Map%03d.rvdata", map_id[dir]))
      case dir
      when 2; y = 0
      when 4; x = (new_map.width - 1)
      when 6; x = 0
      when 8; y = (new_map.height - 1)
      end
      $game_player.reserve_transfer(map_id[dir], x, y, dir)
    else
      $game_temp.no_trigger = false
      ow_mapslide_game_player_move_by_input
    end
  end
end

#==============================================================================
# Sprite_Character
#==============================================================================

class Sprite_Character < Sprite_Base
  #--------------------------------------------------------------------------
  # Update                                                              (Mod)
  #--------------------------------------------------------------------------
  alias ow_mapslide_sprite_character_update update unless $@
  def update
    ow_mapslide_sprite_character_update
    if $game_temp.scroll
      self.x = @character.screen_x + $game_temp.slide_x
      self.y = @character.screen_y + $game_temp.slide_y
      if @character.is_a?(Game_Player)
        self.x -= $game_temp.slide_x / 16
        self.y -= $game_temp.slide_y / 16
      end
    end
  end
end

#==============================================================================
# Spriteset_Map
#==============================================================================

class Spriteset_Map
  #--------------------------------------------------------------------------
  # Public Instance Variables                                           (New)
  #--------------------------------------------------------------------------
  attr_accessor :tilemap
  attr_accessor :picture_sprites
end

#==============================================================================
# Scene_Map
#==============================================================================

class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # Player Transfer Processing                                          (Mod)
  #--------------------------------------------------------------------------
  alias ow_mapslide_scene_map_upd_tr_player update_transfer_player unless $@
  def update_transfer_player
    if $game_switches[OW_MAP_SLIDE::DISABLE_SWITCH]
      ow_mapslide_scene_map_upd_tr_player
    else
      return unless $game_player.transfer?
      w = Graphics.width
      h = Graphics.height
      speed = OW_MAP_SLIDE::SLIDE_SPEED
      $game_player.real_y += 28 if $game_player.direction == 8
      @spriteset.update
      $game_temp.scroll = true
      @hold = Sprite.new
      @hold.bitmap = Graphics.snap_to_bitmap
      @hold.z = 1
      if $game_player.in_vehicle?
        $game_map.vehicles[$game_player.vehicle_type].transparent = true
      else
        $game_player.transparent = true
      end
      @spriteset.dispose
      $game_player.perform_transfer
      $game_map.autoplay
      $game_map.update
      @spriteset = Spriteset_Map.new
      case $game_player.direction
      when 2
        @spriteset.tilemap.oy += h + ($game_map.height * 32 - h) * 2
        $game_temp.slide_x = 0
        $game_temp.slide_y = h
        for i in 0...h / speed
          @hold.oy += speed
          @spriteset.tilemap.oy += speed
          $game_temp.slide_y -= speed
          @spriteset.update_characters
          Graphics.update
        end
      when 4
        @spriteset.tilemap.ox -= w + ($game_map.width * 32 - w) * 2
        $game_temp.slide_x = -w
        $game_temp.slide_y = 0
        for i in 0...w / speed
          @hold.ox -= speed
          @spriteset.tilemap.ox -= speed
          $game_temp.slide_x += speed
          @spriteset.update_characters
          Graphics.update
        end
      when 6
        @spriteset.tilemap.ox += w + ($game_map.width * 32 - w) * 2
        $game_temp.slide_x = w
        $game_temp.slide_y = 0
        for i in 0...w / speed
          @hold.ox += speed
          @spriteset.tilemap.ox += speed
          $game_temp.slide_x -= speed
          @spriteset.update_characters
          Graphics.update
        end
      when 8
        @spriteset.tilemap.oy -= h + ($game_map.height * 32 - h) * 2
        $game_temp.slide_x = 0
        $game_temp.slide_y = -h
        for i in 0...h / speed
          @hold.oy -= speed
          @spriteset.tilemap.oy -= speed
          $game_temp.slide_y += speed
          @spriteset.update_characters
          Graphics.update
        end
      end
      @hold.bitmap.dispose
      @hold.dispose
      Input.update
      case $game_player.direction
      when 2
        $game_player.real_y -= 256
      when 4
        $game_player.real_x += 256
      when 6
        $game_player.real_x -= 256
      when 8
        $game_player.real_y += 256
      end
      $game_temp.no_trigger = true
      if $game_player.in_vehicle?
        $game_map.vehicles[$game_player.vehicle_type].transparent = false
      else
        $game_player.transparent = false
      end
      $game_temp.scroll = false
    end
  end
end

________________________
Obecny projekt - Chwilowo brak
 
 
 
Angius 

Nie wkurzać



Preferowany:
RPG Maker VX

Pomógł: 104 razy
Dołączył: 30 Paź 2010
Posty: 1276
Skąd: wROCK
Wysłany: Czw 28 Kwi, 2011 22:00
Kod:
class Game_Map
attr_reader   :map_id
def mpname
$mpname = load_data("Data/MapInfos.rvdata")
$mpname[@map_id].name
end
end

class Window_Mapname < Window_Base
  def initialize(x, y)
    super(x, y, 160, WLH + 64)
    refresh
  end
def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, WLH, Szkodnik_Sae::Lokacja)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, WLH+2, 120, WLH, $game_map.mpname.to_s, 2)
end
end

Spróbuj to wywalić z MOG-a
________________________
"Na trolla pewne są tylko dwie pewne metody, jedna samopowtarzalna i druga, wymagająca przeładowania ręcznego."


 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Pią 29 Kwi, 2011 11:40
Jeśli wyrzuci ten fragment, to wyskoczy błąd - usunąłby w końcu nowo dodane okno 'Window_Mapname'.
Żeby nie wyświetlało tych komentarzy w nazwie mapy... może spróbuj zamienić fragment:
Kod:
def mpname
$mpname = load_data("Data/MapInfos.rvdata")
$mpname[@map_id].name
end

na:
Kod:
def mpname
  mpname = load_data("Data/MapInfos.rvdata")
  nn = mpname[@map_id].name 
  if nn.include?("MET")
    nn.scan(/\[MET (\d+) (\d+) (\d+) (\d+)\]/i)   
    ['MET ','[', ']', $1, $2, $3, $4].each {|i| nn.gsub!(i) {''} }
  end 
  return nn
end

Powinno działać :->
________________________


 
 
 
bartek2940 




Preferowany:
RPG Maker VX

Pomógł: 1 raz
Dołączył: 10 Kwi 2010
Posty: 88
Wysłany: Pią 29 Kwi, 2011 14:27
Ayene jesteś świetna (jak zawsze zresztą).
________________________
Obecny projekt - Chwilowo brak
 
 
 
Wyświetl posty z ostatnich:   
Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene