Jump to content
Rpg²S Forum
  • 0

Script che rimpicciolisce il chara secondo la distanza


spriggan
 Share

Question

Ciao, volevo sapere se esiste uno script che diminuisca le dimensioni del chara secondo distanza..

Sarebbe bello se si potesse settare la coordinata Y dalla quale lo script inizia il suo sporco lavoro.

Così sarebbe possibile mante nere una parte di mappa in cui le dimensioni dela chara sono standard, ma superando un determinato asse (diciamo circa a poco meno di metà dello schermo) lo script riduca man mano le dimensioni del chara..

Grazie cmq.

http://img32.imageshack.us/img32/9568/catbloodlq25.gif

"E' forse finita la guerra quando i tedeschi hanno bombardato Pearl Harbor?"

http://img514.imageshack.us/img514/8265/bannerghe.png

Nel mio gioco dico il ca77o che mi pare, il ca77o che mi pare, il ca77o che mi pare.

Non comprendono ancora che l’italiano è fondamentalmente un volgare ed ignorante cazzone con il culto della personalità carismatica dominante ed autoritaria per mancanza della propria, e che nel nostro paese l’anti-intellettualismo è uno dei pochi valori in cui tutti si riconoscono. (Bucknasty)

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
Beh,in teoria basta un singolo evento su ogni mappa.Se ti interessa comunque ti mostro come(è una cretinata,nulla di difficile XD)

http://img156.imageshack.us/img156/7122/bannerhdp.gif

 

 

 

''Mamma, sono uscita con amici. Sono andata ad una festa e mi sono ricordata quello che mi avevi detto: di non bere alcolici. Mi hai chiesto di non bere visto che dovevo guidare, cosi ho bevuto una Sprite. Mi sono sentita orgogliosa di me stessa, anche per aver ascoltato il modo in cui, dolcemente, mi hai suggerito di non bere se dovevo guidare, al contrario di quello che mi dicono alcuni amici. Ho fatto una scelta sana ed il tuo consiglio è stato giusto. Quando la festa e finita, la gente ha iniziato a guidare senza essere in condizioni di farlo. Io ho preso la mia macchina con la certezza di essere sobria. Non potevo immaginare, mamma, ciò che mi aspettava... Qualcosa di inaspettato! Ora sono qui sdraiata sull'asfalto e sento un poliziotto che dice: "Il ragazzo che ha provocato l'incidente era ubriaco". Mamma, la sua voce sembra così lontana... Il mio sangue è sparso dappertutto e sto cercando,con tutte le mie forze, di non piangere. Posso sentire i medici che dicono: "Questa ragazza non ce la farà". Sono certa che il ragazzo alla guida dell'altra macchina non se lo immaginava neanche, mentre andava a tutta velocita. Alla fine lui ha deciso di bere ed io adesso devo morire... Perchè le persone fanno tutto questo, mamma? Sapendo che distruggeranno delle vite? Il dolore è come se mi pugnalasse con un centinaio di coltelli contemporaneamente. Dì a mia sorella di non spaventarsi, mamma, di a papà di essere forte. Qualcuno doveva dire a quel ragazzo che non si deve bere e guidare... Forse, se i suoi glielo avessero detto, io adesso sarei viva... La mia respirazione si fa sempre piu debole e incomincio ad avere veramente paura... Questi sono i miei ultimi momenti,e mi sento così disperata...Mi piacerebbe poterti abbracciare mamma, mentre sono sdraiata, qui, morente. Mi piacerebbe dirti che ti voglio bene per questo... Ti voglio bene e.... addio."

Queste parole sono state scritte da un giornalista che era presente all'incidente. La ragazza, mentre moriva, sussurrava queste parole ed il giornalista scriveva...scioccato. Questo giornalista ha iniziato una campagna contro la guida in stato di ebbrezza. Se questo messaggio è arrivato fino a te e lo cancelli... Potresti perdere l'opportunita, anche se non bevi, di far capire a molte persone che la tua stessa vita è in pericolo. Questo piccolo gesto può fare la differenza. Non ti costa nulla: mettilo nella tua firma grazie

 

 

 

Link to comment
Share on other sites

  • 0

Magari, grazie. ^^

Con la grafica un pochino me la cavo.. ma nello scripting e nella programmazione ad eventi sono un discreto cane.. Non immaginavo neppure fosse possibile farlo ad eventi ><

http://img32.imageshack.us/img32/9568/catbloodlq25.gif

"E' forse finita la guerra quando i tedeschi hanno bombardato Pearl Harbor?"

http://img514.imageshack.us/img514/8265/bannerghe.png

Nel mio gioco dico il ca77o che mi pare, il ca77o che mi pare, il ca77o che mi pare.

Non comprendono ancora che l’italiano è fondamentalmente un volgare ed ignorante cazzone con il culto della personalità carismatica dominante ed autoritaria per mancanza della propria, e che nel nostro paese l’anti-intellettualismo è uno dei pochi valori in cui tutti si riconoscono. (Bucknasty)

Link to comment
Share on other sites

  • 0

Ma di nulla.per me è un piacere aiutare sugli eventi^^

eccoti uno screen

http://img98.imageshack.us/img98/5633/screenth4.th.png

l'evento lo posizioni sulla linea orizzontale dell'immaginario confine.

nella prima if ci metti la grafica base,nella seconda quella ripicciolita.se ci sono problemi dimmelo^^

 

edit:nello screen non si riesce a leggere.ti riscrivo il procedimento qui^^

 

variabile 0001yeroe:eroe y mappa

variabile 0002lineadiconfine:lineadiconfine y mappa

 

if variabile 0001yeroe > variabile0002linea di confine(quindi se sei più in basso della linea)

muovi evento:eroe

cambia grafica:(qui metti la grafica normale)

 

if variabile 0001yeroe < variabile0002linea di confine(quindi se sei più in alto della linea)

muovi evento:eroe

cambia grafica:(qui metti la grafica rimpicciolita)

 

spero di essermi spiegato bene^^

Edited by godener

http://img156.imageshack.us/img156/7122/bannerhdp.gif

 

 

 

''Mamma, sono uscita con amici. Sono andata ad una festa e mi sono ricordata quello che mi avevi detto: di non bere alcolici. Mi hai chiesto di non bere visto che dovevo guidare, cosi ho bevuto una Sprite. Mi sono sentita orgogliosa di me stessa, anche per aver ascoltato il modo in cui, dolcemente, mi hai suggerito di non bere se dovevo guidare, al contrario di quello che mi dicono alcuni amici. Ho fatto una scelta sana ed il tuo consiglio è stato giusto. Quando la festa e finita, la gente ha iniziato a guidare senza essere in condizioni di farlo. Io ho preso la mia macchina con la certezza di essere sobria. Non potevo immaginare, mamma, ciò che mi aspettava... Qualcosa di inaspettato! Ora sono qui sdraiata sull'asfalto e sento un poliziotto che dice: "Il ragazzo che ha provocato l'incidente era ubriaco". Mamma, la sua voce sembra così lontana... Il mio sangue è sparso dappertutto e sto cercando,con tutte le mie forze, di non piangere. Posso sentire i medici che dicono: "Questa ragazza non ce la farà". Sono certa che il ragazzo alla guida dell'altra macchina non se lo immaginava neanche, mentre andava a tutta velocita. Alla fine lui ha deciso di bere ed io adesso devo morire... Perchè le persone fanno tutto questo, mamma? Sapendo che distruggeranno delle vite? Il dolore è come se mi pugnalasse con un centinaio di coltelli contemporaneamente. Dì a mia sorella di non spaventarsi, mamma, di a papà di essere forte. Qualcuno doveva dire a quel ragazzo che non si deve bere e guidare... Forse, se i suoi glielo avessero detto, io adesso sarei viva... La mia respirazione si fa sempre piu debole e incomincio ad avere veramente paura... Questi sono i miei ultimi momenti,e mi sento così disperata...Mi piacerebbe poterti abbracciare mamma, mentre sono sdraiata, qui, morente. Mi piacerebbe dirti che ti voglio bene per questo... Ti voglio bene e.... addio."

Queste parole sono state scritte da un giornalista che era presente all'incidente. La ragazza, mentre moriva, sussurrava queste parole ed il giornalista scriveva...scioccato. Questo giornalista ha iniziato una campagna contro la guida in stato di ebbrezza. Se questo messaggio è arrivato fino a te e lo cancelli... Potresti perdere l'opportunita, anche se non bevi, di far capire a molte persone che la tua stessa vita è in pericolo. Questo piccolo gesto può fare la differenza. Non ti costa nulla: mettilo nella tua firma grazie

 

 

 

Link to comment
Share on other sites

  • 0

Grazie ancora per la disponibilità, ora ci provo ^^

Quel che mi chiedo è, visto che volevo che l'effetto di rimpicciolimento fosse fluido, mi sa che dovrò inserire una decina di riduzioni del chara. Il che non è un problema. Ma non è che rischio di appesantire la mappa? O vale sempre il discorso "gli eventi pesano meno"?

http://img32.imageshack.us/img32/9568/catbloodlq25.gif

"E' forse finita la guerra quando i tedeschi hanno bombardato Pearl Harbor?"

http://img514.imageshack.us/img514/8265/bannerghe.png

Nel mio gioco dico il ca77o che mi pare, il ca77o che mi pare, il ca77o che mi pare.

Non comprendono ancora che l’italiano è fondamentalmente un volgare ed ignorante cazzone con il culto della personalità carismatica dominante ed autoritaria per mancanza della propria, e che nel nostro paese l’anti-intellettualismo è uno dei pochi valori in cui tutti si riconoscono. (Bucknasty)

Link to comment
Share on other sites

  • 0
Dovrebbe esistere proprio uno script che fa i vari zoom sul personaggio, prova a cercarlo nella sezione scripts, con l'evento esce un pò bruttino e poco fluido!

Targhette
http://www.rpg2s.net/awards/mostpolite2.jpghttp://www.rpg2s.net/awards/mostpresent1.jpghttp://i51.tinypic.com/2mfnpt2.png

 

 

http://www.rpg2s.net/dax_games/r2s_regali5.png

Link to comment
Share on other sites

  • 0

Esiste lo script, è di SephirothSpawn ma richiede SDK e MACL se non le hai in gioco e non hai intezioni di metterle vedo se riesco ad adattartelo io, se invece gia usi le SDK eccoti lo script:

 

#==============================================================================
# ** Perspective Sprites
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1
# 2007-01-05
# SDK : Version 2.0+, Parts I & II
#------------------------------------------------------------------------------
# * Version History :
#
#   Version 1 ---------------------------------------------------- (2007-01-05)
#------------------------------------------------------------------------------
# * Requirements :
#
#   Method & Class Library (2.1+)
#------------------------------------------------------------------------------
# * Description :
#
#   This script was designed to manipulate event sprites to appear with
#   perspective. You can define perspective points on the map and scaling for
#   each perspective point. You may also define perspective regions, so when
#   an event is : at a specific point; within a defined rectangle; within a
#   defined circle, they will have altered perspective points and scaling.
#
#   How it works:
#
#   The events will zoom the distance they are from the defined perspective
#   point divided by the scale. If the focus point is 400 pixels away and
#   the scale is 800, the zoom will be 400 / 800. So the sprite will be
#   half of it's original size.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place The Script Below the SDK and Above Main.
#   To define focus points, scales and regions, refer to Customization.
#   To get the current zoom of an event, refer to Syntax.
#------------------------------------------------------------------------------
# * Customization :
#
#   Focus Points
#	- Focus_Points = { map_id => [real_x, real_y], ... }
#
#   Scaling
#	- Scaling	  = { map_id => n, ... }
#
#   Regions alter the focus points & scaling for characters in these regions
#
#   Direct Region (Specific Point)
#	- Drct_Regions = {
#		map_id => { [x, y] => [real_x, real_y, scaling], ...},
#		...
#	  }
#   Regions (Rectangular)
#	- Rect_Regions = { 
#		map_id => { [x, y, w, h] => [real_x, real_y, scaling], ... },
#		...
#	  }
#
#   Regions (Circular)
#	- Circ_Regions = {
#		map_id => { [x, y, r] => [real_x, real_y, scaling], ... },
#		... 
#	  }
#------------------------------------------------------------------------------
# * Syntax :
#
#   Getting Curren Zoom of character (Returns Float)
#	- <game_character>.zoom?
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Perspective Sprites', 'SephirothSpawn', 1, '2007-01-05')
SDK.check_requirements(2.0, [2], {'Method & Class Library' => 2.1})

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.enabled?('Perspective Sprites')
 
#==============================================================================
# ** Perspective
#==============================================================================

module Perspective
 #--------------------------------------------------------------------------
 # * Options
 #
 #  ~ Focus Points
 #	 - Focus_Points = { map_id => [real_x, real_y], ... }
 #
 #  ~ Scaling
 #	 - Scaling	  = { map_id => n, ... }
 #
 #  Regions alter the focus points & scaling for characters in these regions
 #
 #  ~ Direct Region (Specific Point)
 #	 - Drct_Regions = {
 #		 map_id => { [x, y] => [real_x, real_y, scaling], ...},
 #		 ...
 #	   }
 #  ~ Regions (Rectangular)
 #	 - Rect_Regions = { 
 #		 map_id => { [x, y, w, h] => [real_x, real_y, scaling], ... },
 #		 ...
 #	   }
 #
 #  ~ Regions (Circular)
 #	 - Circ_Regions = {
 #		 map_id => { [x, y, r] => [real_x, real_y, scaling], ... },
 #		 ... 
 #	   }
 #
 #--------------------------------------------------------------------------
 Focus_Points = {
2 => [320, - 480]
 }
 Scaling	  = {
2 => 640
 }
 Drct_Regions = {
# Example
# 1 => { [3, 3] => [0, 0, 200] }
 }
 Rect_Regions = {
# Example
# 1 => { [4, 4, 5, 5] => [1000, -200, 500] }
 }
 Circ_Regions = {
 }
 #--------------------------------------------------------------------------
 # * Get Focus Point
 #--------------------------------------------------------------------------
 def self.focus_point?(map_id)
return Focus_Points.has_key?(map_id) ? Focus_Points[map_id] : nil
 end
 #--------------------------------------------------------------------------
 # * Get Scaling
 #--------------------------------------------------------------------------
 def self.scaling?(map_id)
return Scaling.has_key?(map_id) ? Scaling[map_id] : 1
 end
 #--------------------------------------------------------------------------
 # * Direct Regions
 #--------------------------------------------------------------------------
 def self.drct_regions?(map_id)
return Drct_Regions.has_key?(map_id) ? Drct_Regions[map_id] : {}
 end
 #--------------------------------------------------------------------------
 # * Rect Regions
 #--------------------------------------------------------------------------
 def self.rect_regions?(map_id)
return Rect_Regions.has_key?(map_id) ? Rect_Regions[map_id] : {}
 end
 #--------------------------------------------------------------------------
 # * Circ Regions
 #--------------------------------------------------------------------------
 def self.circ_regions?(map_id)
return Circ_Regions.has_key?(map_id) ? Circ_Regions[map_id] : {}
 end
 #--------------------------------------------------------------------------
 # * Focus & Scale at Point
 #--------------------------------------------------------------------------
 def self.focus_and_scale?(map_id, x, y)
# Sets Key
key = [map_id, x, y]
# If Search Contains Key
if @searches.has_key?(key)
  # Returns Saved Data
  return @searches[key]
end
# Checks Direct Locations
self.drct_regions?(map_id).each do |xy, xys|
  return xys if x == xy[0] && y == xy[0]
end
# Checks Rect Regions
self.rect_regions?(map_id).each do |xywh, xys|
  x_, y_ = xywh[0],	  xywh[1]
  w, h = xywh[2], xywh[3]
  return xys if VR.in_rect_range?(x, y, x_, y_, w, h)
end
# Checks Circular Regions
self.circ_regions?(map_id).each do |xyr, xys|
  return xys if VR.in_range?(x, y, xyr[0], xyr[1], xyr[2])
end
# Save & Return Map Scaling
f, s = self.focus_point?(map_id), self.scaling?(map_id)
return (f.nil? ? [nil, nil, 1] : [f[0], f[1], s])
 end
 #--------------------------------------------------------------------------
 # * Get Searches (DO NOT ALTER)
 #--------------------------------------------------------------------------
 # Create Search Data
 @searches = {}
 # Load Map Data
 load_data('Data/MapInfos.rxdata').keys.each do |map_id|
# Get Map Data
map = load_data(sprintf('Data/Map%03d.rxdata', map_id))
# Pass Through Map Dimensions
for x in 0...map.width
  for y in 0...map.height
	# Save Map Scale
	@searches[[map_id, x, y]] = self.focus_and_scale?(map_id, x, y)
  end
end
 end
end

#==============================================================================
# ** Game_Map
#==============================================================================

class Game_Map
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_reader :p_focus_point
 attr_reader :p_scaling



 attr_reader :p_drct_regs
 attr_reader :p_rect_regs
 attr_reader :p_circ_regs
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias_method :seph_spritepersp_gmap_suld,	:setup_load
 #--------------------------------------------------------------------------
 # * Setup
 #--------------------------------------------------------------------------
 def setup_load
# Original Setup Map Data
seph_spritepersp_gmap_suld
# Sets Perspective Properties
@p_focus_point = Perspective.focus_point?(@map_id)
@p_scaling	 = Perspective.scaling?(@map_id)
@p_drct_regs   = Perspective.drct_regions?(@map_id)
@p_rect_regs   = Perspective.rect_regions?(@map_id)
@p_circ_regs   = Perspective.circ_regions?(@map_id)
 end
 #--------------------------------------------------------------------------
 # * Focus and Scale?
 #--------------------------------------------------------------------------
 def focus_and_scale?(x, y)
return Perspective.focus_and_scale?(@map_id, x, y)
 end
end

#==============================================================================
# ** Game_Character
#==============================================================================

class Game_Character
 #--------------------------------------------------------------------------
 # * Perspective Zoom?
 #--------------------------------------------------------------------------
 def perspective_zoom?
# Gets Focus Points
f_x, f_y, scale = $game_map.focus_and_scale?(@x, @y)
# Calculates X & Y Difference
x_diff = (@real_x / 4 - f_x).abs
y_diff = (@real_y / 4 - f_y).abs
# Calculates Distance From Focus
distance = Math.sqrt(x_diff ** 2 + y_diff ** 2)
# Returns Zoom
return distance / scale.to_f
 end
end

#==============================================================================
# ** Sprite_Character
#==============================================================================

class Sprite_Character
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias_method :seph_spritepersp_schr_update, :update
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
# Original Update
seph_spritepersp_schr_update
# Unless No Focus Point
unless $game_map.p_focus_point.nil?
  # If Visible
  if self.visible
	# Sets Zoom
	zoom = @character.perspective_zoom?
	self.zoom_x = zoom
	self.zoom_y = zoom
  end
end
 end
end

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end

 

 

Secondo me in questo caso devi assolutamente optare per l'opzione script in quanto

1) lo zoom sul/sui characters è più fluido

2) crearti 100000 eventi che ti cambiano grafica per ciascun personaggio/evento e da pazzi, specialmente se poi glie eventi non stanno fermi e quindi anche loro hanno bisogno di più grafica

3) con questo script puoi impostare diversi punti prospettici(quindi una diversa progressione dello zoom), cosa che da quel che ho visto nel tuo gioco potrebbe risultare molto vantaggioso ed utile.

 

Fammi sapere se devo levare la dipendenza dalle SDK ;)

Link to comment
Share on other sites

  • 0
Edited by spriggan

http://img32.imageshack.us/img32/9568/catbloodlq25.gif

"E' forse finita la guerra quando i tedeschi hanno bombardato Pearl Harbor?"

http://img514.imageshack.us/img514/8265/bannerghe.png

Nel mio gioco dico il ca77o che mi pare, il ca77o che mi pare, il ca77o che mi pare.

Non comprendono ancora che l’italiano è fondamentalmente un volgare ed ignorante cazzone con il culto della personalità carismatica dominante ed autoritaria per mancanza della propria, e che nel nostro paese l’anti-intellettualismo è uno dei pochi valori in cui tutti si riconoscono. (Bucknasty)

Link to comment
Share on other sites

  • 0

Se non ti serve per altri script SDK allora invece di aggiungere inutilmente le SDK per questo script prendi lo script riadattato per funzionare senza e stai a posto.

Tieni:

 

#==============================================================================
# ** Perspective Sprites
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 1
# 2007-01-05
# SDK : Version 2.0+, Parts I & II
#------------------------------------------------------------------------------
# * Version History :
#
#   Version 1 ---------------------------------------------------- (2007-01-05)
#------------------------------------------------------------------------------
# * Requirements :
#
#   Method & Class Library (2.1+)
#------------------------------------------------------------------------------
# * Description :
#
#   This script was designed to manipulate event sprites to appear with
#   perspective. You can define perspective points on the map and scaling for
#   each perspective point. You may also define perspective regions, so when
#   an event is : at a specific point; within a defined rectangle; within a
#   defined circle, they will have altered perspective points and scaling.
#
#   How it works:
#
#   The events will zoom the distance they are from the defined perspective
#   point divided by the scale. If the focus point is 400 pixels away and
#   the scale is 800, the zoom will be 400 / 800. So the sprite will be
#   half of it's original size.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place The Script Below the SDK and Above Main.
#   To define focus points, scales and regions, refer to Customization.
#   To get the current zoom of an event, refer to Syntax.
#------------------------------------------------------------------------------
# * Customization :
#
#   Focus Points
#	- Focus_Points = { map_id => [real_x, real_y], ... }
#
#   Scaling
#	- Scaling	  = { map_id => n, ... }
#
#   Regions alter the focus points & scaling for characters in these regions
#
#   Direct Region (Specific Point)
#	- Drct_Regions = {
#		map_id => { [x, y] => [real_x, real_y, scaling], ...},
#		...
#	  }
#   Regions (Rectangular)
#	- Rect_Regions = {
#		map_id => { [x, y, w, h] => [real_x, real_y, scaling], ... },
#		...
#	  }
#
#   Regions (Circular)
#	- Circ_Regions = {
#		map_id => { [x, y, r] => [real_x, real_y, scaling], ... },
#		...
#	  }
#------------------------------------------------------------------------------
# * Syntax :
#
#   Getting Curren Zoom of character (Returns Float)
#	- <game_character>.zoom?
#==============================================================================


#==============================================================================
# ** Perspective
#==============================================================================

module Perspective
 #--------------------------------------------------------------------------
 # * Options
 #
 #  ~ Focus Points
 #	 - Focus_Points = { map_id => [real_x, real_y], ... }
 #
 #  ~ Scaling
 #	 - Scaling	  = { map_id => n, ... }
 #
 #  Regions alter the focus points & scaling for characters in these regions
 #
 #  ~ Direct Region (Specific Point)
 #	 - Drct_Regions = {
 #		 map_id => { [x, y] => [real_x, real_y, scaling], ...},
 #		 ...
 #	   }
 #  ~ Regions (Rectangular)
 #	 - Rect_Regions = {
 #		 map_id => { [x, y, w, h] => [real_x, real_y, scaling], ... },
 #		 ...
 #	   }
 #
 #  ~ Regions (Circular)
 #	 - Circ_Regions = {
 #		 map_id => { [x, y, r] => [real_x, real_y, scaling], ... },
 #		 ...
 #	   }
 #
 #--------------------------------------------------------------------------
 Focus_Points = {
1 => [320, -240]
 }
 Scaling	  = {
1 => 480
 }
 Drct_Regions = {
# Example
# 1 => { [3, 3] => [0, 0, 200] }
 }
 Rect_Regions = {
# Example
# 1 => { [4, 4, 5, 5] => [1000, -200, 500] }
 }
 Circ_Regions = {
 }
 #--------------------------------------------------------------------------
 # * Get Focus Point
 #--------------------------------------------------------------------------
 def self.focus_point?(map_id)
return Focus_Points.has_key?(map_id) ? Focus_Points[map_id] : nil
 end
 #--------------------------------------------------------------------------
 # * Get Scaling
 #--------------------------------------------------------------------------
 def self.scaling?(map_id)
return Scaling.has_key?(map_id) ? Scaling[map_id] : 1
 end
 #--------------------------------------------------------------------------
 # * Direct Regions
 #--------------------------------------------------------------------------
 def self.drct_regions?(map_id)
return Drct_Regions.has_key?(map_id) ? Drct_Regions[map_id] : {}
 end
 #--------------------------------------------------------------------------
 # * Rect Regions
 #--------------------------------------------------------------------------
 def self.rect_regions?(map_id)
return Rect_Regions.has_key?(map_id) ? Rect_Regions[map_id] : {}
 end
 #--------------------------------------------------------------------------
 # * Circ Regions
 #--------------------------------------------------------------------------
 def self.circ_regions?(map_id)
return Circ_Regions.has_key?(map_id) ? Circ_Regions[map_id] : {}
 end
 #--------------------------------------------------------------------------
 # * Focus & Scale at Point
 #--------------------------------------------------------------------------
 def self.focus_and_scale?(map_id, x, y)
# Sets Key
key = [map_id, x, y]
# If Search Contains Key
if @searches.has_key?(key)
  # Returns Saved Data
  return @searches[key]
end
# Checks Direct Locations
self.drct_regions?(map_id).each do |xy, xys|
  return xys if x == xy[0] && y == xy[0]
end
# Checks Rect Regions
self.rect_regions?(map_id).each do |xywh, xys|
  x_, y_ = xywh[0],	  xywh[1]
  w, h = xywh[2], xywh[3]
  return xys if VR.in_rect_range?(x, y, x_, y_, w, h)
end
# Checks Circular Regions
self.circ_regions?(map_id).each do |xyr, xys|
  return xys if VR.in_range?(x, y, xyr[0], xyr[1], xyr[2])
end
# Save & Return Map Scaling
f, s = self.focus_point?(map_id), self.scaling?(map_id)
return (f.nil? ? [nil, nil, 1] : [f[0], f[1], s])
 end
 #--------------------------------------------------------------------------
 # * Get Searches (DO NOT ALTER)
 #--------------------------------------------------------------------------
 # Create Search Data
 @searches = {}
 # Load Map Data
 load_data('Data/MapInfos.rxdata').keys.each do |map_id|
# Get Map Data
map = load_data(sprintf('Data/Map%03d.rxdata', map_id))
# Pass Through Map Dimensions
for x in 0...map.width
  for y in 0...map.height
	# Save Map Scale
	@searches[[map_id, x, y]] = self.focus_and_scale?(map_id, x, y)
  end
end
 end
end

#==============================================================================
# ** Game_Map
#==============================================================================

class Game_Map
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_reader :p_focus_point
 attr_reader :p_scaling
 attr_reader :p_drct_regs
 attr_reader :p_rect_regs
 attr_reader :p_circ_regs
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias seph_spritepersp_gmap_suld setup
 #--------------------------------------------------------------------------
 # * Setup
 #--------------------------------------------------------------------------
 def setup(map_id)

# Original Setup Map Data
seph_spritepersp_gmap_suld(map_id)
# Sets Perspective Properties
@p_focus_point = Perspective.focus_point?(@map_id)
@p_scaling	 = Perspective.scaling?(@map_id)
@p_drct_regs   = Perspective.drct_regions?(@map_id)
@p_rect_regs   = Perspective.rect_regions?(@map_id)
@p_circ_regs   = Perspective.circ_regions?(@map_id)
 end
 #--------------------------------------------------------------------------
 # * Focus and Scale?
 #--------------------------------------------------------------------------
 def focus_and_scale?(x, y)
return Perspective.focus_and_scale?(@map_id, x, y)
 end
end

#==============================================================================
# ** Game_Character
#==============================================================================

class Game_Character
 #--------------------------------------------------------------------------
 # * Perspective Zoom?
 #--------------------------------------------------------------------------
 def perspective_zoom?
# Gets Focus Points
f_x, f_y, scale = $game_map.focus_and_scale?(@x, @y)
# Calculates X & Y Difference
x_diff = (@real_x / 4 - f_x).abs
y_diff = (@real_y / 4 - f_y).abs
# Calculates Distance From Focus
distance = Math.sqrt(x_diff ** 2 + y_diff ** 2)
# Returns Zoom
return distance / scale.to_f
 end
end

#==============================================================================
# ** Sprite_Character
#==============================================================================

class Sprite_Character
 #--------------------------------------------------------------------------
 # * Alias Listings
 #--------------------------------------------------------------------------
 alias seph_spritepersp_schr_update update
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
# Original Update
seph_spritepersp_schr_update
# Unless No Focus Point
unless $game_map.p_focus_point.nil?
  # If Visible
  if self.visible
	# Sets Zoom
	zoom = @character.perspective_zoom?
	self.zoom_x = zoom
	self.zoom_y = zoom
  end
end
 end
end

 

L'ho testato su una mappa di un progetto vuoto è funzionava ma se riscontri problemi non esitare a chiedere ;)

Link to comment
Share on other sites

  • 0

Grazie Leonhart, l'effetto è splendido ^^

Sta benissimo con le mappe che sto facendo. Ora ci sbatto un pò la testa per capire come funziona ^^ Mi sembra giri da DIO.

 

Verrai creditato a lettere cubitali ><

Edited by spriggan

http://img32.imageshack.us/img32/9568/catbloodlq25.gif

"E' forse finita la guerra quando i tedeschi hanno bombardato Pearl Harbor?"

http://img514.imageshack.us/img514/8265/bannerghe.png

Nel mio gioco dico il ca77o che mi pare, il ca77o che mi pare, il ca77o che mi pare.

Non comprendono ancora che l’italiano è fondamentalmente un volgare ed ignorante cazzone con il culto della personalità carismatica dominante ed autoritaria per mancanza della propria, e che nel nostro paese l’anti-intellettualismo è uno dei pochi valori in cui tutti si riconoscono. (Bucknasty)

Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...