Jump to content
Rpg²S Forum

Sleeping Leonhart

Utenti
  • Posts

    569
  • Joined

  • Last visited

Posts posted by Sleeping Leonhart

  1. No, almeno che io sappia, però se l'elemento non esiste ti ritorna nil, quindi puoi fare una cosa tipo

    if array[i] == nil  return Valoreend

    altrimenti puoi provare con questo snippet

    class Array    #--------------------------------------------------------------------------  # * Variabili pubbliche  #--------------------------------------------------------------------------  attr_accessor :default    #--------------------------------------------------------------------------  # * Aliasing dei metodi  #--------------------------------------------------------------------------  alias clssrr_ini initialize    alias clssrr_vl []  #--------------------------------------------------------------------------  # * Inizializza la classe  #--------------------------------------------------------------------------  def initialize(*args)	clssrr_ini(args)	@default = nil  end    #--------------------------------------------------------------------------  # * Restituisce il valore dell'array nel dato indice  #--------------------------------------------------------------------------  def [](index)	#Se il valore è nullo ritorna il valore di default	return clssrr_vl(index) == nil ? @default : clssrr_vl(index)  end  end

    con il quale puoi usare il valore default proprio come negli Hash, solo che avendo toccato un classe base e non conoscendone il sorgente non so se ti può creare problemi, vedi un po te.

  2. I -32 servono per lasciare lo spazio per il bordino della finestra, infatti ogni bordo può essere largo 16 pixel

     

    http://img99.imageshack.us/img99/3472/exam1zh1.png

     

    se tu infatti allarghi il bordo della Windowskin e lo fai largo 16 pixel su ciascuna lato vedrai che il contenuto della finestra

    combacia perfettamente

     

    http://img715.imageshack.us/img715/9366/ghkjl.png

     

    Per levare le freccette insomma ti tocca cambiare windowskin.

    Spero mi sia spiegato bene :P

  3. Devi postare anche lo script per la camminata diagonale, ne esisteranno centinaia, indica quale stai usando attualmente. Inoltre considera che anche se riuscissi a far funzionare la camminata diagonale probabilmente (non ne sono sicuro non sapendo come funziona l'ABS) gli attacchi in diagonale non funzionerebbero.
  4. Il link sembra che ora funzioni, non capisco perchè dia questi problemi, oltretutto sono anche registrato....

     

    @payam: cosa intendi per sbloccare alcuni oggetti? Tu ti crei tutte le decorazioni del gioco attraverso il programmino, poi con il comando:

    $game_party.gain_decoration(IDMAPPADECORABILE, NOMEOGGETTO, QUANTITA)

    aggiungi la decorazione a quelle disponibili, volendo si puo fare uno script per un negozio che le vende se è quello che ti serve.

  5. Per i battleback basta cercare ne trovi a bizzeffe

    1 2 3

    4 5 6

    piu tutti quelli delle RTP dell'XP.

     

    Per quanto riguardo il modo per metterli sappi che di default non si può, serve uno script per poter implementare questa funzione, sul forum ho trovato questo che permette di impostare lo sfondo per ciascuna mappa, ne ho fatto uno anche io tempo fa il quale permette di impostare lo sfondo di battaglia basandosi sulle aree della mappa invece

    #==============================================================================# ** Area Battleback#------------------------------------------------------------------------------#  Autore: The Sleeping Leonhart#  Versione: 1.0#  Data di rilascio: 25/03/2009#------------------------------------------------------------------------------#  Descrizione:#	Questo script permette di avere battleback differenti per#	ciascuna area.#------------------------------------------------------------------------------#  Version:#	1.0 (25/03/2009): Versione Base.#------------------------------------------------------------------------------#  Istruzioni:#	Per cambiare battleback usare il comando script e scrivere al suo interno:#	  $game_system.battle_bg = nomebattleback#	Per usare il battleback dell'area in cui vi trovate usare:#	  $game_system.battle_bg = "DETECT"#	Per usare il battleback di default (quello astratto) usare:#	  $game_system.battle_bg = nil#	I battleback vanno messi nella cartella Battleback che va creata dentro#	la cartella Graphics.#	Per personalizzare lo script andate nella sezione Configurazione.#============================================================================== #==============================================================================#  Configurazione#=============================================================================module AreaBattleback  #=========================================================================  #  AreaBattleback: Imposta il suffisso per le aree per far apparire un determinato  #				  battleback.  #-------------------------------------------------------------------------  #  Sintassi:  #	AreaBattleback[suffix] = name  #  Parametri:  #	suffisso: suffisso da inserire nel nome dell'area tra parentesi quadre.  #	name: nome del battleback.  #=========================================================================  AreaBattleback = {}  AreaBattleback["G"] = "Grass"  AreaBattleback["S"] = "Sea"  #=========================================================================  #  DefaultBattleback: Imposta il battleback di default.  #-------------------------------------------------------------------------  #  Sintassi:  #	DefaultBattleback = name  #  Parametri:  #	name: nome del battleback.  #=========================================================================  DefaultBattleback = "Ground"end module Cache  #--------------------------------------------------------------------------  # * Ottiene la grafica del battleback  #--------------------------------------------------------------------------  def self.battleback(filename)	load_bitmap("Graphics/Battlebacks/", filename)  endend class Game_System  #--------------------------------------------------------------------------  # * Variabili Pubbliche  #--------------------------------------------------------------------------  attr_accessor :battle_bg  #--------------------------------------------------------------------------  # * Inizializza la classe  #--------------------------------------------------------------------------  alias tslstsm_gmsstm_init initialize  def initialize	tslstsm_gmsstm_init	@battle_bg = nil  endend class Spriteset_Battle  #--------------------------------------------------------------------------  # * Crea il Battleback  #--------------------------------------------------------------------------  alias tslstsm_sprtstbttl_crtbttlbck create_battleback  def create_battleback	if $game_system.battle_bg != nil	  if $game_system.battle_bg.is_a?(Array)		bg = Cache.battleback($game_system.battle_bg[0])		$game_system.battle_bg = "DETECT"	  else		bg = Cache.battleback($game_system.battle_bg)	  end	  bitmap = Bitmap.new(544, 416)	  bitmap.stretch_blt(bitmap.rect, bg, bg.rect)	  @battleback_sprite = Sprite.new(@viewport1)	  @battleback_sprite.bitmap = bitmap	else	  tslstsm_sprtstbttl_crtbttlbck	end  end    #--------------------------------------------------------------------------  # * Crea il terreno di battaglia  #--------------------------------------------------------------------------  alias tslstsm_sprtstbttl_crtbttlflr create_battlefloor  def create_battlefloor	tslstsm_sprtstbttl_crtbttlflr	if $game_system.battle_bg != nil	  @battlefloor_sprite.bitmap.dispose unless @battlefloor_sprite.bitmap == nil	end  end  end class Scene_Map  #--------------------------------------------------------------------------  # * Chiama la battaglia  #--------------------------------------------------------------------------  alias tslrbttlbck_scnmp_cll_bttl call_battle  def call_battle	detect_battleback	tslrbttlbck_scnmp_cll_bttl  end  #--------------------------------------------------------------------------  # * Calcola il battleback  #--------------------------------------------------------------------------  def detect_battleback	return if $game_system.battle_bg != "DETECT"	$game_system.battle_bg = []	for area in $data_areas.values	  for name in AreaBattleback::AreaBattleback.keys		if area.name.include?("[#{name}]") && $game_player.in_area?(area)		  $game_system.battle_bg.push(AreaBattleback::AreaBattleback[name])		  return		end	  end	  	end	$game_system.battle_bg.push(AreaBattleback::DefaultBattleback[name])  endend

    vedi quali ti aggrada di piu. (attento che il mio script riadatta gli sfondi allo schermo mentre quello postato da Tio no e quindi devi ridimensionarti gli sfondi a mano)

  6. Modifica rapida rapida, vedi se funziona

    #==============================================================================# ** Sprite_Battler#------------------------------------------------------------------------------#  Animated Battlers by Minkoff#============================================================================== class Sprite_Battler < RPG::Sprite  #--------------------------------------------------------------------------  # * Initialize  #--------------------------------------------------------------------------  alias cbs_initialize initialize  def initialize(viewport, battler = nil)	@speed = 7	@frames = 4	@poses = 10	@stationary_enemies = true	@stationary_actors = true	@calculate_speed = true	@phasing = false	@frame = 0	@pose = 0	@last_time = 0	@last_move_time = 0	cbs_initialize(viewport, battler)	viewport.z = 99  end  #--------------------------------------------------------------------------  # * Update  #--------------------------------------------------------------------------  alias cbs_update update  def update	return unless @battler 	# Regular Update	cbs_update 	# Start Routine	unless @started	  if @battler.is_a?(Game_Actor)		@width = @width / @frames		@height = @height / @poses	  end	  @display_x = @battler.screen_x	  @display_y = @battler.screen_y	  @destination_x = @display_x	  @destination_y = @display_y	end 	# Setup Sprite	self.src_rect.set(@width * @frame, @height * @pose, @width, @height) if @battler.is_a?(Game_Actor)	#self.mirror = @battler.is_a?(Game_Enemy) unless @started 	# Position Sprite	self.x = @display_x	self.y = @display_y	self.z = @display_y	self.ox = @width / 2	self.oy = @height 	# Setup Animation	time = Graphics.frame_count / (Graphics.frame_rate / @speed)	if @last_time < time	  @frame = (@frame + 1) % @frames	  if @frame == 0 or @reload		if @freeze		  @frame = @frames - 1		  return		end		@pose = state	  end	end	@last_time = time 	# Move It	move if moving 	# Finish Up	@started = true  end  #--------------------------------------------------------------------------  # * Current State  #--------------------------------------------------------------------------  def state	# Damage State	if [nil,{}].include?(@battler.damage)	  # Battler Fine	  @state = 0	  # Battler Wounded	  @state = 0 if @battler.hp < @battler.maxhp / 4	  # Battler Dead	  @state = 2 if @battler.dead?	end	# Guarding State	@state = 3 if @battler.guarding?	# Moving State	if moving	  # Battler Moving Left	  @state = 4 if moving.eql?(0)	  # Battler Moving Right	  @state = 5 if moving.eql?(1)	end	# Return State	return @state  end  #--------------------------------------------------------------------------  # * Move  #--------------------------------------------------------------------------  def move	time = Graphics.frame_count / (Graphics.frame_rate.to_f / (@speed * 5))	if @last_move_time < time 	  # Pause for Animation	  return if @pose != state 	  # Phasing	  if @phasing		d1 = (@display_x - @original_x).abs		d2 = (@display_y - @original_y).abs		d3 = (@display_x - @destination_x).abs		d4 = (@display_y - @destination_y).abs		self.opacity = [255 - ([d1 + d2, d3 + d4].min * 1.75).to_i, 0].max	  end 	  # Calculate Difference	  difference_x = (@display_x - @destination_x).abs	  difference_y = (@display_y - @destination_y).abs 	  # Done? Reset, Stop	  if [difference_x, difference_y].max.between?(0, 8)		@display_x = @destination_x		@display_y = @destination_y		@pose = state		return	  end 	  # Calculate Movement Increments	  increment_x = increment_y = 1	  if difference_x < difference_y		increment_x = 1.0 / (difference_y.to_f / difference_x)	  elsif difference_y < difference_x		increment_y = 1.0 / (difference_x.to_f / difference_y)	  end 	  # Calculate Movement Speed	  if @calculate_speed		total = 0; $game_party.actors.each{ |actor| total += actor.agi }		speed = @battler.agi.to_f / (total / $game_party.actors.size)		increment_x *= speed		increment_y *= speed	  end 	  # Multiply and Move	  multiplier_x = (@destination_x - @display_x > 0 ? 8 : -8)	  multiplier_y = (@destination_y - @display_y > 0 ? 8 : -8)	  @display_x += (increment_x * multiplier_x).to_i	  @display_y += (increment_y * multiplier_y).to_i	end	@last_move_time = time  end  #--------------------------------------------------------------------------  # * Set Movement  #--------------------------------------------------------------------------  def setmove(destination_x, destination_y)	unless (@battler.is_a?(Game_Enemy) and @stationary_enemies) or		   (@battler.is_a?(Game_Actor) and @stationary_actors)	  @original_x = @display_x	  @original_y = @display_y	  @destination_x = destination_x	  @destination_y = destination_y	end  end  #--------------------------------------------------------------------------  # * Movement Check  #--------------------------------------------------------------------------  def moving	if (@display_x != @destination_x and @display_y != @destination_y)	  return (@display_x > @destination_x ? 0 : 1)	end  end  #--------------------------------------------------------------------------  # * Set Pose  #--------------------------------------------------------------------------  def pose=(pose)	@pose = pose	@frame = 0  end  #--------------------------------------------------------------------------  # * Freeze  #--------------------------------------------------------------------------  def freeze	@freeze = true  endend#==============================================================================# ** Game_Actor#============================================================================== class Game_Actor  #--------------------------------------------------------------------------  # * Actor X Coordinate  #--------------------------------------------------------------------------  def screen_x	if self.index != nil	  return self.index * 45 + 450	else	  return 0	end  end  #--------------------------------------------------------------------------  # * Actor Y Coordinate  #--------------------------------------------------------------------------  def screen_y	return self.index * 35 + 200  end  #--------------------------------------------------------------------------  # * Actor Z Coordinate  #--------------------------------------------------------------------------  def screen_z	return screen_y  endend #==============================================================================# ** Scene_Battle#============================================================================== class Scene_Battle  #--------------------------------------------------------------------------  # * Action Animation, Movement  #--------------------------------------------------------------------------  alias cbs_update_phase4_step3 update_phase4_step3  def update_phase4_step3(battler = @active_battler)	@rtab = !@target_battlers	target = (@rtab ? battler.target : @target_battlers)[0]	@moved = {} unless @moved	return if @spriteset.battler(battler).moving	case battler.current_action.kind	when 0 # Attack	  if not (@moved[battler] or battler.guarding?)		offset = (battler.is_a?(Game_Actor) ? 40 : -40)		@spriteset.battler(battler).setmove(target.screen_x + offset, target.screen_y)		@moved[battler] = true		return	  elsif not battler.guarding?		@spriteset.battler(battler).pose = 6 + rand(2)		@spriteset.battler(battler).setmove(battler.screen_x, battler.screen_y)	  end	when 1 # Skill	  @spriteset.battler(battler).pose = 8	when 2 # Item	  @spriteset.battler(battler).pose = 8	end	@moved[battler] = false	@rtab ? cbs_update_phase4_step3(battler) : cbs_update_phase4_step3  end  #--------------------------------------------------------------------------  # * Hit Animation  #--------------------------------------------------------------------------  alias cbs_update_phase4_step4 update_phase4_step4  def update_phase4_step4(battler = @active_battler)	for target in (@rtab ? battler.target : @target_battlers)	  damage = (@rtab ? target.damage[battler] : target.damage)	  if damage.is_a?(Numeric) and damage > 0		@spriteset.battler(target).pose = 1	  end	end	@rtab ? cbs_update_phase4_step4(battler) : cbs_update_phase4_step4  end  #--------------------------------------------------------------------------  # * Victory Animation  #--------------------------------------------------------------------------  alias cbs_start_phase5 start_phase5  def start_phase5	for actor in $game_party.actors	  return if @spriteset.battler(actor).moving	end	for actor in $game_party.actors	  unless actor.dead?		@spriteset.battler(actor).pose = 9		@spriteset.battler(actor).freeze	  end	end	cbs_start_phase5  end  #--------------------------------------------------------------------------  # * Change Arrow Viewport  #--------------------------------------------------------------------------  alias cbs_start_enemy_select start_enemy_select  def start_enemy_select	cbs_start_enemy_select	@enemy_arrow.dispose	@enemy_arrow = Arrow_Enemy.new(@spriteset.viewport2)	@enemy_arrow.help_window = @help_window  endend #==============================================================================# ** Spriteset_Battle#============================================================================== class Spriteset_Battle  #--------------------------------------------------------------------------  # * Change Enemy Viewport  #--------------------------------------------------------------------------  alias cbs_initialize initialize  def initialize	cbs_initialize	@enemy_sprites = []	for enemy in $game_troop.enemies.reverse	  @enemy_sprites.push(Sprite_Battler.new(@viewport2, enemy))	end  end  #--------------------------------------------------------------------------  # * Find Sprite From Battler Handle  #--------------------------------------------------------------------------  def battler(handle)	for sprite in @actor_sprites + @enemy_sprites	  return sprite if sprite.battler == handle	end	return false  endend #==============================================================================# ** Arrow_Base#============================================================================== class Arrow_Base < Sprite  #--------------------------------------------------------------------------  # * Reposition Arrows  #--------------------------------------------------------------------------  alias cbs_initialize initialize  def initialize(viewport)	cbs_initialize(viewport)	self.ox = 14 # 32	self.oy = 10 # 40  endend

    Ti ho tolto il fatto che i battler dei nemici vengono specchiati, se vuoi rimetterlo leva # da

    #self.mirror = @battler.is_a?(Game_Enemy) unless @started

     

    Senno puoi fare come dice MasterSion ma in termini di spazio occupato ne risentirai parecchio :P

  7. Avendo lavorato su alcuni script di Oromis' Tale sono quasi sicuro che esso usava l'RTAB di Cogwheel per la battaglia in tempo reale e l'Animated Battlers - Enhanced di DerVVulfman per i battler animati, se cerchi bene troverai anche degli add-on di vario genere probabilmente anche per quello che cerchi, google è tuo amico.
  8. Connession OK, purtroppo con Fastweb posso connettere al massimo 2 apparecchi ad internet quindi dentro casa è una lotta continua per chi si connette, finche non compro un router da mettere in cascata a quello SOLA di Fastweb dovrò contendermi internet. Inoltre anticipo che il 15 parto per l'Abruzzo e ci resto minimo una settimana, mentre uno di questi giorni dovrei andare a fare un missione suicida per una faccenda che spero porti buoni risultati.
  9. ad una prima occhiata dire che ti da quell'errore perchè probabilmente al posto di

    c_width=contents.text_size©.width

    nella riga 166 ci doveva essere

    c_width=contents.text_size[c].width

    vedi un po se rimpiazzando ti funziona.

  10. Sicuramente me ne sono dimenticato xD

    Non è una cosa gravissima però lo dovrei modificare, anzi aggiungo l'opzione per farlo e credo che ne mettero anche una per mostrare i chara su mappa cosi non ci si sbaglia, grazie della segnalazione :P

  11. No, non ho ancora la connessione però scrocco eheh

    Ho notato che lo script in teoria dovrebbe ricaricare anche il database, ma non lo fa per uno stupido errore logico commesso dal programmatore, in poche parole ricarica tutti i file presenti in data ad esclusione di script e mappe, in piu zompa anche i file ".." e ".", l'errore è che non zompa solo i file "." e ".." ma tutti quelli che contentnengono i suddetti caratteri (e tutti i file contengo il punto che li separa dall'estensione) quindi basta sostituire

    			next if file.include?(".") or file.include?("..") or file.include?("Map") or file.include?("Scripts")

    con

    			next if file == "." or file == ".." or file.include?("Map") or file.include?("Scripts")

    e tutto dovrebbe filare liscio come l'olio, scrivo anche lo script gia modificato, ditemi se vi funziona poi ;)

    #=============================================================## Edit & Play												 ##-------------------------------------------------------------## Versione: 1.0											   ## Data: 1/7/2010											  ##-------------------------------------------------------------## Autore: .:Fênix:.										   ## MSN: bmotamer@hotmail.com								   ##=============================================================# module Edit_and_Play  # Attivare lo script? (true / false)  Activate = true  # Nome della cartella per la identificazione dei cambiamenti effettuati  File = "Temp"  # Attivare con il metodo di debug? (true / false)  Debug = true  # Tasto che aggiorna le modifiche apportate  Key = Input::ALTend #=============================================================## Permette di testare il gioco e editare il progetto		  ## contemporaneamente.										 ##-------------------------------------------------------------## Questo script è compatibile con RPG Maker XP e VX		   ##=============================================================# if !FileTest.exist?("Game.rgssad") and !FileTest.exist?("Game.rgss2a") and Edit_and_Play::Activate  file = Edit_and_Play::File  ext = FileTest.exist?("Data/Tilesets.rxdata") ? "rxdata" : "rvdata"  if FileTest.exist?(file)	$DEBUG = $TEST = Edit_and_Play::Debug	if FileTest.exist?("Data/EaP_Actors.#{ext}")	  $BTEST = true	  File.rename("Data/EaP_Actors.#{ext}", "Data/BT_Actors.#{ext}")	end	File.delete(file)  else	file = File.open(file, "wb")	file.close	File.rename("Data/BT_Actors.#{ext}", "Data/EaP_Actors.#{ext}") if $BTEST	Thread.new {system("Game")}	exit  end  module Input	class << self	  alias edit_and_play_1 update if !$@	  def update		if trigger?(Edit_and_Play::Key)		  for file in Dir.entries("Data")						next if file == "." or file == ".." or file.include?("Map") or file.include?("Scripts")			eval("$data_#{File.basename(file, '.*').downcase} = load_data('Data/#{file}')")		  end		  begin			$game_map.setup($game_map.map_id) if !$game_map.nil?		  rescue			nil		  end		  $scene = $scene.class.new		end		edit_and_play_1	  end	end  end  class Scene_Battle	alias edit_and_play_2 main if !$@	def main	  edit_and_play_2	  $scene = Scene_Battle.new if $BTEST	end  endend

  12. Ma hai scaricato lo demo o hai solo preso lo script nel primo post?

    Ti serve il programma allegato nella demo per creare la configurazione, e ti serve la configurazione per far funzionare lo script. Comunque posta l'errore completo con relativa riga indicata ;)

  13. Si lo so, sono assillante, questi sono i miei ultimi 2 tentativi, in uno ho scurito i bordi e cambiato un po il chara, nel secondo ho provato a cambiare anche colorazione al tileset

     

    http://img27.imageshack.us/img27/8792/fgdsh.png

    http://img38.imageshack.us/img38/9813/map003.png

     

  14. allora sotto a

    @sprite = Sprite.new@sprite.bitmap = RPG::Cache.title("immagine che ho messo in Titles")@sprite.visible = true

    metti

    @sprite.opacity = 0

    poi in def update ti fai

    @sprite.opacity += QUANTITA

    e questo è per l'effetto dissolvenza diciamo, considera che il massimo di opacity è 255 ma quando "sfora" il valora viene comunque considerato 255

     

    Per far apparire l'immagine dopo un po invece come ti dicevo ti conviene fare una cosa cosi

    nel main ti crei la variabile, facciamo che si chiama @count

    poi nell'update

    if @count < 120 #120 dovrebbero essere 3 secondi in quanto 1 secondo = 40 frame credo  @count += 1elsif @count == 120  @sprite.vsible = true #fermo restando che all'inizio l'hai messa su false xDend

    Se invece intendevi fare che l'immagine entrasse sfumando dopo un tot tempo, ti basta combinare i due pezzi sopra, e quindi una cosa del genere

    def main ecc...  @sprite = Sprite.new  @sprite.bitmap = RPG::Cache.title("immagine che ho messo in Titles")  @sprite.opacity = 0  @count = 0  ecc...end def update  ecc...  if @count < 120	@count += 1  elsif @count == 120	@sprite.opacity += 5  end  ecc..end

     

    Per dubbi non esitare a chiedere, anche perchè capisco che mi spiego veramente male.

  15. Per fare un effetto dissolvenza puoi impostare l'attributo opacity dell'immagine a 0 e poi nell'update incrementarlo fino a che non raggiunge il suo massimo o il livello di opacita da te desiderato.

    Per farla apparire in ritardo invece puoi sfruttare sempre il metodo update e utillizando una variabile contatore che ti conta quanti frame sono passati (un update a frame) e quando questa variabile raggiunge la quantita da te deisderata fa a apparire l'immagine. Spero di essermi spiegato senno ti posto un esempio ;)

  16. Freank io e te siamo destinati a non incontrarci su messenger xD

    Nuovo tentativo sulla scia di quanto fatto da Luminoz

    http://img202.imageshack.us/img202/877/58868680.png

    dovrebbe andare un po meglio adesso.

    Il gioco e....

     

     

     

     

    va bene va te lo dico :blink: , è YS in versione pc, gioco misconosciuto ai molti.

×
×
  • Create New...