Rpg˛S Forum uses cookies. Read the Privacy Policy for more info. To remove this message, please click the button to the right:    I accept the use of cookies

Vai al contenuto

Rpg˛S Forum uses cookies. Read the Privacy Policy for more info. To remove this message, please click the button to the right:    I accept the use of cookies

Screen Contest #90

Kamikun






  • Si prega di effettuare il log in prima di rispondere
Usare uno script da un evento - - - - -

    Rpg maker creator
  • Nuovo Arrivato

  • Utenti
  • Rens: 0
  • 0
  • Stelletta
  • 12 messaggi

#1 Inviato 29 February 2020 - 11:49 AM

Buon pomeriggio. Proprio ieri avevo creato un topic in cui chiedevo uno script che permettesse di zoommare la mappa. Sono riuscito ad installarlo nel gioco. Ve lo incollo qui sotto

#==============================================================================
# ** Custom Resolution - Map Zoom
# Version : 1.04
# Author : LiTTleDRAgo
#==============================================================================
#
# Introduction : 
#
#   As the name stated, this script zooms the map and player in the screen    
#
# How to Use :
# 
#   Script : 
#      zoom(ZOOM)    # As an Integer (1-12)
#
# Note :
#   
#   Float zoom values will cause some glitch in the map
#
#==============================================================================
($imported ||= {})[:drg_cr_map_zoom] = 1.04

core = "This script needs Drago - Core Engine ver 1.43 or above"
reso = "This script needs F0's Custom Resolution ver 0.97a or above"
rmxp = "This script only for RMXP"

($imported[:drg_core_engine] || 0) >= 1.43   || raise(core)
$resolution &&  $resolution.version >= 0.971 || raise(reso)
LiTTleDRAgo::XP                              || raise(rmxp)
#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
#  This sprite is used to display the character.It observes the Game_Character
#  class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Character
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias_sec_method(:zoom_update_scrolling, :update)
  #--------------------------------------------------------------------------
  # * Aliased method: update
  #--------------------------------------------------------------------------
  def update(*args)
    zoom_update_scrolling(*args)
    # Update character sprites
    self.zoom_x = $game_map.zoom_x
    self.zoom_y = $game_map.zoom_y
  end
end

#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#  This class handles the map. It includes scrolling and passable determining
#  functions. Refer to "$game_map" for the instance of this class.
#==============================================================================
class Game_Map
  #--------------------------------------------------------------------------
  # * New method: zoom
  #--------------------------------------------------------------------------
  def zoom(zoom=1.0)
    @zoom_x = [[zoom, 1].max,12].min.round
    @zoom_y = [[zoom, 1].max,12].min.round
  end
  #--------------------------------------------------------------------------
  # * New method: zoom_in
  #--------------------------------------------------------------------------
  def zoom_in
    zoom(@zoom_x + 1)
  end
  #--------------------------------------------------------------------------
  # * New method: zoom_out
  #--------------------------------------------------------------------------
  def zoom_out
    zoom(@zoom_x - 1)
  end
end
#==============================================================================
# ** Interpreter 
#------------------------------------------------------------------------------
#  This interpreter runs event commands. This class is used within the
#  Game_System class and the Game_Event class.
#==============================================================================

class Interpreter
  #--------------------------------------------------------------------------
  # * Redirect Listing
  #--------------------------------------------------------------------------
  redirect_method :zoom,     '$game_map.zoom'
  redirect_method :zoom_in,  '$game_map.zoom_in'
  redirect_method :zoom_out, '$game_map.zoom_out'
end

#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  determinants and map scrolling. Refer to "$game_player" for the one
#  Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias_sec_method(:screen_x_before_zoom, :screen_x)
  alias_sec_method(:screen_y_before_zoom, :screen_y)
  alias_sec_method(:screen_z_before_zoom, :screen_z)
  #--------------------------------------------------------------------------
  # * Aliased method: screen_x
  #--------------------------------------------------------------------------
  def screen_x(*args)
    # Get screen coordinates from real coordinates and map display position
    screen_x_before_zoom(*args) * $game_map.zoom_x
  end
  #--------------------------------------------------------------------------
  # * Aliased method: screen_y
  #--------------------------------------------------------------------------
  def screen_y(*args)
    # Get screen coordinates from real coordinates and map display position
    screen_y_before_zoom(*args) * $game_map.zoom_y
  end
  #--------------------------------------------------------------------------
  # * Overwriten method: screen_z
  #--------------------------------------------------------------------------
  def screen_z(height = 0)
    # If display flag on closest surface is ON
    if @always_on_top
      # 999, unconditional
      return 999
    end
    # Get screen coordinates from real coordinates and map display position
    z = (@real_y - $game_map.display_y + 3) * $game_map.zoom_y / 4 + 32 
    # If tile
    if @tile_id > 0
      # Add tile priority * 32
      return z  + $game_map.priorities[@tile_id] * 32 
    # If character
    else
      # If height exceeds 32, then add 31
      return z + ((height > 32) ? 31 : 0)
    end
  end
end
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
#  This class brings together map screen sprites, tilemaps, etc.
#  It's used within the Scene_Map class.
#==============================================================================

class Spriteset_Map
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias_sec_method(:zoom_update_scrolling, :update)
  #--------------------------------------------------------------------------
  # * Aliased method: update
  #--------------------------------------------------------------------------
  def update(*args)
    zoom_update_scrolling(*args)
    @fog.zoom_x *= $game_map.zoom_x
    @fog.zoom_y *= $game_map.zoom_y
    @panorama.zoom_x *= $game_map.zoom_x
    @panorama.zoom_y *= $game_map.zoom_y
  end
end

Ovviamente ho anche installato tutti gli script necessari per il funzionamento di quest'ultimo.

Ora volevo creare un evento in cui la telecamera zommava sul protagonista ma non so bene come si fa :tongue:, qualcuno può aiutarmi?

Grazie mille :biggrin:  


Modificato da Rpg maker creator, 29 February 2020 - 11:50 AM.


    Guardian of Irael
  • Coniglietto Rosso

  • Rpg˛S Admin
  • Rens: 195
  • 19
  • StellettaStellettaStellettaStellettaStellettaStelletta
  • 58413 messaggi
  • Sesso:Maschio
  • Provenienza:Bagnaia (Viterbo)
  • Abilitā:Apprendista


#2 Inviato 29 February 2020 - 11:53 AM

Nell'evento devi mettere il comando call script (chiama script) e dentro la spazio bianco inserire questo:

 

zoom(ZOOM)

dove al posto dello ZOOM grande andrai a mettere un valore numerico da 1 a 12, ricorda si non usare le virgole perché danno problemi.

^ ^


(\_/)
(^ ^) <----coniglietto rosso, me!     
(> <)

 
Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^
 
KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^
 
FwnGMI3.png completo! Giocabile online, qui i dettagli! ^ ^  
 
REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^

Spoiler


    Rpg maker creator
  • Nuovo Arrivato

  • Utenti
  • Rens: 0
  • 0
  • Stelletta
  • 12 messaggi

#3 Inviato 29 February 2020 - 11:55 AM

Grazie mille ^ ^! Provo subito!

Guardian of Irael 

Un'ultima domanda, devo lasciare dello spazio sopra oppure no?

 

 


Modificato da Rpg maker creator, 29 February 2020 - 12:00 PM.


    moongoblin
  • Disperso nel Bosco delle Uova

  • Utenti
  • Rens: 51
  • 8
  • StellettaStelletta
  • 113 messaggi
  • Sesso:Maschio
  • Abilitā:Apprendista

#4 Inviato 29 February 2020 - 15:33 PM

Dici nel comando call script per quanto riguarda lo spazio sopra? No



    Guardian of Irael
  • Coniglietto Rosso

  • Rpg˛S Admin
  • Rens: 195
  • 19
  • StellettaStellettaStellettaStellettaStellettaStelletta
  • 58413 messaggi
  • Sesso:Maschio
  • Provenienza:Bagnaia (Viterbo)
  • Abilitā:Apprendista


#5 Inviato 29 February 2020 - 15:44 PM

(Ah, ah, no, si è creato quello spazio di a capo nel quote e basta, devi metterci solo la riga scritta XD)


(\_/)
(^ ^) <----coniglietto rosso, me!     
(> <)

 
Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^
 
KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^
 
FwnGMI3.png completo! Giocabile online, qui i dettagli! ^ ^  
 
REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^

Spoiler


    Rpg maker creator
  • Nuovo Arrivato

  • Utenti
  • Rens: 0
  • 0
  • Stelletta
  • 12 messaggi

#6 Inviato 29 February 2020 - 20:19 PM

Guardian of Irael

moongoblin

Ok, grazie mille! Funziona :biggrin:






  • Feed RSS