Jump to content
Rpg²S Forum

Maxy

Utenti
  • Posts

    131
  • Joined

  • Last visited

Posts posted by Maxy

  1. Per visualizzare gli interni di un edificio non basterebbe fare uno stamp della casa e appiccicarlo come picture e sotto mapparci l'interno della casa? Poi quando l'eroe entra la picture sparisce e mostra l'interno sisi.gif

     

    Ci può stare benissimo se ne devi fare una sola e se hai il tileset con sia l'interno che l'esterno (cosa rimediabile facilissimamente)

     

    Immagina però di muoverti su di una barca, la quale si muove rispetto al mondo tutto, oppure pensa a grotte su più livelli... lì è il bello.

     

    Sfortunatamente la script è in costante miglioramento, ma essendo lungo quasi 1500 righe, trovare gli errori e correggerli ogni volta è un'impresa...

     

    Grazie per il tuo interessamento, provalo e dimmi come ti trovi! Sono tutte informazioni che mi servono per migliorare lo script. Se hai domande (anche cavolate) sono a tua disposizione!

     

    PS: Anch'io voglio due stelline!!

  2. Bene! Spero ti piaccia!

     

    In ogni caso ho migliorato il codice, ho inserito nuovi comandi!

     

    Se hai delle domande della serie "come si fa?" sono a tua disposizione

     

    EDIT: Ho rimigliorato il codice. Adesso puoi fare in modo che le sottomappe si muoveno assieme ad un evento.

  3. @messiahofKH

     

    Hai presente Sacred? Ogni volta che entri in una casa, ti mostra l'interno senza cambiare mappa. Lo script permette di fare questo (e anche altro).

     

    Praticamente hai a disposizione tutte le mappe che vuoi, ma contemporaneamente. Guardian ha capito e sa spiegare molto meglio di me.

     

    Lo script ha numerosi bugs: l'ho messo a disposizione affinchè qualcuno lo provi e ne trovi il più possibile.

     

    A breve una demo

  4. ?

    Sono modificabili anche le non sottomappe XD, intendi in game? XD

     

    No, sono io che evidentemente ho fortissimi problemi comunicativi. Intedo dire che si possono cambiare in game: cioè se prima visualizzavo una prateria senza nulla, in un secondo momento posso visualizzarci una casa in costruzione, poi una casa costruita, poi la casa distrutta, poi di nuovo la prateria, poi un castello ecc ecc...

     

    "modificabili" non era la parola adatta

  5. Il lag non da troppi problemi, almeno non con troppe mappe.

     

    cosa cambia tra questo ed avere un tileset lungo infinito? Nulla? Cioè gli eventi vengono caricati tutti insieme sulla mappa o a mano a mano che entri nelle sottomappe?

     

    Cambia che le sottomappe sono modificabili, cioè se io decidessi di erigere una casa in un certo posto, potrei disegnare la casa su un'altra mappa e poi richiamarla in qualsiasi momento del gioco, inotre potrei cambiarla in un'altra mappa quando mi pare: da usare per mostrare le fondamenta di una casa dopo che è stata distrutta, per esempio.

     

    Inoltre sto lavorando per far in modo che le mappe si muovano (con la prossima versione dello script le navi potranno salpare e muoversi, per adesso galleggiano solo)

     

    Gli eventi vengono caricati quando viene caricata la sottomappa, ma non funzioneranno a meno chè l'eroe non si trovi sulla loro stessa mappa, poichè ho fatto in modo che l'interpreter funzioni solo sulla mappa in cui si trova l'eroe. In questo modo però non ho lasciato che si caricassero i processi paralleli (altrimenti sarebbero partiti tutti insieme). Li aggiusterò nella prossima versione, se ci riesco.

  6. Script Multimap

    Descrizione

    Il vostro giuoco è talmente fico che una mappa sola alla volta non vi basta?

    Bene! Questo script allega alla mappa principale delle sottomappe, da voi costruite.

     

    Potete creare un'abitazione e poi visualizzarla più volte su di una stessa mappa per farvi una città. Poi potete raderla al suolo. Poi potete mettere delle barche su una mappa con terreno innevato. Poi potete raderla al suolo. Potete visualizzare l'interno di una casa senza cambiare mappa. Poi potete raderla al suolo. Potete creare uno sfondo dietro la vostra mappa. Poi potete raderlo al suolo. Potete addentrarvi nelle grotte su più livelli o sugli alberi.

    Gli alberi non si radono al suolo perchè la natura si deve rispettare.

     

    Autore

    by Maxy

     

    Screen

    Il mapping non è il mio forte...

     

     

     

    Istruzioni per l'uso

    Sono nello script, ma ne riassumo l'idea generale:

     

    Per dichiarare che in una certa mappa ci sarà una sottomappa prendiamo un evento (va bene qualsiasi) e nominiamolo "submap[X]" dove al posto della X c'è un attributo che determina la passabilità e la posizione della sottomappa, se in primo piano o dietro.

     

    Qui abbiamo solo detto che esiste una nuova submap. L'ID della submap conincide con l'ID dell'evento su cui l'avete creata (l'evento mi serve solo per questo, poi può fare quello che gli pare)

     

    Per visualizzare la mappa però dovete usare il comando "change_submap" sulla mappa che possiede come allegata la sottomappa che volete cambiare/visualizzare, come spiegato nello script. Asieme alla sottomappa vengono creati anche dei "sottoeventi" i quali sono visibili come grafica, ma non eseguibili.

     

    Potete cambiare le sottomappe quando volete.

     

    NEW Potete anche assegnare ad una mappa un evento, in modo che la mappa si muova con esso. In questo modo si possono far salpare le navi, ad esempio.

     

     

    Script Multimap - aggiornato al 30/9/2011

     

    #-------------------------------------------------------------------------------
    # MultiMap
    #-------------------------------------------------------------------------------
    # di Maxy
    #-------------------------------------------------------------------------------
    # Permette di usare contemporaneamente più mappe
    #-------------------------------------------------------------------------------
    # In Game_Map rimpiazzare la riga 76 con questa riga
    #
    #	  @events[i] = Game_Event.new(@map_id, @map.events[i],@address)
    #
    #-------------------------------------------------------------------------------
    # Attributi sottomappa (gestiscono la passabilità tra la sottomappamappa e sua
    #					   madre, da impostare alla creazione della sottomappa)
    # ""  = una casella è passabile se lo è in tutte e due le mappe 
    #	   (standard, con la giocabilità che si fonde con la mappa madre)
    # "A" = una casella è passabile se e solo se è passabile nella mappa madre 
    # "B" = una casella è passabile se e solo se è passabile nella sottomappa
    # "C" = una casella è passabile se e solo se è passabile nella mappa madre
    #	   la sottomappa verrà disegnata in una nuova viewport davanti
    #	   (pertanto sarà anche in primo piamo) (es: se passo sotto un ponte molto alto)
    # "D" = una casella è passabile se e solo se è passabile nella sottomappa
    #	   la sottomappa verrà disegnata in una nuova viewport davanti
    #	   (pertanto sarà anche in primo piamo) (es: per gli interni delle case)
    # "E" = una casella è passabile se e solo se è passabile nella mappa madre
    #	   la sottomappa verrà disegnata in una nuova viewport dietro
    #	   (pertanto sarà in secondo piamo) (es: se passo sopra un ponte molto alto)
    # "F" = una casella è passabile se e solo se è passabile nella sottomappa
    #	   la sottomappa verrà disegnata in una nuova viewport dietro
    #	   (pertanto sarà in secondo piamo) (es: per entrare in miniere,
    #		ma senza che si veda l'interno della miniera)
    # "N" = apposta per le navi: se nel livello più basso della sottomappa il tile è vuoto (tile_id=0)
    #	   la passabilità è decisa dalla mappa madre (perchè sono fuori dalla nave)
    #	   altrimenti la passabilità è decisa dalla sottomappa (dove c'è la nave)
    # "M" = come N, ma con la mappa che "galleggia"
    #-------------------------------------------------------------------------------
    #C'è la possibilità di incapsulare più mappe
    #
    #-------------------------------------------------------------------------------
    # Istruzioni
    #		   Per istituire le sottomappe scegliere un evento e cambiare il nome
    #		   dell'evento in "submap" seguito dalla lettere di un eventuale attributo
    #		   per es: "submap[N]" inizializzerà una sottomappa con l'attributo N
    #
    #		   La sottomappa impostata avrà ID pari all'ID dell'evento e fino a
    #		   comando contrario sarà vuota
    #
    #		   Per settare la sottomappa ad esempio allegata a "$game_map" scrivere la linea di codice
    #			 $game_map.change_submap(ID,numerodellamappa,coord_x,coord_y)
    #		   dove
    #			 ID: l'ID della sottomappa di $game_map(pari all'ID dell'evento che l'ha inizializzata)
    #			 numeromappa: il numero della mappa dalla quale prenderà le informazioni
    #						  sui tiles e gli eventi
    #			 coord_x e coord_y: la posizione della submap rispetto alla mappa $game_map
    #			 
    #			 "$game_map" può essere sostituito da qualsiasi sottomappa.
    #
    #		   Negli eventi, per brevità si possono usare i comandi seguenti.
    #		   Tutti i comandi si intendono riferiti alla mappa in cui è l'eroe
    #
    #			 - change_submap(ID,numerodellamappa,coord_x,coord_y)
    #			 - change_thismap(numerodellamappa,coord_x,coord_y)
    #			 - change_supermap(numerodellamappa,coord_x,coord_y)
    #
    #		   Per fare in modo che l'eroe vada in una sottomappa con id = 7 il codice è
    #			 $game_player.new_submap=7
    #			 $game_player.changing_submap=true
    #		   Oppure negli eventi
    #			 player_change_submap(id_submap)
    #
    #		   Per fare in modo che l'eroe ritorni nella sopramappa 
    #			 $game_player.new_submap=-n
    #			 $game_player.changing_submap=true
    #		   il numero n indica di quante sopramappe si deve risalire
    #		   Oppure negli eventi
    #			 player_change_submap(-n)
    #
    #		   Il comando player_change_submap va usato prima di cambiare la mappa 
    #		   in cui si trova l'eroe, altrimenti il gioco funzionerà lo stesso,
    #		   ma le coordinate del player non cambieranno correttamente
    #
    #		   Per ancorare una mappa ad un evento usare il comando
    #			 lock_submap_event(id_submap,id_event)
    #		   L'evento a cui si ancora la mappa deve essere nella mappa principale
    #		   Per sbloccarlo usare
    #			 unlock_submap(id_submap)
    #-------------------------------------------------------------------------------
    # Note:
    #	   La passabilità dell'eroe è influenzata dalla mappa in cui è e dalle sue
    #	   sottomappe, non dalle sopramappe: come è influenzata dipende dall'attributo
    #
    #	   Gli eventi funzionano SOLO nella mappa in cui è l'eroe, non nelle sottomappe
    #	   o sopramappe
    #
    #	   La disposizione sullo schermo dell'eroe dipende anche dalla mappa su cui si trova
    #
    #	   Tutte le misure di posizione si riferiscono alla mappa in cui si trova
    #	   l'evento che esegue le misurazioni
    #
    #-------------------------------------------------------------------------------
    #Bugs
    #
    #	Alcune volte, dopo un passaggio da una mappa ad un'altra, bisogna cliccare
    #	due volte anzichè una su un evento prima che questo agisca.
    #
    #	I processi paralleli nelle sottomappe non funzionano (perchè non si attivano),
    #	gli inizi automatici sì
    #
    #	problemi nel movimento verso l'eroe
    #
    NULL_MAP = RPG::Map.new(0,0)
    MAX_DEPTH = 3 # massima profondità di mappe incapsulate, non esagerare
    #-------------------------------------------------------------------------------
    
    class Game_Map
     
     #modifico la game map
     attr_reader :depth
     attr_reader :attr
     attr_reader :submaps
     attr_reader :display_ox
     attr_reader :display_oy
     attr_reader :x
     attr_reader :y
     attr_reader :address  
     
     alias initialize2 initialize
     def initialize
    @submaps={}
    @depth=0
    @attr=""
    @display_ox=0
    @display_oy=0
    @x=0
    @y=0
    @address = ""
    initialize2
     end
     
     
     
     alias setup2 setup
     def setup(map_id)
    setup2(map_id)
    #	@submaps.clear
    if @depth < MAX_DEPTH
    for i in @map.events.keys
      if @map.events[i].name.downcase.include?("submap") #trova il trigger della sottomappa
    
    	@map.events[i].name =~ /\[([A-Z])\]/i
    	
    	@submaps[i]=Game_Submap.new(i,@depth+1,@address + "[" + i.to_s + "]",$1.to_s) #il key della mappa è lo stesso dell'evento (per non incasinare gli indici)
      end
      
    end
    end
     end
     
    #--------------------------------------------------------------------------
     
     alias update2 update
     def update
    update2
      for m in @submaps.values
    	m.display_ox = @display_x
    	m.display_oy = @display_y
    	m.update
     end
     end
    
     def update_coord
     for m in @submaps.values
       m.display_ox =@display_x
       m.display_oy =@display_y
       m.update_coord
     end
      end
     
     alias scroll_down2 scroll_down
     def scroll_down(distance)
    scroll_down2(distance)
    update_coord
     end
     alias scroll_left2 scroll_left
     def scroll_left(distance)
    scroll_left2(distance)
    update_coord
     end
     alias scroll_right2 scroll_right
     def scroll_right(distance)
    scroll_right2(distance)
    update_coord
     end
     alias scroll_up2 scroll_up
     def scroll_up(distance)
    scroll_up2(distance)
    update_coord
     end
     
    
      
     alias refresh2 refresh
     def refresh
    refresh2
     for m in @submaps.values
       m.refresh
     end
      end
      
    # Qui le priorità e la passabilità
    
     
     alias passable2? passable?
     def passable?(x, y, d, self_event = nil)
      
    for m in @submaps.values
      if m.valid?(x-m.x, y-m.y)
    	if ["B","D","F"].include?(m.attr) or (["N","M"].include?(m.attr) and m.data[x-m.x, y-m.y,0] != 0)
    	  return m.passable?(x-m.x, y-m.y, d)
    	  
    	elsif ["A","C","E"].include?(m.attr)# or (["N","M"].include?(m.attr) and m.data[x-m.x, y-m.y,0] == 0)
    
    	elsif not(m.passable?(x-m.x, y-m.y, d))
    	  return false
    	end
      end
    end
    return passable2?(x, y, d, self_event = nil)
     end
     
     alias terrain_tag2 terrain_tag
     def terrain_tag(x, y)
    for m in @submaps.values
      if m.valid?(x-m.x, y-m.y)
    	if ["B","D","F"].include?(m.attr)
    	  return m.terrain_tag(x-m.x, y-m.y)
    	elsif ["A","C","E"].include?(m.attr)
    	else
    	  unless m.terrain_tag(x-m.x, y-m.y)
    		return false
    	  end
    	end
      end
    end
    return terrain_tag2(x, y)
     end
     
    
    #----------------------------
     def change_submap(id_submap,id_map,x=-1000,y=-1000)
    if @submaps.include?(id_submap) and @submaps[id_submap].is_a?(Game_Submap)
      if id_map != @submaps[id_submap].map_id
    	  @submaps[id_submap].setup(id_map,x,y)
      else
    #		if valid?(x,y)
    	  @submaps[id_submap].set_coord(x,y)
    #		end
      end
    end
    update
     end
    #----------------------------
     
     def[](id_submap)
    return self.submaps[id_submap]
     end
     
     def subevents # non mettere il value
    a = @events.values
    for m in @submaps.values
      a = a + m.subevents
    end
    return a
     end
    
    end
    
    #-------------------------------------------------------------------------------
    
    class Game_Submap < Game_Map
     
    #####  
     attr_reader   :id
     attr_reader   :height
     attr_reader   :width
     attr_accessor :locked_to
     attr_reader   :attr
     attr_accessor :display_ox #il display della sopramappa
     attr_accessor :display_oy
     
    #####
    
    
     def initialize(id,depth,address,attr="")
    @id=id
    @depth=depth
    @attr=attr
    @map_id = 0
    @display_x = 0
    @display_y = 0
    @display_ox = 0
    @display_oy = 0
    @submaps={}
    @attr=attr
    @locked_to=0
    @address = address
    setup(0)
    
     end
     
     
     def setup(map_id,x=0,y=0)
    
    @map_id = map_id
    if @map_id != 0
      super(@map_id)
      @height=@map.height
      @width = @map.width
      @map.data.resize($game_map.width,$game_map.height,3)
      #riadattare le dimensioni serve ad evitare il loop della tilemap
    else
      @map = NULL_MAP
      tileset = $data_tilesets[@map.tileset_id]
      @tileset_name = tileset.tileset_name
      @autotile_names = tileset.autotile_names
      @battleback_name = tileset.battleback_name
      @passages = tileset.passages
      @priorities = tileset.priorities
      @terrain_tags = tileset.terrain_tags
      @need_refresh = false
      @events = {}
      @height=0
      @width =0
      @scroll_direction = 2
      @scroll_rest = 0
      @scroll_speed = 4
      
      #Nota: non ho voluto camcellare le submaps. Questo vuol dire che de 
      #una mappa viene annullata, comunque le sottomappe resteranno
      
      # ho riportato solo le cose necessarie, mancano ad esempio le fog e tutto
      #il resto... che tanto non userò
    end
    
    #spostamento dalle coordinate della mappa di sopra
    @x=x
    @y=y
    @display_x=-x*128
    @display_y=-y*128
     end
     
    #  def data
    #	return @map.data
    #  end
    
     #--------------------------------------------------------------------
     def set_attr(at="")
    if @attr!=at
      @attr=at
      @need_refresh=true
    end
     end
     
     def set_coord(x,y)
    @x=x
    @y=y
    @display_x=-x*128
    @display_y=-y*128
     end
     #---------------------------------------------------------------------  
     def valid?(x, y)
    return (x >= 0 and x < width and y >= 0 and y < height)
     end
     #---------------------------------------------------------------------
     
     def width
    return @width
     end
     def height
    return @height
     end
     
     #---------------------------------------------------------------------
    #  def passable?(x, y, d, self_event = nil)
    #	return super(x-@x, y-@y, d, self_event = nil)
    #  end
     #--------------------------------------------------------------------------
     def update_coord
     for m in @submaps.values
       m.display_ox = @display_ox +@display_x
       m.display_oy = @display_oy +@display_y
       m.update_coord
     end
      end
    
      
      
     def update
    # 必要ならマップをリフレッシュ
    if self.need_refresh
      refresh
    end
    #	if @scroll_rest > 0
    #	  # スクロール速度からマップ座標系での距離に変換
    #	  distance = 2 ** @scroll_speed
    #	  # スクロールを実行
    #	  case @scroll_direction
    #	  when 2  # 下
    #		scroll_down(distance)
    #	  when 4  # 左
    #		scroll_left(distance)
    #	  when 6  # 右
    #		scroll_right(distance)
    #	  when 8  # 上
    #		scroll_up(distance)
    #	  end
    #	  # スクロールした距離を減算
    #	  @scroll_rest -= distance
    #	end
    if @locked_to != 0 #se la posizionedipende da un character
      @x=$game_map.events[@locked_to].x
      @y=$game_map.events[@locked_to].y
      @display_x = -$game_map.events[@locked_to].real_x
      @display_y = -$game_map.events[@locked_to].real_y
    else
      @display_x = -x*128
      @display_y = -y*128
    end
    
    
    if @attr == "M"
      
      @display_y +=(16*Math.cos(0.0314*Graphics.frame_count)).to_i
    
    end
    
    for event in @events.values
      event.update
    end
    
    for m in @submaps.values
      m.display_ox = @display_ox + @display_x
      m.display_oy = @display_oy + @display_y
      m.update
    end
    
     end
     
     
     def refresh
    # マップ ID が有効なら
    if @map_id > 0
      # すべてのマップイベントをリフレッシュ
      for event in @events.values
    	event.refresh
      end
    end
    # リフレッシュ要求フラグをクリア
    @need_refresh = false
     end
    #-----------------------------------------------------------------------------
    #  def bush?(x,y)
    #	return super(x-@x, y-@y)
    #  end
    #  def terrain_tag(x,y)
    #	return super(x-@x, y-@y)
    #  end
    #  def check_event(x,y)
    #	return super(x-@x, y-@y)
    #  end
    
    end
    
    #-------------------------------------------------------------------------------
    
    class Spriteset_Map
     
     alias initialize2 initialize
     def initialize
    
    @subspriteset = {}
    
    initialize2
    
    for key in $game_map.submaps.keys
      @subspriteset[key] = Spriteset_Submap.new(@viewport1,$game_map.submaps[key])
    end
    
    
    update
    
    
     end
     
     
     alias dispose2 dispose
     def dispose
    for s in @subspriteset.values
      s.dispose
    end
    dispose2
     end
    
     
     alias update2 update
     def update
    update2
    for s in @subspriteset.values
      s.update
    end
    
    
     end
    
    end
    
    #-------------------------------------------------------------------------------
    
    class Spriteset_Submap # stavolta non è sottoclasse
     
    #  attr_reader :map #game_submap da mostrare
    #  attr_reader :subspriteset
     
     def initialize(viewport,map)
    
    @map=map
    @map_id=@map.map_id
    
    @attr=@map.attr
    if @attr == "C" or @attr == "D"
      @viewport=Viewport.new(0, 0, 640, 480)
      @viewport.z = viewport.z + 1
    elsif
      @attr == "E" or @attr == "F"
      @viewport=Viewport.new(0, 0, 640, 480)
      @viewport.z = viewport.z - 1
    else
      @viewport=viewport
    end
    
    draw_map
    
    update
     end
     
     def draw_map
    @tilemap = Tilemap.new(@viewport) #nuovo tilemap!
    @tilemap.tileset = RPG::Cache.tileset(@map.tileset_name)
    for i in 0..6
      autotile_name = @map.autotile_names[i]
      @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
    end
    @tilemap.map_data = @map.data
    @tilemap.priorities = @map.priorities
    @character_sprites = []
    for i in @map.events.keys.sort
      sprite = Sprite_Character.new(@viewport, @map.events[i])
      @character_sprites.push(sprite)
    end
    @player_sprite=Sprite_Character.new(@viewport, $game_player)
    @subspriteset = {}
    for key in @map.submaps.keys
      @subspriteset[key] = Spriteset_Submap.new(@viewport,@map.submaps[key])
    end
     end
     
     
     def dispose
    for s in @subspriteset.values
      s.dispose
    end
    @tilemap.dispose
    for sprite in @character_sprites
      sprite.dispose
    end
    @player_sprite.dispose
     end
     
     def clear_map
    for s in @subspriteset.values
      s.dispose
    end
    @tilemap.dispose #qui uccido il tilemap vecchio
    for sprite in @character_sprites
      sprite.dispose
    end
    @player_sprite.dispose
     end
     
     def update
    
    if @map.map_id != @map_id
      clear_map
      @map_id=@map.map_id
      draw_map
    end
    if @map_id > 0
      @tilemap.ox = (@map.display_ox + @map.display_x) / 4 #da aggiustare
      @tilemap.oy = (@map.display_oy + @map.display_y) / 4 #da aggiustare
      @tilemap.update
      for sprite in @character_sprites
    	sprite.update
      end
    end
    
    @player_sprite.update
    @player_sprite.visible = ($game_player.map==@map)
    
    for spr in @subspriteset.values
      spr.update
    end
     end
     
    end
    
    
    class Sprite_Character
     alias updt2 update
     def update
    updt2
    if @character == $game_player
      self.visible = ($game_player.addr=="")
    end
     end
    end
    
    
    
    #-------------------------------------------------------------------------------
    
    class Game_Character
     attr_reader :addr #l'indirizzo della mappa a cui appartiene
     
     
     alias initialize2 initialize
     def initialize(addr="")
    @addr=addr
    initialize2
     end
     
     def map
    #	if self.addr.to_s != "" 
    #	 p "$game_map" + self.addr.to_s
     #  end
    return eval("$game_map" + self.addr.to_s)
    #	return result
     end
     
     alias screen_x2 screen_x
     def screen_x
    # Get screen coordinates from real coordinates and map display position
    return (@real_x - map.display_ox - map.display_x + 3) / 4 + 16
     end
     #--------------------------------------------------------------------------
     # * Get Screen Y-Coordinates
     #--------------------------------------------------------------------------
     alias screen_y2 screen_y
     def screen_y
    # Get screen coordinates from real coordinates and map display position
    y = (@real_y - map.display_oy - map.display_y + 3) / 4 + 32
    # Make y-coordinate smaller via jump count
    if @jump_count >= @jump_peak
      n = @jump_count - @jump_peak
    else
      n = @jump_peak - @jump_count
    end
    return y - (@jump_peak * @jump_peak - n * n) / 2
     end
     #--------------------------------------------------------------------------
     # * Get Screen Z-Coordinates
     #	 height : character height
     #--------------------------------------------------------------------------
     alias screen_z2 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 - map.display_oy - map.display_y + 3) / 4 + 32
    # If tile
    if @tile_id > 0
      # Add tile priority * 32
      return z + map.priorities[@tile_id] * 32
    # If character
    else
      # If height exceeds 32, then add 31
      return z + ((height > 32) ? 31 : 0)
    end
     end
    
     
     alias moveto2 moveto
     def moveto(x, y)
    @x = (map.width==0 ? x : x % map.width)
    @y = (map.height==0 ? y : y % map.height)
    @real_x = @x * 128
    @real_y = @y * 128
    @prelock_direction = 0
     end
     
     
     
     #--------------------------------------------------------------------------
     # * Get Thicket Depth
     #--------------------------------------------------------------------------
     alias bush_depth2 bush_depth
     def bush_depth
    # If tile, or if display flag on the closest surface is ON
    if @tile_id > 0 or @always_on_top
      return 0
    end
    # If element tile other than jumping, then 12; anything else = 0
    if @jump_count == 0 and map.bush?(@x, @y)
      return 12
    else
      return 0
    end
     end
     #--------------------------------------------------------------------------
     # * Get Terrain Tag
     #--------------------------------------------------------------------------
     alias terrain_tag2 terrain_tag
     def terrain_tag
    return map.terrain_tag(@x, @y)
     end
    
     
     #-passabilità-----------------------------------------------------------------
     
     def passable?(x, y, d)
    # Get new coordinates
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    # If coordinates are outside of map
    unless map.valid?(new_x, new_y)
      # impassable
      return false
    end
    # If through is ON
    if @through
      # passable
      return true
    end
    # If unable to leave first move tile in designated direction
    unless map.passable?(x, y, d, self)
      # impassable
      return false
    end
    # If unable to enter move tile in designated direction
    unless map.passable?(new_x, new_y, 10 - d)
      # impassable
      return false
    end
    # Loop all events
    for event in map.events.values #non c'è bisogno se su usa subevents
      # If event coordinates are consistent with move destination
      if event.x == new_x and event.y == new_y
    	# If through is OFF
    	unless event.through
    	  # If self is event
    	  if self != $game_player
    		# impassable
    		return false
    	  end
    	  # With self as the player and partner graphic as character
    	  if event.character_name != ""
    		# impassable
    		return false
    	  end
    	end
      end
    end
    # If player coordinates are consistent with move destination
    if $game_player.addr == @addr and $game_player.x == new_x and $game_player.y == new_y
      # If through is OFF
      unless $game_player.through
    	# If your own graphic is the character
    	if @character_name != ""
    	  # impassable
    	  return false
    	end
      end
    end
    # passable
    return true
     end
    
     
     
     alias move_type_toward_player2 move_type_toward_player
     def move_type_toward_player
    if $game_player.addr == @addr
      move_type_toward_player2
    end
     end
     alias move_toward_player2 move_toward_player
     def move_toward_player
    if $game_player.addr == @addr
      move_toward_player2
    end
     end
     alias move_away_from_player2 move_away_from_player
     def move_away_from_player
    if $game_player.addr == @addr
      move_away_from_player2
    end
     end
     alias turn_toward_player2 turn_toward_player
     def turn_toward_player
    if $game_player.addr == @addr
      turn_toward_player2
    end
     end
     alias turn_away_from_player2 turn_away_from_player
     def turn_away_from_player
    if $game_player.addr == @addr
      turn_away_from_player2
    end
     end  
     
     
    end
    
    
    
    
    
    
    class Game_Event < Game_Character
     
     alias ini initialize
     def initialize(map_id, event, addr = "")
    super(addr)
    @map_id = map_id
    @event = event
    @id = @event.id
    @erased = false
    @starting = false
    @through = true
    # Move to starting position
    moveto(@event.x, @event.y)
    refresh
     end
     
     alias over_trigger2? over_trigger?
     def over_trigger?
    # If not through situation with character as graphic
    if @character_name != "" and not @through
      # Starting determinant is face
      return false
    end
    # If this position on the map is impassable
    unless map.passable?(@x, @y, 0) #ho cambiato qui
      # Starting determinant is face
      return false
    end
    # Starting determinant is same position
    return true
     end
    
     
     alias start2 start
     def start
    if $game_player.addr == @addr
      if @list.size > 1
    	@starting = true
      end
    end
     end
    
     alias upd update
     def update
    if $game_player.addr == @addr
      upd
    else
      super
    end
     end
     
     alias refresh2 refresh
     def refresh
    # Initialize local variable: new_page
    new_page = nil
    # If not temporarily erased
    unless @erased
      # Check in order of large event pages
      for page in @event.pages.reverse
    	# Make possible referrence for event condition with c
    	c = page.condition
    	# Switch 1 condition confirmation
    	if c.switch1_valid
    	  if $game_switches[c.switch1_id] == false
    		next
    	  end
    	end
    	# Switch 2 condition confirmation
    	if c.switch2_valid
    	  if $game_switches[c.switch2_id] == false
    		next
    	  end
    	end
    	# Variable condition confirmation
    	if c.variable_valid
    	  if $game_variables[c.variable_id] < c.variable_value
    		next
    	  end
    	end
    	# Self switch condition confirmation
    	if c.self_switch_valid
    	  key = [@map_id, @event.id, c.self_switch_ch]
    	  if $game_self_switches[key] != true
    		next
    	  end
    	end
    	# Set local variable: new_page
    	new_page = page
    	# Remove loop
    	break
      end
    end
    # If event page is the same as last time
    if new_page == @page
      # End method
      return
    end
    # Set @page as current event page
    @page = new_page
    # Clear starting flag
    clear_starting
    # If no page fulfills conditions
    if @page == nil
      # Set each instance variable
      @tile_id = 0
      @character_name = ""
      @character_hue = 0
      @move_type = 0
      @through = true
      @trigger = nil
      @list = nil
      @interpreter = nil
      # End method
      return
    end
    # Set each instance variable
    @tile_id = @page.graphic.tile_id
    @character_name = @page.graphic.character_name
    @character_hue = @page.graphic.character_hue
    if @original_direction != @page.graphic.direction
      @direction = @page.graphic.direction
      @original_direction = @direction
      @prelock_direction = 0
    end
    if @original_pattern != @page.graphic.pattern
      @pattern = @page.graphic.pattern
      @original_pattern = @pattern
    end
    @opacity = @page.graphic.opacity
    @blend_type = @page.graphic.blend_type
    @move_type = @page.move_type
    @move_speed = @page.move_speed
    @move_frequency = @page.move_frequency
    @move_route = @page.move_route
    @move_route_index = 0
    @move_route_forcing = false
    @walk_anime = @page.walk_anime
    @step_anime = @page.step_anime
    @direction_fix = @page.direction_fix
    @through = @page.through
    @always_on_top = @page.always_on_top
    @trigger = @page.trigger
    @list = @page.list
    @interpreter = nil
    # If trigger is [parallel process]
    if $game_player.addr == @addr
      if @trigger == 4
    	# Create parallel process interpreter
    	@interpreter = Interpreter.new
      end
      # Auto event start determinant
      check_event_trigger_auto
    end
     end
     
     
    end
    
    
    #-------------------------------------------------------------------------------
    
    
    
    class Game_Player
     
     attr_accessor :new_submap
     attr_accessor :changing_submap
     attr_accessor :submap_old_x
     attr_accessor :submap_old_y
     
     def initialize
    super
    @new_submap = 0
    @changing_submap = false
    @submap_old_x = 0
    @submap_old_y = 0
     end
     
     def center_player
    if  @real_y -map.display_oy- map.display_y> CENTER_Y
      # Scroll map down
      $game_map.scroll_down(@real_y -map.display_oy- map.display_y - CENTER_Y)
    end
    # If character moves left and is positioned more let on-screen than
    # center
    if  @real_x -map.display_ox-map.display_x< CENTER_X
      # Scroll map left
      $game_map.scroll_left(@real_x -map.display_ox-map.display_x - CENTER_X)
    end
    # If character moves right and is positioned more right on-screen than
    # center
    if @real_x -map.display_ox-map.display_x > CENTER_X
      # Scroll map right
      $game_map.scroll_right(@real_x -map.display_ox-map.display_x - CENTER_X)
    end
    # If character moves up and is positioned higher than the center
    # of the screen
    if @real_y -map.display_oy-map.display_y < CENTER_Y
      # Scroll map up
      $game_map.scroll_up(@real_y -map.display_oy-map.display_y - CENTER_Y)
    end
    
     end
     
     def downmap(id_submap)
    
    if map.submaps.has_key?(id_submap)
      @addr = @addr + "[" + id_submap.to_s+ "]"	#@map=@map.submaps[id_submap]
      @x -= map.x
      @y -= map.y
      @real_x -= 128*map.x
      @real_y -= 128*map.y
    #	  update
    else
      p "no submap"
    end
     end
     def upmap
    if @addr != ""
      @x += @submap_old_x
      @y += @submap_old_y
      @real_x += 128*@submap_old_x
      @real_y += 128*@submap_old_y
      @addr = @addr.sub(/\[[0-9]*\]\z/){|s| ""}
      @submap_old_x = map.x
      @submap_old_y = map.y
    #	  update
    else
      p "no upmap"
    end
     end
     #
     
     alias pass? passable?
     def passable?(x, y, d)
    # Get new coordinates
    new_x = @x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = @y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    # If coordinates are outside of map
    unless map.valid?(new_x, new_y)
      # Impassable
      return false
    end
    # If debug mode is ON and ctrl key was pressed
    if $DEBUG and Input.press?(Input::CTRL)
      # Passable
      return true
    end
    super
     end
     
     
     
     alias checkeventtriggerhere check_event_trigger_here
     def check_event_trigger_here(triggers)
    result = false
    # If event is running
    if $game_system.map_interpreter.running?
      return result
    end
    # All event loops
    for event in map.events.values
      # If event coordinates and triggers are consistent
      if event.x == @x and event.y == @y and triggers.include?(event.trigger)
    	# If starting determinant is same position event (other than jumping)
    	if not event.jumping? and event.over_trigger?
    	  event.start
    	  result = true
    	end
      end
    end
    return result
     end
    
     
     
     alias checkeventtriggerthere check_event_trigger_there
     def check_event_trigger_there(triggers)
    result = false
    # If event is running
    if $game_system.map_interpreter.running?
      return result
    end
    # Calculate front event coordinates
    new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
    new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
    # All event loops
    for event in map.events.values
      # If event coordinates and triggers are consistent
      if event.x == new_x and event.y == new_y and
    	 triggers.include?(event.trigger)
    	# If starting determinant is front event (other than jumping)
    	if not event.jumping? and not event.over_trigger?
    	  event.start
    	  result = true
    	end
      end
    end
    # If fitting event is not found
    if result == false
      # If front tile is a counter
      if map.counter?(new_x, new_y)
    	# Calculate 1 tile inside coordinates
    	new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)
    	new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)
    	# All event loops
    	for event in @map.events.values
    	  # If event coordinates and triggers are consistent
    	  if event.x == new_x and event.y == new_y and
    		 triggers.include?(event.trigger)
    		# If starting determinant is front event (other than jumping)
    		if not event.jumping? and not event.over_trigger?
    		  event.start
    		  result = true
    		end
    	  end
    	end
      end
    end
    return result
     end
     #--------------------------------------------------------------------------
     # * Touch Event Starting Determinant
     #--------------------------------------------------------------------------
     alias checkeventtriggertouch check_event_trigger_touch
     def check_event_trigger_touch(x, y)
    result = false
    # If event is running
    if $game_system.map_interpreter.running?
    #	  p "event running error"
      return result
    end
    # All event loops
    for event in map.events.values
      # If event coordinates and triggers are consistent
      if event.x == x and event.y == y and [1,2].include?(event.trigger)
    	# If starting determinant is front event (other than jumping)
    	if not event.jumping? and not event.over_trigger?
    	  event.start
    	  result = true
    	end
      end
    end
    return result
     end
    
     
     
     #--------------------------------------------------------------------------
     # * Frame Update
     #--------------------------------------------------------------------------
     alias upd2 update
     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
      
      #qui si cambia la mappa-----------------
      if @changing_submap
    	if @new_submap < 0
    	  while @new_submap < 0
    		upmap
    		@new_submap +=1
    	  end
    	else
    	  downmap(@new_submap)
    	  @new_submap = 0
    	end
    	@changing_submap = false
    	$game_map.need_refresh
    #		center_player
    	return
      end
      #---------------------------------------
      
      case Input.dir4
      when 2
    	move_down
      when 4
    	move_left
      when 6
    	move_right
      when 8
    	move_up
      end
    end
    # Remember coordinates in local variables
    last_real_x = @real_x
    last_real_y = @real_y
    super
    # If character moves down and is positioned lower than the center
    # of the screen
    if @real_y > last_real_y and @real_y -map.display_oy- 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 -map.display_ox-map.display_x< CENTER_X
      # Scroll map left
      $game_map.scroll_left(last_real_x - @real_x)
    end
    # If character moves right and is positioned more right on-screen than
    # center
    if @real_x > last_real_x and @real_x -map.display_ox-map.display_x > CENTER_X
      # Scroll map right
      $game_map.scroll_right(@real_x - last_real_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 -map.display_oy-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
     
     
    end
    
    #-------------------------------------------------------------------------------
    
    class Interpreter
     
     alias setup2 setup
     def setup(list, event_id)
    # Clear inner situation of interpreter
    clear
    # Remember map ID
    @map_id = $game_player.map.map_id
    # Remember event ID
    @event_id = event_id
    # Remember list of event commands
    @list = list
    # Initialize index
    @index = 0
    # Clear branch data hash
    @branch.clear
     end
    
     alias setup_starting_event2 setup_starting_event
     def setup_starting_event
    # Refresh map if necessary
    if $game_player.map.need_refresh
      $game_player.map.refresh
    end
    # If common event call is reserved
    if $game_temp.common_event_id > 0
      # Set up event
      setup($data_common_events[$game_temp.common_event_id].list, 0)
      # Release reservation
      $game_temp.common_event_id = 0
      return
    end
    # Loop (map events)
    for event in $game_player.map.events.values
      # If running event is found
      if event.starting
    	# If not auto run
    	if event.trigger < 3
    	  # Clear starting flag
    	  event.clear_starting
    	  # Lock
    	  event.lock
    	end
    	# Set up event
    	setup(event.list, event.id)
    	return
      end
    end
    # Loop (common events)
    for common_event in $data_common_events.compact
      # If trigger is auto run, and condition switch is ON
      if common_event.trigger == 1 and
    	 $game_switches[common_event.switch_id] == true
    	# Set up event
    	setup(common_event.list, 0)
    	return
      end
    end
     end
     
     alias update2 update
     def update
    # Initialize loop count
    @loop_count = 0
    # Loop
    loop do
      # Add 1 to loop count
      @loop_count += 1
      # If 100 event commands ran
      if @loop_count > 100
    	# Call Graphics.update for freeze prevention
    	Graphics.update
    	@loop_count = 0
      end
      # If map is different than event startup time
      if $game_player.map.map_id != @map_id 
    	# Change event ID to 0
    	@event_id = 0
      end
      # If a child interpreter exists
      if @child_interpreter != nil
    	# Update child interpreter
    	@child_interpreter.update
    	# If child interpreter is finished running
    	unless @child_interpreter.running?
    	  # Delete child interpreter
    	  @child_interpreter = nil
    	end
    	# If child interpreter still exists
    	if @child_interpreter != nil
    	  return
    	end
      end
      # If waiting for message to end
      if @message_waiting
    	return
      end
      # If waiting for move to end
      if @move_route_waiting
    	# If player is forcing move route
    	if $game_player.move_route_forcing
    	  return
    	end
    	# Loop (map events)
    	for event in $game_player.map.events.values
    	  # If this event is forcing move route
    	  if event.move_route_forcing
    		return
    	  end
    	end
    	# Clear move end waiting flag
    	@move_route_waiting = false
      end
      # If waiting for button input
      if @button_input_variable_id > 0
    	# Run button input processing
    	input_button
    	return
      end
      # If waiting
      if @wait_count > 0
    	# Decrease wait count
    	@wait_count -= 1
    	return
      end
      # If an action forcing battler exists
      if $game_temp.forcing_battler != nil
    	return
      end
      # If a call flag is set for each type of screen
      if $game_temp.battle_calling or
    	 $game_temp.shop_calling or
    	 $game_temp.name_calling or
    	 $game_temp.menu_calling or
    	 $game_temp.save_calling or
    	 $game_temp.gameover
    	return
      end
      # If list of event commands is empty
      if @list == nil
    	# If main map event
    	if @main
    	  # Set up starting event
    	  setup_starting_event
    	end
    	# If nothing was set up
    	if @list == nil
    	  return
    	end
      end
      # If return value is false when trying to execute event command
      if execute_command == false
    	return
      end
      # Advance index
      @index += 1
    end
     end
    
     alias command_end2 command_end
     def command_end
    # Clear list of event commands
    @list = nil
    # If main map event and event ID are valid
    if @main and @event_id > 0
      # Unlock event
      $game_player.map.events[@event_id].unlock
    end
     end
    
     alias get_character2 get_character
     def get_character(parameter)
    # Branch by parameter
    case parameter
    when -1  # player
      return $game_player
    when 0  # this event
      events = $game_player.map.events
      return events == nil ? nil : events[@event_id]
    else  # specific event
      events = $game_player.map.events
      return events == nil ? nil : events[parameter]
    end
     end
    
     
     
     #--------------------------------------------------------------------------
     # * Erase Event
     #--------------------------------------------------------------------------
     alias command_116_2 command_116
     def command_116
    # If event ID is valid
    if @event_id > 0
      # Erase event
      $game_player.map.events[@event_id].erase
    end
    # Advance index
    @index += 1
    # End
    return false
     end
     
     #self-switch
     def command_123
    # If event ID is valid
    if @event_id > 0
      # Make a self switch key
      key = [$game_player.map.map_id, @event_id, @parameters[0]]
      # Change self switches
      $game_self_switches[key] = (@parameters[1] == 0)
    end
    # Refresh map
    $game_player.map.need_refresh = true
    # Continue
    return true
     end
    
     def change_submap(id_submap,id_map,x=0,y=0)
    $game_player.map.change_submap(id_submap,id_map,x,y)
     end
     def change_thismap(id_map,x=0,y=0)
    $game_player.map.setup(id_map,x,y)
     end
     def change_supermap(id_map,x=0,y=0)
    if $game_player.addr == ""
      return
    end
    a = $game_player.addr.clone
    a = a.sub(/\[[0-9]*\]\z/){|s| ""}
    eval("$game_map"+a+".setup("+id_map.to_s+","+x.to_s+","+y.to_s+")")
     end
     def player_change_submap(id_submap) #se è negativo sale di mappa
      $game_player.submap_old_x=$game_player.map.x
      $game_player.submap_old_y=$game_player.map.y
      $game_player.new_submap=id_submap
      $game_player.changing_submap=true
    end
     def lock_submap_event(id_submap,parameter=0)
    if $game_player.map.submaps.has_key?(id_submap) and get_character(parameter) != nil
      $game_player.map[id_submap].locked_to=parameter
    end
     end
     def unlock_submap(id_submap)
    if $game_player.map.submaps.has_key?(id_submap)
      $game_player.map[id_submap].locked_to=0
    end
     end
     
    end

     

     

     

    Bugs e Conflitti Noti

    Lo script è funzionante, ma lungi dall'essere perfetto. Sto cercando costantemente di migliorarlo, i vostri consigli sono molto preziosi.

    • Non partono i processi paralleli nelle sottomappe (lo sto fissando)

       

    • Qualche volta per azionare un evento nella sottomappa ci vogliono due pressioni di tasto

       

    • I teletrasporti funzionano male se processati da un evento non nella mappa principale

       

    • gli eventi che seguono l'eroe danno problemi (corretto)

       

      Aggiornerò la lista man mano che riceverò segnalazioni

     

    Altri Dettagli

    • Lo script allega ad una mappa altre sottomappe. Può anche allegare sottomappe ad altre sottomappe.

       

    • La passabilità dell'eroe è influenzata dalla mappa in cui è e dalle sue sottomappe, non dalle sopramappe: come è influenzata dipende dall'attributo che gli avete dato al momento della dichiarazione della sottomappa

       

    • Gli eventi funzionano SOLO nella mappa in cui è l'eroe, non nelle sottomappe o sopramappe

       

    • La disposizione sullo schermo dell'eroe dipende anche dalla mappa su cui si trova

       

    • Tutte le misure di posizione si riferiscono alla mappa in cui si trova l'evento che esegue le misurazioni

       

    • Fissati alcuni bugs delle sotto-sottomappe

       

    • Inseriti nuovi comandi per gli eventi

       

    • !! Inseriti i comandi per muovere le sottomappe !!

    Man mano che avrete dei chiarimenti da chiedermi, aggiornerò il post

     

     

    Appena possibile farò una demo, vi chiedo di pazientare ancora un po'...

  7. @Guardian of Irael: Scusa Guardian, so spiegarmi da cani...

     

     

    @TheVillAngel:

    ora però devo trovare i frame giusti per fare in modo di evitare quello scatto di fine-inizio animazione.

     

    Naaa, troppo complicato. Prova questo

     

    class Spriteset_Map
     alias update2 update
     def update
       update2
       @panorama.ox += $game_map.fog_ox/6
       @panorama.oy += $game_map.fog_oy/6
       end
    end
    

     

    Fa muovere il panorama assieme alla fog.

    Basta che cambi la velocità della fog, e anche il panorama la seguirà (occhio che funziona in tutte le mappe con fog che si muove)

  8. Scusami maxy ma non ho capito, sfumi direttamente il tileset o lo screen della mappa? O usi gli eventi per comporre la mappa e poter ridurre l'opacità?

     

    Sfoco il tileset: anzichè diventare buio andando verso il basso, diventa trasparente (io l'ho fatto con gimp, ad esempio). Niente eventi, niente di niente. Solo ho messo come panorama l'immagine della nebbia.

     

    Perchè volete sfumare il tileset? L'effetto nebbia non è quello di offuscare coprendo?

     

    Questa è l'idea! Per sfumare e far muovere la nebbia come dici tu, dovrei creare decine di immagini "nebbia" sfumate e leggermente traslate l'una dall'altra... Invece di sfumare mille volte un pezzo di nebbia, sfumo una volta il tileset, che tanto deve rimanere fermo... e poi se volessi cambiare nebbia, basterebbe cambiare l'immagine del panorama.

     

    EDIT: allego un'altra immagine dal titolo "allegri vapori balsamici dalle viscere della terra"

     

     

     

  9. Il trucco che ho usato è questo: invece di sfumare la fog, sfumi i tiles, che si sovrapporranno alla fog, ma l'effetto finale percepito è quello ddella fog che si sovrappone ai tiles (e senza usare una riga di codice, apparte per il movimento)
  10. fare in modo che un'immagine possa stare sotto il pg ma sopra a tutto il resto, in modo da poter mettere la fog sotto l'immagine e farci camminare su il pg

     

    Tecnicamente si può fare, però non è la soluzione migliore: la migliore che mi è venuta in mente è mettere la fog sotto i tile della mappa (che è una cavolata basta cambiare la viewport della fog e la sua z, forse non c'è nemmeno bisogno di cambiare la viewport...)

     

    Per il resto fai dei tile di parete rocciosa che sfumano verso il trasparente e li sotto si vedrà la fog...

    vedo se riesco a creare un'immagine e posto (magari poi verrà malissimo, bho)

     

    Ho trovato in rete questo http://www.youtube.com/watch?v=NEFT6iFqYkU

     

    EDIT

     

    Alla fine ho usato panorama e fog. Questo è come mi viene: (conta che si muovono)

     

     

     

  11. Bello lo screen, mi sembra di notare un errore nel mapping nella parete di roccia a destra del ponte, che non curva.

     

    L'effetto generale è molto bello, ma non capisco lo sfumato tra la nebbia e la parete rocciosa. Io avrei usato una trasparenza crescente della nebbia...

    Prova a mettere anche la nebbia sopra la mappa, secondo me darà un gran risultato!

     

    Come lo hai realizzato? Hai disegnato ogni frame (io avrei perso la pazienza)? Secondo me può venire più realistico in script. Se vuoi posso fare delle prove e vedere come viene.

  12. Ringrazio per i commenti!

     

    In sostanza lo script, da solo, non introduce il concetto domanda-offerta, però aiuta se uno vuole implementarlo (e lo rende implementabile anche tramite eventi e con lo shop standard di rpg maker xp).

     

    Lo script è talmente semplice, che non era il caso di includere demo, secondo me...

  13. Prezzi personalizzabili

     

    Descrizione

    Permette di assegnare ad oggetti, armi o armature un determinato prezzo, e cambiarlo durante il gioco, oppure associare al prezzo del bene una variabile.

     

    Autore

    by Maxy

     

    Istruzioni per l'uso

    Sono nello script.

     

     

    #-------------------------------------------------------------------------------
    #	Script Prezzi personalizzabili
    # (il prezzo di vendita è comunque metà del prezzo di acquisto)
    #
    #	 di Maxy
    #
    #--------------------------------------------------------------------------------
    # Per deciere il prezzo di un oggetto, arma o armatura usare gli script
    #	$items_prices[id_oggetto] = prezzo dell'oggetto 
    #	$weapons_prices[id_arma] = prezzo dell'arma
    #	$armor_prices[id_armatura] = prezzo dell'armatura 
    # per esempio se vuoi che la pozione (che è l'oggetto numero 1)
    # costi 10 Gold in un evento crei uno script (dovrebbe essere uno
    # degli ultimi comandi) con su scritto
    #
    #   $items_prices[1] = 10
    #
    # Se invece vuoi associare il prezzo di un'oggetto ad una variabile scrivi
    #   
    #	$items_prices[id_oggetto] = "numero variabile"
    #	$weapons_prices[id_arma] = "numero variabile"
    #	$armor_prices[id_armatura] = "numero variabile"
    #
    # per esempio, vorrei che il prezzo della spada di bronzo dipenda dalla variabile
    # numero 005. Allora nell'evento > script scrivo
    #
    #   $weapons_prices[1] = "5"
    #
    # tra virgolette lo interpreta come una variabile, senza virgolette come un numero
    
    
    
    #-------------------------------------------------------------------------------
    #Qui ho dirottato la richiesta del prezzo su una lista 
    
    class RPG::Item
     
     def price
    if $items_prices.has_key?(@id)
      if $items_prices[@id].is_a?(Integer)
    	return $items_prices[@id]
      elsif $items_prices[@id].is_a?(String)
    	return $game_variables[$items_prices[@id].to_i]
      end
    else
      return @price
    end
    
     end
     
    end
    
    class RPG::Weapon
     
     def price
    if $weapons_prices.has_key?(@id)
      if $weapons_prices[@id].is_a?(Integer)
    	return $weapons_prices[@id]
      elsif $weapons_prices[@id].is_a?(String)
    	return $game_variables[$weapons_prices[@id].to_i]
      end
    else
      return @price
    end
    
     end
     
    end
    
    class RPG::Armor
     
     def price
    if $armors_prices.has_key?(@id)
      if $armors_prices[@id].is_a?(Integer)
    	return $armors_prices[@id]
      elsif $armors_prices[@id].is_a?(String)
    	return $game_variables[$armors_prices[@id].to_i]
      end
    else
      return @price
    end
    
     end
     
    end
    
    
    
    #Questo è per salvare i prezzi ------------------------------------------------
    
    class Scene_Title
     alias command_new_game2 command_new_game
     def command_new_game
    $items_prices = Hash.new
    $weapons_prices = Hash.new
    $armors_prices = Hash.new
    command_new_game2
     end
    end
    
    class Scene_Save
    
     alias write_save_data2 write_save_data
     def write_save_data(file)
    write_save_data2(file)
    Marshal.dump($items_prices, file)
    Marshal.dump($weapons_prices, file)
    Marshal.dump($armors_prices, file)
     end
    end
    
    class Scene_Load
     
     alias read_save_data2 read_save_data
     def read_save_data(file)
    read_save_data2(file)
    $items_prices = Marshal.load(file)
    $weapons_prices = Marshal.load(file)
    $armors_prices = Marshal.load(file)
     end
     
    
    end
    #-------------------------------------------------------------------------------

     

     

    Bugs e Conflitti Noti

    N/A

     

    Altri Dettagli

    Lo script agisce sul prezzo dell'oggetto, non sul menù di compravendita, pertanto il prezzo di vendita sarà comunque la metà del prezzo di acquisto. Questo fa in modo che sia compatibile con molti altri script per lo shop.

     

    Primo script che posto! Usato in Light and Decay

  14. L'idea è molto carina, mette in luce la parte "subdola" del gioco che riguarda gli intrighi. Lo hai fatto con eventi o script?

     

    Mi è venuta l'idea (è pura pignoleria) di mostrare i messaggi semitrasparenti, in modo da dare l'idea che la comunicazione tra le due persone vorrebbe essere nascosta all'eroe. Magari con la trasparenza che dipende dalla distanza da chi sta parlando...

  15. il problema è che dovrei creare le immagini transitorie, almeno 5 per spostamento direi per avere un po' di fluidità

     

    ti conviene creare delle pictures con le scritte e far muovere le pictures (naturalmente dovrai togliere le scritte dal fondale)

     

    almeno questo è quello che viene in mente a me, poi magari hai costruito il menù in modo che sia più comodo fare in altro modo

  16. Qui scusami ma non ho capito a cosa ti riferisci, parli della scelta delle strategie, delle spell o di altro?

     

    Effettivamente mi sono espresso da cani...

     

    Parlavo del menù rotondo: se invece di ruotare in un solo frame, "bruscamente", ruotasse in modo che l'occhio possa seguire lo spostamento delle scritte, si attenuerebbe la sensazione di "mal di mare" che ha il cervello quando non riesce a capire ciò che vede (ciò accade credo perchè il cervello ha più difficoltà a "elaborare" che c'è stato un movimento rotatorio anzichè traslatorio (?) )

     

    Ma è solo una piccolissima imperfezione, non l'avrei nemmeno nominata se il resto non fosse stato buonissimo

  17. Commento anch'io...

     

    Premetto che non ho provato la demo, perchè non riesco a farla partire (deve essere una roba di permessi)

     

    I punti di forza di questo gioco per me sono la trama, molto precisa ed elaborata e il BS in tempo reale che aggiunge "azione" al gioco. Mi piace la caratterizzazione dei personaggi (con una storia alle spalle)

     

    Se posso darti un consiglio, fai in modo che una trama così elaborata non appesantisca il gioco (io stesso commento anche se ho solo spulciato qua e là ma non ho letto tutto)

    Buona l'idea di fornirla a poco a poco nelle biblioteche...

     

    Il BS è un gioiellino, complimenti, anche se per cose molto elaborate e "invasive" andrebbero meglio gli script. (mandami un ms, o contattami in qualche altro modo, che ne possiamo parlare)

     

    Per quanto riguarda il menù, io opterei per far scorrere le scritte, perchè ogni volta che cambi scelta nei video mi viene il mal di mare...

     

    E comunque le risorse saranno pure standard, ma nelle tue mani fanno la loro sporca figura, complimentoni per le mappe.

     

    Ti sviscero le cose che mi sono venute in mente (perdonami se dico cavolate, come ho detto non sono riuscito a provare la demo):

     

    Le classi mi sembrano un po' standard, oltre alla grande personalizzazione potresti fare delle sottoclassi

     

    Magie che colpiscono tutti i nemici? Oppure che agiscono a distanza? Armi che agiscono a distanza

     

    Aggiungi atmosfera, nebbie, paesaggi, effetti di luce, se fossi in te darei quel tocco di onirico e decadente che trasformebbe il progetto in una giuoia per gli occhi (si, lo so, Raldon ha lasciato un segno indelebile in tutti noi...)

     

     

     

    Rileggendo il post mi sembra di aver fatto la figura dello sputasentenze... in ogni caso se hai bisogno di script non esitare a contattarmi! :biggrin:

  18. Salve a tutti, vorrei dire due cose:

     

    1) Questo gioco è una figata (ma questo lo sapevate già)

     

    2) Sono uno scripter

     

    Sarei lietissimo di collaborare al progetto...

     

    EDIT: per la pixelart steampunk puoi trovare spunti su Steamlands

  19. Ciao, forse sto dicendo delle scemenze, ma perchè usi c_lar per definire l'estremo del ciclo for e poi lo modifichi all'interno del ciclo for? (riga 18)

     

          for i in 1..c_lar
           colore.red -= 1
           colore.blue += 0
           colore.green += 2
           self.contents.fill_rect(x + 5, y + 10, c_lar, c_alt, colore)
           x += 1
           c_lar -= 1
         end

     

    Tra l'altro se leggo bene, c_lar non dovrebbe essere un float compreso tra 0 e 1?

     

    In ogni caso per disegnare delle barre, c'è Custom Bar Graphic se può esserti utile.

  20. Ciao, io opterei per una soluzione "poco invadente", cioè che non stravolge completamente nessuno dei due script.

    Dopo aver copiato gli script nudi e crudi sullo script editor, rinomina il comando "draw_bar" di The Sleeping Leonhart (semplice buon senso: non ci vanno due comandi con lo stesso nome sennò fa casino) per esempio con "draw_bar2".

     

    Ricordati che devi rinominare anche le chiamate del comando (Righe 77, 83, 89, 97 e seguenti) sullo script di The Sleeping Leonhart.

     

    Disegna le barre: le dimensioni standard per lo script di SephirothSpawn sono 152 x 6. Io le ho chiamate "Barrapiena.png" e "Barravuota.png"

     

    Poi dirottiamo il comando "draw_bar" di SephirothSpawn sul comando "draw_bar2" in questo modo: inserisci alla riga 404 il comando

     

    draw_bar2(x, y, 'Barravuota', 'Barrapiena', min, max,"o")

     

    per chiamare lo script di The Sleeping Leonhart, e disfati del resto dello script contenuto nel comando

     

    Il risultato dovrebbe essere di questo tipo:

     

        class Window_Base < Window
       #--------------------------------------------------------------------------
       # Draw Bar
       #--------------------------------------------------------------------------
       def draw_bar(x, y, min, max, width = 152, height = 6, bar_color = Color.new(150, 0, 0), end_color = Color.new(255, 255, 60))
       
       draw_bar2(x, y, 'Barravuota', 'Barrapiena', min, max,"o")
       
       # Draw Background
    #    self.contents.fill_rect(x, y, width, height, Color.new(50, 50, 50, 255))
       # Draws Bar
    #    for i in 1..( (min.to_f / max.to_f) * width - 3)
    #       r = bar_color.red * (width - i) / width + end_color.red * i / width
    #       g = bar_color.green * (width - i) / width + end_color.green * i / width
    #       b = bar_color.blue * (width - i) / width + end_color.blue * i / width
    #       a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
    #       self.contents.fill_rect(x + 1 + i, y + 1, 1, height - 2,
    #         Color.new(r, g, b, a))
    #    end
       end
       end
    

     

    Come potrai notare tutte le informazioni riguardo alla dimensione della barra sono andate perdute, se è un problema ne riparliamo, altrimenti può rimanere rattoppato così

×
×
  • Create New...