Vai al contenuto

Rilevato Ad-Blocker. Per favore disabilita il tuo adblocker quando navighi su makerando.com - Non c'è nessun annuncio invasivo.

  • Chatbox

    You don't have permission to chat.
    Load More
Ally

Gameplay Some Popup

Recommended Posts

Nome Script: Some Popup

Versione: 2.8

Autore/i: mikb89

 

Informazioni:

Con questo script potrete specificare del testo in un evento che verrà mostrato quando il giocatore si avvicina.

 

Features:

Sono disponibili diversi effetti di comparsa ed è possibile utilizzare picture anziché testo. Il testo può essere mostrato, oltre che sul giocatore, anche agganciato all'evento, per scomparire quando questo si allontana. È possibile riprodurre un suono SE, ME, BGM e BGS, sia generico che personalizzato per evento.

 

Screenshots:

somepopupxp.png

 

Istruzioni:

Inserite lo script sotto Materials. Le istruzioni sono fra i commenti.

 

Script

 

 

# Some Popup v 2.8
# XP version
# by mikb89

# Dettagli:
#  Mostra del testo in popup quando vicino a un evento.
#  Il testo può essere piazzato al centro dello schermo, sul giocatore o
#   sull'evento.
#  Scrivi [pop] in un commento per assegnare il popup e scrivi nel commento
#   successivo il testo che verrà mostrato.
# NOTA: [pop] è di default, ma puoi cambiarlo dalle configurazioni.
#  Il testo può essere anche ingrigito, per indicare qualcosa non disponibile.
#   Per far questo, scrivi [npop] invece di [pop].
#  Puoi anche mostrare una Picture anziché testo. Per far ciò, il primo
#   commento deve essere [ppop] e il secondo conterrà il nome della Picture.
#  È possibile riprodurre suoni/musica per ogni evento. Scrivi in un terzo
#   commento queste linee:
#    SE (o ME o BGM o BGS)
#    Nome del file audio
#    Volume (1-100)
#    Pitch (50-150)
#    Puoi omettere le ultime due e saranno impostate di default:
#    Volume 80 per BGS e SE, 100 per BGM e ME
#    Pitch 100
# ATTENZIONE: i commenti devono essere i primi due (o tre) comandi dell'evento.
#
#  Puoi anche chiamare uno script con:
#    $game_player.remove_town_sprite
#   scritto per togliere il popup. Ad esempio se metti il popup su un evento
#   con cui parlerai.

# Configurazioni:
module SPOP
  ID = "pop" # Metti "loc" per compatibilità con vecchie versioni.
   # Cosa scrivere per identificare l'evento con del popup.
   # Se il valore è ad esempio "pop" dovrai scrivere:
   #  - [pop] per il tipico popup;
   #  - [npop] per il popup ingrigito;
   #  - [ppop] per il popup con Picture.
  AUTO_REMOVE_AT_TRANSFER = true
   # Testa per capire cosa intendo.
   #  true - stesso effetto delle città in Chrono Trigger.
   #  false - il popup rimarrà al trasporto. Se ne andrà al primo movimento.
  GRAYED_COLOR = Color.new(255,245,255,175)
   # Valore del colore grigio. Rosso, verde, blu, alpha. Da 0 a 255.
  WALK_8_DIR = true
   # Non devi aggiungere lo script per le 8 direzioni. Metti true qui.
  POPUP_TRANSITION = 9
   # Effetti di s/comparsa del popup.
   #  0: nessun effetto
   #  1: dissolvenza
   #  2: movimento su/giù
   #  3: movimento & dissolvenza
   #  4: movimento ridotto
   #  5: movimento ridotto & dissolvenza
   #  6: zoom in/out
   #  7: zoom & dissolvenza
   #  8: zoom & movimento
   #  9: zoom, movimento, dissolvenza
   # 10: zoom & movimento ridotto
   # 11: zoom, movimento ridotto, dissolvenza
  POPUP_SOUND = ["SE", "046-Book01", 80, 100]
   # Cosa riprodurre al popup.
   # 4 parametri:
   #  1. Tipo di suono ("SE", "ME", "BGS", "BGM");
   #  2. Nome del file;
   #  3. Volume (0-100);
   #  4. Pitch (50-150 (o 15-453 se vuoi i MASSIMI valori)).
   # Per disattivare metti "" al 2. O metti 0 al 3. Esempi:
   #  POPUP_SOUND = ["SE", "", 80, 100]
   #  POPUP_SOUND = ["SE", "046-Book01", 0, 100]
   # Non saranno riprodotti.
   # Eventuali BGM o BGS in riproduzione dissolveranno insieme alla grafica
   #  e poi ripartiranno. Non valido se usi SE/ME.

   # Esempi con ME, BGM, BGS:
   #  POPUP_SOUND = ["ME", "010-Item01", 100, 100]
   #  POPUP_SOUND = ["BGM", "023-Town01", 100, 100]
   #  POPUP_SOUND = ["BGS", "016-Drips01", 100, 100]
  POPUP_BINDING = 2
   # Dove deve essere agganciato il popup.
   #  0: centro dello schermo
   #  1: sul giocatore
   #  2: sugli eventi
end

# Altro:
#  Vedrai 'town' (città) ovunque nello script. Questo perché il SECONDO nome 
#   dato allo script era: "Popup town name".
#  Il PRIMO nome originale era "Location system", da qui il [loc] da mettere
#   nel commento. Comunque non ho mai pubblicato la versione con questo nome
#   quindi non troverai niente riguardo a questa.

#Codename: spop

($imported ||= {})[:mikb89_spop] = true

# Licenza:
# - Puoi chiedermi di includere il supporto per altri script, a patto che usino
#   il $imported[script] = true;
# - Puoi modificare e anche ripostare i miei script, dopo una mia risposta. Per
#   ripostarli, comunque, devi aver fatto pesanti modifiche o porting, non puoi
#   fare un post con lo script così com'è;
# - Puoi usare i miei script per fare quel che vuoi, da giochi gratis a liberi
#   a commerciali. Apprezzerei comunque essere messo al corrente di quello che
#   stai creando;
# - Devi creditarmi, se usi questo script o parte di esso.

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
#class Game_Player#def initialize()
  def initialize
    super
    @town_sprite = nil
    @town_text = ""
    reset_audio
    @town_ex_audio = [nil, ""]
    @sync_event = nil
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
#class Game_Player#def update() <- rewritten
  def update
    # Remember whether or not moving in local variables
    last_moving = moving?
    # If moving, event running, move route forcing, and message window
    # display are all not occurring
    unless moving? or $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing
      # Move player in the direction the directional button is being pressed
      move_by_input # Edited from the original
    end
    # Remember coordinates in local variables
    last_real_x = @real_x
    last_real_y = @real_y
    super
    # Some Popup addition START
    update_town_sprite
    # Some Popup addition END
    # If character moves down and is positioned lower than the center
    # of the screen
    if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
      # Scroll map down
      $game_map.scroll_down(@real_y - last_real_y)
    end
    # If character moves left and is positioned more let on-screen than
    # center
    if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
      # Scroll map left
      $game_map.scroll_left(last_real_x - @real_<img src='http://rpgmkr.net/forum/public/style_emoticons/<#EMO_DIR#>/sourirex.gif' class='bbc_emoticon' alt='X)' />
    end
    # If character moves right and is positioned more right on-screen than
    # center
    if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
      # Scroll map right
      $game_map.scroll_right(@real_x - last_real_<img src='http://rpgmkr.net/forum/public/style_emoticons/<#EMO_DIR#>/sourirex.gif' class='bbc_emoticon' alt='X)' />
    end
    # If character moves up and is positioned higher than the center
    # of the screen
    if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
      # Scroll map up
      $game_map.scroll_up(last_real_y - @real_y)
    end
    # If not moving
    unless moving?
      # If player was moving last time
      if last_moving
        # Event determinant is via touch of same position event
        result = check_event_trigger_here([1,2])
        # If event which started does not exist
        if result == false
          # Disregard if debug mode is ON and ctrl key was pressed
          unless $DEBUG and Input.press?(Input::CTRL)
            # Encounter countdown
            if @encounter_count > 0
              @encounter_count -= 1
            end
          end
        end
      end
      # If C button was pressed
      if Input.trigger?(Input::C)
        # Same position and front event determinant
        check_event_trigger_here([0])
        check_event_trigger_there([0,1,2])
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Part of the update
  #--------------------------------------------------------------------------
#class Game_Player#def update_town_sprite()
  def update_town_sprite
    if @town_sprite != nil
      case SPOP::POPUP_BINDING
      when 1
        @town_sprite.x = screen_x
        if @town_sprite.y != screen_y && screen_y != @sync_y
          @town_sprite.y = screen_y - (@town_sprite.y - @sync_y).abs
          @sync_y = screen_y
        end
      when 2
        if @sync_event != nil
          @town_sprite.x = @sync_event.screen_x
          if @town_sprite.y != @sync_event.screen_y && @sync_event.screen_y != @sync_y
            @town_sprite.y = @sync_event.screen_y - (@town_sprite.y - @sync_y).abs
            @sync_y = @sync_event.screen_y
          end
          sx = @sync_event.x - @x
          sy = @sync_event.y - @y
          remove_town_sprite if Math.hypot(sx, sy) > 2
        end
      end
      rem = false
      @town_sprite.update
      if [1,3,5,7,9,11].include?(SPOP::POPUP_TRANSITION)
        @town_sprite.opacity -= 15 if @town_sprite.z == 5 && @town_sprite.opacity > 0
        @town_sprite.opacity += 15 if @town_sprite.z == 10 && @town_sprite.opacity < 255
        rem = true if @town_sprite.opacity <= 0
      end
      if [2,3,4,5,8,9,10,11].include?(SPOP::POPUP_TRANSITION)
        mov = [4,5,10,11].include?(SPOP::POPUP_TRANSITION) ? 32 : 64
        val = mov/16
        t = @town_sprite.y
        @town_sprite.y += val if @town_sprite.z == 5 && @toadd > -mov
        @town_sprite.y -= val if @town_sprite.z == 10 && @toadd > 0
        @toadd -= val if t != @town_sprite.y
        rem = true if @toadd <= -mov
      end
      if [6,7,8,9,10,11].include?(SPOP::POPUP_TRANSITION)
        if @town_sprite.z == 5 && @town_sprite.zoom_x > 0
          @town_sprite.zoom_x -= 0.25
          @town_sprite.zoom_y -= 0.25
        end
        if @town_sprite.z == 10 && @town_sprite.zoom_x < 1
          @town_sprite.zoom_x += 0.25
          @town_sprite.zoom_y += 0.25
        end
        rem = true if @town_sprite.zoom_x <= 0
      end
      if @town_ex_audio[0] != nil
        if @audiowait > 0
          @audiowait -= 1
        elsif @audiowait == 0
          if @town_audio[0] != nil
            $game_system.method("#{@town_audio[1]}_play").call(@town_audio[0])
            if @town_ex_audio[1] != @town_audio[1]
              $game_system.method("#{@town_ex_audio[1]}_play").call(@town_ex_audio[0])
              @town_ex_audio = [nil, ""]
            end
            reset_audio if @town_audio[0].name != SPOP::POPUP_SOUND[1]
          end
          @audiowait = -1
        end
      end
      remove_town_sprite(true) if rem
    end
  end
  #--------------------------------------------------------------------------
  # * Popup removal at straighten (scene change)
  #--------------------------------------------------------------------------
if method_defined?(:straighten)
  alias_method(:straighten_b4_spop, :straighten) unless method_defined?(:straighten_b4_spop)
end
#class Game_Player#def straighten() <- aliased/added
  def straighten
    remove_town_sprite(true)
    if respond_to?(:straighten_b4_spop)
      straighten_b4_spop
    else
      super
    end
  end
  #--------------------------------------------------------------------------
  # * Player has moved?
  #--------------------------------------------------------------------------
  alias_method(:increase_steps_b4_spop, :increase_steps) unless method_defined?(:increase_steps_b4_spop)
#class Game_Player#def increase_steps() <- aliased
  def increase_steps
    increase_steps_b4_spop
    @move_failed = false
  end
  #--------------------------------------------------------------------------
  # * Processing of Movement via input from the Directional Buttons
  #--------------------------------------------------------------------------
#class Game_Player#def move_by_input()
  def move_by_input
    x, y = self.x, self.y
    @move_failed = true
    case SPOP::WALK_8_DIR ? Input.dir8 : Input.dir4
    when 1
      move_lower_left
      if @move_failed
        check_town(x-1, y+1)
      else
        check_town(x-2, y+2)
      end
    when 2
      move_down
      if @move_failed
        check_town(x, y+1)
      else
        check_town(x, y+2)
      end
    when 3
      move_lower_right
      if @move_failed
        check_town(x+1, y+1)
      else
        check_town(x+2, y+2)
      end
    when 4
      move_left
      if @move_failed
        check_town(x-1, y)
      else
        check_town(x-2, y)
      end
    when 6
      move_right
      if @move_failed
        check_town(x+1, y)
      else
        check_town(x+2, y)
      end
    when 7
      move_upper_left
      if @move_failed
        check_town(x-1, y-1)
      else
        check_town(x-2, y-2)
      end
    when 8
      move_up
      if @move_failed
        check_town(x, y-1)
      else
        check_town(x, y-2)
      end
    when 9
      move_upper_right
      if @move_failed
        check_town(x+1, y-1)
      else
        check_town(x+2, y-2)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Operations for sprite removal and audio stopping
  #--------------------------------------------------------------------------
#class Game_Player#def remove_town_sprite(instant, audio)
  def remove_town_sprite(instant=false, audio=true)
    if @town_sprite != nil
      if instant || SPOP::POPUP_TRANSITION == 0
        if audio
          $game_system.method("#{@town_audio[1]}_stop").call if @town_audio[1] != ""
          $game_system.method("#{@town_ex_audio[1]}_play").call(@town_ex_audio[0]) if @town_ex_audio[1] != ""
        end
        @town_ex_audio = [nil, ""]
        @town_sprite.dispose
        @town_sprite = nil
        @sync_event = nil
      else
        @town_sprite.z = 5
        unless ["se", "me", ""].include?(@town_audio[1])
          $game_system.method("#{@town_audio[1]}_fade").call(4)
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Set the audio as the one specified in SPOP or passed
  #--------------------------------------------------------------------------
#class Game_Player#def reset_audio(spn)
  def reset_audio(spn = SPOP::POPUP_SOUND)
    @town_audio = [(spn[1] == "" || spn[2] <= 0) ? nil :
                    RPG::AudioFile.new(spn[1], spn[2], spn[3]),
                    spn[0].downcase]
  end
  #--------------------------------------------------------------------------
  # * Check if there is a town event in front of the player
  #--------------------------------------------------------------------------
#class Game_Player#def check_town(x, y)
  def check_town(x, y)
    return false if $game_system.map_interpreter.running?
    result = false
    for event in $game_map.events_xy(x, y)
      unless [1,2].include?(event.trigger) and event.priority_type == 1
        if event.list != nil
          if event.list[0].code == 108 and
            ["[#{SPOP::ID}]", "[n#{SPOP::ID}]", "[p#{SPOP::ID}]"].include?(event.list[0].parameters[0])
            result = true
            next if @town_sprite != nil && @town_sprite.z == 10 && @town_text == event.list[1].parameters[0]
            remove_town_sprite(true)
            @town_sprite = Sprite.new
            @town_sprite.z = 10
            if [6,7,8,9,10,11].include?(SPOP::POPUP_TRANSITION)
              @town_sprite.zoom_x = @town_sprite.zoom_y = 0.0
            end
            @town_sprite.opacity = 15 if [1,3,5,7,9,11].include?(SPOP::POPUP_TRANSITION)
            if event.list[0].parameters[0] != "[p#{SPOP::ID}]"
              @town_sprite.bitmap ||= Bitmap.new(1,1)
              siz = @town_sprite.bitmap.text_size(event.list[1].parameters[0])
              h = siz.height
              s = siz.width
              @town_sprite.bitmap.dispose
              @town_sprite.bitmap = Bitmap.new(s, 24)
              if event.list[0].parameters[0] == "[n#{SPOP::ID}]"
                ex = @town_sprite.bitmap.font.color
                @town_sprite.bitmap.font.color = SPOP::GRAYED_COLOR
              end
              @town_sprite.bitmap.draw_text(0,2,s,22,event.list[1].parameters[0],1)
              @town_sprite.bitmap.font.color = ex if event.list[0].parameters[0] == "[n#{SPOP::ID}]"
            else
              @town_sprite.bitmap = Cache.picture(event.list[1].parameters[0])
              s = @town_sprite.bitmap.width
              h = @town_sprite.bitmap.height
            end
            @town_text = event.list[1].parameters[0]
            @town_sprite.ox = s/2
            @town_sprite.oy = h/2
            case SPOP::POPUP_BINDING
            when 1
              @town_sprite.x = screen_x#*32+16
              @town_sprite.y = @sync_y = screen_y#*32+16
            when 2
              @town_sprite.x = event.screen_x#*32+16
              @town_sprite.y = @sync_y = event.screen_y#*32+16
              @sync_event = event
            else
              @town_sprite.x = 544/2# - s/2
              @town_sprite.y = 416/2# - h/2
            end
            @town_sprite.y -= 64 if [0,1,6,7].include?(SPOP::POPUP_TRANSITION)
            @town_sprite.y -= 32 if [4,5,10,11].include?(SPOP::POPUP_TRANSITION)
            @toadd = [2,3,4,5,8,9,10,11].include?(SPOP::POPUP_TRANSITION) ? 64 : 0
            @toadd -= 32 if [4,5,10,11].include?(SPOP::POPUP_TRANSITION)
            if @town_audio[0] != nil || event.list[2].code == 108
              if ["BGM", "ME", "BGS", "SE"].include?(event.list[2].parameters[0]) &&
                event.list[3].code == 408
                arr = []
                arr.push(event.list[2].parameters[0])
                arr.push(event.list[3].parameters[0])
                if event.list[4].code == 408
                  arr.push(event.list[4].parameters[0].to_i)
                  arr.push(event.list[5].parameters[0].to_i) if event.list[5].code == 408
                else
                  arr.push(["BGS", "SE"].include?(event.list[2].parameters[0]) ? 80 : 100)
                end
                arr.push(100) if arr.size < 4
                reset_audio(arr)
              end
              if ["bgm", "bgs"].include?(@town_audio[1])
                @town_ex_audio = [$game_system.method("playing_#{@town_audio[1]}").call,
                                  @town_audio[1]]
              else
                @town_ex_audio[0] = nil
              end
              if @town_ex_audio[0] != nil
                $game_system.method("#{@town_ex_audio[1]}_fade").call(4)
                @audiowait = 4
              else
                $game_system.method("#{@town_audio[1]}_play").call(@town_audio[0])
                reset_audio if arr != nil
              end
            end
          end
        end
      end
    end
    remove_town_sprite unless result
    return result
  end
end

if SPOP::AUTO_REMOVE_AT_TRANSFER
class Scene_Map
  #--------------------------------------------------------------------------
  # * Removing of town sprite when changing map
  #--------------------------------------------------------------------------
  alias_method(:transfer_player_b4_spop, :transfer_player) unless method_defined?(:transfer_player_b4_spop)
#class Scene_Map#def transfer_player() <- aliased
  def transfer_player
    $game_player.remove_town_sprite(true, false)
    transfer_player_b4_spop
  end
end
end

class Game_Map
  #--------------------------------------------------------------------------
  # * Get event list in x, y
  #--------------------------------------------------------------------------
#class Game_Map#def events_xy(x, y)
  unless method_defined?(:events_xy)
  def events_xy(x, y)
    result = []
    for event in $game_map.events.values
      result.push(event) if event.x == x and event.y == y
    end
    return result
  end
  end
end

 

Demo:

Demo multilingua v. 2.8 (800.43 KB)

http://www.mediafire.com/?mmg50jxofjq9jtl

 

Incompatibilità:

Sovrascrive lo script per la camminata in 8 direzioni. O viene sovrascritto, a seconda. Per ovviare, questo script è stato incorporato ed è attivabile/disattivabile tramite opzione.

 

Note dell'autore:

Ringrazio Unamuno per aver chiesto la versione VX altrimenti non l'avrei postata né convertita e Guardian of Irael per avermi suggerito molti miglioramenti.

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti

Crea un account o accedi per lasciare un commento

You need to be a member in order to leave a comment

Crea un account

Iscriviti per un nuovo account nella nostra comunità. È facile!

Registra un nuovo account

Accedi

Sei già registrato? Accedi qui.

Accedi Ora

  • Contenuti simili

    • Da Ally
      Nome Script: Napoleon's Minimap V1.06a
      Versione: 1.06a
      Autore/i: Napoleon
       
      Informazioni:
      Mini-Map script molto bello e personalizzabile con varie opzioni =)
       
      Screenshots:
       
       
      Istruzioni:
      Istruzioni e script all'interno della demo.
       
      Demo:
      https://www.dropbox.com/s/jm92rbqb5eadryr/Napoleons%20Master%20Demo.zip
    • Da Ally
      Nome Script: Camminata 8 Direzioni
      Versione: N/D
      Autore/i: Raizen884
       
      Informazioni:
      Script che simula le 8 direzioni di camminata.
       
      Istruzioni:
      Inserite lo script sotto Material.
       
      Script:
       
      #=======================================================# Engine 8 direções.# Autor: Raizen884# Mude completamente o seu jogo de 4 direções, para# 8 direções. O script vai adicionar movimentos em 8# direções para o personagem e para todos os eventos# no jogo.#=======================================================class Game_Player < Game_Character def move_by_input return if !movable? || $game_map.interpreter.running? move_diagonal(4, 2) if Input.dir8 == 1 move_straight(2) if Input.dir8 == 2 move_diagonal(6, 2) if Input.dir8 == 3 move_straight(4) if Input.dir8 == 4 move_diagonal(6, 8) if Input.dir8 == 9 move_straight(6) if Input.dir8 == 6 move_diagonal(4, 8) if Input.dir8 == 7 move_straight(8) if Input.dir8 == 8 end def move_diagonal(horz, vert) @followers.move if diagonal_passable?(@x, @y, horz, vert) check_event_trigger_touch(@x+1, @y+1) if horz == 6 and vert == 2 check_event_trigger_touch(@x+1, @y-1) if horz == 6 and vert == 8 check_event_trigger_touch(@x-1, @y-1) if horz == 4 and vert == 8 check_event_trigger_touch(@x-1, @y+1) if horz == 4 and vert == 2 super endendclass Game_Character < Game_CharacterBase def move_toward_character(character) sx = distance_x_from(character.x) sy = distance_y_from(character.y) if sx.abs > sy.abs and sy == 0 move_straight(sx > 0 ? 4 : 6) move_straight(sy > 0 ? 8 : 2) if !@move_succeed && sy != 0 elsif sx.abs > sy.abs and sy > 0 if sx > 0 move_diagonal(4, 8) else move_diagonal(6, 8) end elsif sx.abs > sy.abs and sy < 0 if sx > 0 move_diagonal(4, 2) else move_diagonal(6, 2) end end if sx.abs <= sy.abs and sx == 0 move_straight(sy > 0 ? 8 : 2) move_straight(sx > 0 ? 4 : 6) if !@move_succeed && sx != 0 elsif sx.abs <= sy.abs and sx > 0 if sy > 0 move_diagonal(4, 8) else move_diagonal(4, 2) end elsif sx.abs <= sy.abs and sx < 0 if sy > 0 move_diagonal(6, 8) else move_diagonal(6, 2) end endend def move_random case rand(2) when 0 move_straight(2 + rand(4) * 2, false) when 1 move_diagonal(2 + rand(4) * 2, 2 + rand(4) * 2) end end def move_away_from_character(character) sx = distance_x_from(character.x) sy = distance_y_from(character.y) if sx.abs > sy.abs and sy == 0 move_straight(sx > 0 ? 6 : 4) move_straight(sy > 0 ? 2 : 8) if !@move_succeed && sy != 0 elsif sx.abs > sy.abs and sy < 0 if sx < 0 move_diagonal(4, 8) else move_diagonal(6, 8) end elsif sx.abs > sy.abs and sy > 0 if sx > 0 move_diagonal(6, 2) else move_diagonal(4, 2) end end if sx.abs <= sy.abs and sx == 0 move_straight(sy > 0 ? 2 : 8) move_straight(sx > 0 ? 6 : 4) if !@move_succeed && sx != 0 elsif sx.abs <= sy.abs and sx < 0 if sy > 0 move_diagonal(4, 2) else move_diagonal(4, 8) end elsif sx.abs <= sy.abs and sx > 0 if sy < 0 move_diagonal(6, 8) else move_diagonal(6, 2) end endendend
    • Da Ally
      Nome Script: Overlay Mapping
      Versione: del 16.04.2012
      Autore/i: Yami
       
      Informazioni:
      Questo script permette di poter utilizzare i vari livelli di parallasse per mappare all'interno del vostro progetto di RPG Maker VX Ace.
       
      Screenshots:

       
      Istruzioni:
      Create una cartella dentro "Graphics" chiamata Overlay (nome progetto/Graphic/Overlay).
      Potete creare fino a 4 tipi di immagini:
      • Ground (parte base della mappa - va SOTTO a tutto)
      • Par (parte alta della mappa - va SOPRA a tutto e copre gli eventi e il personaggio - vedi albero)
      • Light (crea effetti di luce statici)
      • Shadow (crea effetti di ombra statici)
       
      Le immagini della vostra mappa dovranno essere nominate in base alla loro funzione:
      • Il prato è un ground
      • Gli alberi e tutto quello che è sopra al livello dell'eroe è un par
      • Le luci e le ombre sono rispettivamente light e shadow
       
      Esempio:
      Io ho creato un prato con degli alberi come nell'immagine sopra.
      Tutto questo andrà inserito all'interno delle prima mappa del gioco (quindi ID:0001); di conseguenza chiamerò la mia immagine del prato cosi: Ground1_1 (il primo 1 è l'ID della mappa nel quale il prato verrà visualizzato; il secondo 1 è usato se, per esempio, nella stessa mappa volete creare più versioni: ground1_1 versione normale ground1_2 versione distruzione, per esempio); L'immagine deve essere in PNG.
      Gli alberi andranno salvati cosi: Par1_1 (i numeri seguono lo stesso principio spiegato sopra); L'immagine deve essere in PNG.
      Le luci e le ombre (se presenti) andranno salvate con lo stesso principio spiegato sopra (light1_1 e Shadow1_1); L'immagine deve essere in JPG.
       
      (se questo prato dovrà essere messo nell mappa con ID 23 le immagini saranno chiamate ground23_1, par23_1, light23_1 e shadow23_1)
       
      Spero di essere stato chiaro D:
       
      Script:
       
       
      F.A.Q:
      N/D
       
      Demo:
      N/D
       
      Incompatibilità:
      N/D
       
      Note dell'autore:
      N/D
    • Da Ally
      Nome Script: Lune Ultimate Anti-Lag
      Versione: N/D
      Autore/i: Raizen
       
      Informazioni:
      Lo script Anti-Lag ormai è un must have da inserire nei propri progetti.
      Infatti consente di migliorare le prestazioni nonostante i troppi eventi, script, etc...
       
      Istruzioni:
      Inserite lo script sotto Material e configuratelo se necessario...
       
      Script:
       
       
      #=======================================================# Lune Ultimate Anti-Lag# Author: Raizen# Compatible with: RMVXAce# Comunity: centrorpg.com# This script allows a very well balanced anti-lag, in which# considers the own PC of the player, using a smart frame-skipper# to slow lags,#========================================================#To update constantly the event, put a commentary on the first# command of the script written :update:module Anti_conf#==============================================================================# ** Configurations#------------------------------------------------------------------------------# Configure what is necessary for a better performance.#==============================================================================# Choose how the script will act.# <=====Quality============================Performance=====># 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20# Default = 10Fr = 10# Configure the FPS rate (default = 60)Fps = 60# Configure the minimum FPS rate (default = 25)Mini = 25# Quantity of frames the anti-lag will study,# the higher the time, the more precise the script,# but will take longer to load the anti-lagTime = 60end=beginFunctions on this Anti-Lag* Common event positioning bug fixed* Smart Frame Skipper* updates what is only necessary* helps to lower lags from visual system/scripts* Changes its behavior according to the players PC* Increases the RPG Maker priority over other programs=end#=================================================================##=================================================================##==================== Alias methods =============================## command_203 => Game_Interpreter# start => Scene_Map# update => Scene_Map# perform_transfer => Scene_Map#=================================================================##==================== Rewrite methods ===========================## update_events => Game_Map# update_one_event => Spriteset_Map#=================================================================##======================== New methods ===========================## need_to_update? => Game_Event# near_the_screen? => Sprite_Character# call_position_event => Scene_Map# skip_calculate => Scene_Map# update_one_event => Spriteset_Map#=================================================================##=================================================================##==============================================================================#============================ Início do Script! =============================#==============================================================================#==============================================================================# ** Scene_Map#------------------------------------------------------------------------------# Esta classe executa o processamento da tela de mapa.#==============================================================================class Scene_Map < Scene_Basealias lune_skip_start startalias lune_skip_update updatealias lune_perform perform_transfer #-------------------------------------------------------------------------- # * Inicialização do processo #-------------------------------------------------------------------------- def start Graphics.frame_rate = Anti_conf::Fps @update_skip = false @count_up = 0 lune_skip_start end #-------------------------------------------------------------------------- # * Execução da transferência #-------------------------------------------------------------------------- def perform_transfer $get_new_ids = Array.new Graphics.frame_rate = Anti_conf::Fps lune_perform @count_up = 0 @update_skip = false end #-------------------------------------------------------------------------- # * Atualização da tela #-------------------------------------------------------------------------- def update @update_skip ? lune_skip_update : skip_calculate end #-------------------------------------------------------------------------- # * Atualização de um personagem especifico #-------------------------------------------------------------------------- def call_position_event(id) @spriteset.update_one_event(id) end #-------------------------------------------------------------------------- # * Calcula o tempo necessário para rodar o update do Scene_Map #-------------------------------------------------------------------------- def skip_calculate @count_up += 1 return unless @count_up >= Anti_conf::Time auto_skip = Time.now lune_skip_update old_skip = Time.now get_skip = old_skip - auto_skip Graphics.frame_rate -= (get_skip * Graphics.frame_rate * 2 * Anti_conf::Fr - 1).to_i Graphics.frame_rate = [Graphics.frame_rate, Anti_conf::Mini].max @update_skip = true endend#==============================================================================# ** Scene_Base#------------------------------------------------------------------------------# Esta é a superclasse de todas as cenas do jogo.#==============================================================================class Scene_Basealias skipper_main main #-------------------------------------------------------------------------- # * Processamento principal #-------------------------------------------------------------------------- def main @fr_cont = 0 skipper_main end #-------------------------------------------------------------------------- # * Execução da transição #-------------------------------------------------------------------------- def perform_transition Graphics.transition(transition_speed * Graphics.frame_rate / 60) end #-------------------------------------------------------------------------- # * Atualização da tela (básico) #-------------------------------------------------------------------------- def update_basic if @fr_cont >= 60 Graphics.update @fr_cont -= 60 end @fr_cont += Graphics.frame_rate update_all_windows Input.update endend#==============================================================================# ** Aumento da prioridade do rpg maker#------------------------------------------------------------------------------Lune_high = Win32API.new("kernel32", "SetPriorityClass", "pi", "i")Lune_high.call(-1, 0x90)#==============================================================================#==============================================================================# ** Game_Event#------------------------------------------------------------------------------# Esta classe gerencia os eventos. Ela controla funções incluindo a mudança# de páginas de event por condições determinadas, e processos paralelos.# Esta classe é usada internamente pela classe Game_Map.#==============================================================================class Game_Event < Game_Character #-------------------------------------------------------------------------- # * necessário atualizar? #-------------------------------------------------------------------------- def need_to_update? ax = $game_map.adjust_x(@real_<img src='http://rpgmkr.net/forum/public/style_emoticons/<#EMO_DIR#>/sourirex.gif' class='bbc_emoticon' alt='X)' /> - 8 ay = $game_map.adjust_y(@real_y) - 6 ax.between?(-9, 9) && ay.between?(-7, 7) || @list[0].parameters.include?(':update:') endend#==============================================================================# ** Sprite_Character#------------------------------------------------------------------------------# Este sprite é usado para mostrar personagens. Ele observa uma instância# da classe Game_Character e automaticamente muda as condições do sprite.#==============================================================================class Sprite_Character < Sprite_Base #-------------------------------------------------------------------------- # * Evento próximo a tela? #-------------------------------------------------------------------------- def near_the_screen? ax = $game_map.adjust_x(@character.<img src='http://rpgmkr.net/forum/public/style_emoticons/<#EMO_DIR#>/sourirex.gif' class='bbc_emoticon' alt='X)' /> - 8 ay = $game_map.adjust_y(@character.y) - 6 ax.between?(-11, 11) && ay.between?(-8, 8) endend#==============================================================================# ** Game_Event#------------------------------------------------------------------------------# Esta classe gerencia os eventos. Ela controla funções incluindo a mudança# de páginas de event por condições determinadas, e processos paralelos.# Esta classe é usada internamente pela classe Game_Map.#==============================================================================class Game_Event < Game_Characteralias lune_ant_initialize initialize #-------------------------------------------------------------------------- # * Inicialização do objeto # event : RPG::Event #-------------------------------------------------------------------------- def initialize(*args, &block) lune_ant_initialize(*args, &block) $get_new_ids.push(@event.id) endend#==============================================================================# ** Game_Interpreter#------------------------------------------------------------------------------# Um interpretador para executar os comandos de evento. Esta classe é usada# internamente pelas classes Game_Map, Game_Troop e Game_Event.#==============================================================================class Game_Interpreteralias lune_lag_command_203 command_203 #-------------------------------------------------------------------------- # Definir posição do evento #-------------------------------------------------------------------------- def command_203 lune_lag_command_203 SceneManager.scene.call_position_event($get_new_ids.index(@event_id)) endend#==============================================================================# ** Game_Map#------------------------------------------------------------------------------# Esta classe gerencia o mapa. Inclui funções de rolagem e definição de# passagens. A instância desta classe é referenciada por $game_map.#==============================================================================class Game_Map #-------------------------------------------------------------------------- # * Atualização dos comandos dos eventos #-------------------------------------------------------------------------- def update_events @events.each_value {|event| event.update if event.need_to_update?} @common_events.each {|event| event.update} endend$get_new_ids = Array.new#==============================================================================# ** Spriteset_Map#------------------------------------------------------------------------------# Esta classe reune os sprites da tela de mapa e tilesets. Esta classe é# usada internamente pela classe Scene_Map.#==============================================================================class Spriteset_Map #-------------------------------------------------------------------------- # * Atualização dos personagens #-------------------------------------------------------------------------- def update_characters refresh_characters if @map_id != $game_map.map_id @character_sprites.each {|sprite| sprite.update if sprite.near_the_screen? } end #-------------------------------------------------------------------------- # * Atualização de algum personagem remoto #-------------------------------------------------------------------------- def update_one_event(id) @character_sprites[id].update endend
×