Jump to content
Rpg²S Forum

Melosx

Utenti
  • Posts

    620
  • Joined

  • Last visited

Posts posted by Melosx

  1. MSX - XP Characters on VX

    Descrizione

    Lo script permette di usare i chara xp nel vx semplicemente inserendo il tag
    $xp
    prima del nome del file.
    Potete quindi usare i normali VX insieme a quelli dell'XP.
    Ce ne saranno già molti ma visto che non avevo internet in quel periodo me lo son fatto da me


    Autore

    Melosx

     

    Istruzioni per l'uso

    Inserire sotto Materials e sopra Main. Rinominare i file dei characters aggiungendo prima del nome '$xp' senza virgolette.


    Screenshot
    http://i41.tinypic.com/hvw5eu.png

     

     

     

    Script + Patch

     


    MSX - XP Characters on VX

    #==============================================================================
    # ** MSX - XP Characters on VX/VXAce
    #==============================================================================
    # Autore: Melosx
    # Ottimizzato da: clyde
    # Versione: 1.1
    #
    #==============================================================================
    # * Descrizione
    # -----------------------------------------------------------------------------
    # Lo script permette di usare i chara xp nel vx semplicemente inserendo il tag
    # $xp
    # prima del nome del file.
    # Potete quindi usare i normali VX/VXAce insieme a quelli dell'XP.
    #==============================================================================
    #==============================================================================
    # ** Sprite_Character
    #==============================================================================
    class Sprite_Character < Sprite_Base
    	
    	def set_character_bitmap
    		self.bitmap = Cache.character(@character_name)
    		if @character_name && @character_name.include?('$xp')
    			@cw = bitmap.width / 4
    			@ch = bitmap.height / 4
    		else
    			sign = @character_name[/^[\!\$]./]
    			if sign && sign.include?('$')
    				@cw = bitmap.width / 3
    				@ch = bitmap.height / 4
    			else
    				@cw = bitmap.width / 12
    				@ch = bitmap.height / 8
    			end
    		end
    		self.ox = @cw / 2
    		self.oy = @ch
    	end
    	
    	alias update_src_rect_melosx update_src_rect
    	def update_src_rect
    		if @character_name && @character_name.include?('$xp')
    			if @tile_id == 0
    				pattern = @character.pattern > 0 ? @character.pattern - 1 : 3
    				sx = pattern * @cw
    				sy = (@character.direction - 2) / 2 * @ch
    				self.src_rect.set(sx, sy, @cw, @ch)
    			end
    			return
    		end
    		update_src_rect_melosx
    	end
    	
    end
    #==============================================================================
    # ** Window_Base
    #==============================================================================
    class Window_Base < Window
    	
    	def draw_character(character_name, character_index, x, y)
    		return if character_name == nil
    		bitmap = Cache.character(character_name)
    		if character_name.include?('$xp')
    			cw = bitmap.width / 4
    			ch = bitmap.height / 4
    		else
    			sign = character_name[/^[\!\$]./]
    			if sign && sign.include?('$')
    				cw = bitmap.width / 3
    				ch = bitmap.height / 4
    			else
    				cw = bitmap.width / 12
    				ch = bitmap.height / 8
    			end
    			n = character_index
    		end
    		src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
    		self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
    	end
    end
    
    

     

     

     

     

     

    Patch per Tankentai

    #==============================================================================
    # ** MSX - XP Characters on VX - Tankentai Patch
    #==============================================================================
    # Autore: Melosx
    # Versione: 1.0
    #
    #==============================================================================
    # * Istruzioni
    # -----------------------------------------------------------------------------
    # Inserire la patch sotto lo script Sideview 1.
    # La patch è stata creata sulla versione 3.4e, l'ultima release al momento
    # della creazione della patch.
    # Se avete problemi con versioni diverse dalla 3.4e segnalatemelo.
    #==============================================================================
    
    #==============================================================================
    # ** Sprite_Battler
    #==============================================================================
    
    class Sprite_Battler < Sprite_Base
    	
    	def make_battler
    		@battler.base_position
    		@battler_hue = @battler.battler_hue
    		if @anime_flug
    			@weapon_R = Sprite_Weapon.new(viewport,@battler)
    			@battler_name = @battler.character_name if @battler.actor?
    			@battler_name = @battler.battler_name unless @battler.actor?
    			self.mirror = true if !@battler.actor? && @battler.action_mirror
    			if @battler_hue != nil
    				self.bitmap = Cache.character(@battler_name, @battler_hue) if N01::WALK_ANIME
    				self.bitmap = Cache.character(@battler_name + "_1", @battler_hue) unless N01::WALK_ANIME
    			else
    				self.bitmap = Cache.character(@battler_name) if N01::WALK_ANIME
    				self.bitmap = Cache.character(@battler_name + "_1") unless N01::WALK_ANIME
    			end
    			#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#
    			
    			if @battler.character_name != nil and @battler.character_name.include?('$xp')
    				@base_width = 4
    				@width = self.bitmap.width / @base_width
    				@height = self.bitmap.height / @base_height
    				@sx = @pattern * @width
    				@sy = @anime_kind * @height
    			else
    				@width = self.bitmap.width / @base_width
    				@height = self.bitmap.height / @base_height
    				@sx = @pattern * @width
    				@sy = @anime_kind * @height
    			end
    			self.src_rect.set(@sx, @sy, @width, @height)
    			
    			#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#
    		else
    			@battler_name = @battler.battler_name
    			self.bitmap = Cache.battler(@battler_name, @battler_hue)
    			@width = bitmap.width
    			@height = bitmap.height
    		end
    		if $back_attack && @battler.actor?
    			self.mirror = true
    		elsif $back_attack && !@battler.actor?
    			self.mirror = true
    			self.mirror = false if @battler.action_mirror
    		else
    			self.mirror = false
    			self.mirror = true if !@battler.actor? && @battler.action_mirror
    		end
    		@weapon_R.mirroring if self.mirror && @weapon_R != nil
    		@battler.reset_coordinate
    		self.ox = @width / 2
    		self.oy = @height * 2 / 3
    		update_move
    		@move_anime = Sprite_MoveAnime.new(viewport,battler)
    		@picture = Sprite.new
    		@damage = Sprite_Damage.new(viewport,battler)
    		@battler.graphics_width = @width
    		@battler.graphics_height = @height
    	end
    	
    	
    	def update_anime_pattern
    		return @frame -= 1 if @frame != 0
    		@weapon_R.action if @weapon_action && @weapon_R != nil
    		if @battler.actor? and @battler.character_name != nil and @battler.character_name.include?('$xp')
    			if @pattern_back
    				if @anime_loop == 0
    					if @reverse
    						@pattern -= 1
    						@pattern = (@pattern < 0 ? @base_width - 1 : @pattern)
    						if @pattern == -1
    							@pattern_back = false
    							@anime_end = true
    						end
    					else
    						@pattern += 1
    						@pattern = (@pattern > @base_width - 1 ? 0 : @pattern)
    						if @pattern == @base_width
    							@pattern_back = false
    							@anime_end = true
    						end
    					end
    				else
    					@anime_end = true
    					if @anime_loop == 1
    						@pattern = 0 if !@reverse
    						@pattern = @base_width - 1 if @reverse
    						@pattern_back = false
    					end
    				end
    			else
    				if @reverse
    					@pattern -= 1
    					@pattern = (@pattern < 0 ? @base_width - 1 : @pattern)
    					@pattern_back = true if @pattern == 0
    				else
    					@pattern += 1
    					@pattern = (@pattern > @base_width - 1 ? 0 : @pattern)
    					@pattern_back = true if @pattern == @base_width - 1
    				end
    			end
    		else
    			if @pattern_back
    				if @anime_loop == 0
    					if @reverse
    						@pattern += 1
    						if @pattern == @base_width - 1
    							@pattern_back = false
    							@anime_end = true
    						end
    					else
    						@pattern -= 1
    						if @pattern == 0
    							@pattern_back = false
    							@anime_end = true
    						end
    					end
    				else
    					@anime_end = true
    					if @anime_loop == 1
    						@pattern = 0 if !@reverse
    						@pattern = @base_width - 1 if @reverse
    						@pattern_back = false
    					end
    				end
    			else
    				if @reverse
    					@pattern -= 1
    					@pattern_back = true if @pattern == 0
    				else
    					@pattern += 1
    					@pattern_back = true if @pattern == @base_width - 1
    				end
    			end
    		end
    		@frame = @anime_speed
    		return if @anime_freeze
    		return unless @anime_flug
    		@sx = @pattern * @width
    		@sy = @anime_kind * @height
    		self.src_rect.set(@sx, @sy, @width, @height)
    	end
    	
    end
    
    

     

     

     

    Bugs e Conflitti Noti

    N/A

  2. Le immagini finisco sotto la mappaa quando fai un trasporto. Per farle rivedere entri ed esci dal menu e ritornano le immagini...

    Non è che sbaglio qualcosa negli alias o nel sistemare un po lo script??? Cmq da problemi anche su progetti vuoti... Se scarichi la demo lo vedresti...

  3. Ciao a tutti... Chiedo supporto qui per un aiuto con l'hud che sto creando. Presenta alcuni piccoli ma fastidiosi bug. Se entro nel menu inventario e abiltà l'immagine del face e della parte sotto dell'HUD vanno a finire sopra le window. Se ritorno ai titoli sempre le suddette immagini rimangono anche nella schermata dei titoli. Ho preparato una demo con la speranza che qualcuno mi aiuti a risolvere i bug...

    -> DOWNLOAD<-

     

    EDIT: Da sostituire il

    def sfondosopra

     

    con questo codice o le immaggini vanno sotto la mappa con il teletrasporto

    def sfondosopra
    @hudsopra = Sprite.new
    @hudsopra.bitmap = Cache.system("HUDSopra")
    @hudsopra.z = 2
    end

  4. Dalle prove fatte con questo script ho notato che il problema si presenta solo le mappe adiacenti non hanno lo stesso settaggio per quanto riguardo i tile da swappaere. Se due mappe adiacenti swappano allo stesso modo nessun problema.
  5. Continuous Maps

    Descrizione

    Permette di legare le mappe come in pokemon ottenendo l'effetto di un unica mappa.

     

    Autore

    Blizzard

     

    Allegati

     

    Istruzioni per l'uso

    Nello script.

     

     

     

    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    # Continuous Maps by Blizzard
    # Version: 1.2
    # Type: Custom Map System
    # Date: 14.12.2009
    # Date v1.2: 11.9.2010
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    #   
    #  This work is protected by the following license:
    # #----------------------------------------------------------------------------
    # #  
    # #  Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
    # #  ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
    # #  
    # #  You are free:
    # #  
    # #  to Share - to copy, distribute and transmit the work
    # #  to Remix - to adapt the work
    # #  
    # #  Under the following conditions:
    # #  
    # #  Attribution. You must attribute the work in the manner specified by the
    # #  author or licensor (but not in any way that suggests that they endorse you
    # #  or your use of the work).
    # #  
    # #  Noncommercial. You may not use this work for commercial purposes.
    # #  
    # #  Share alike. If you alter, transform, or build upon this work, you may
    # #  distribute the resulting work only under the same or similar license to
    # #  this one.
    # #  
    # #  - For any reuse or distribution, you must make clear to others the license
    # #	terms of this work. The best way to do this is with a link to this web
    # #	page.
    # #  
    # #  - Any of the above conditions can be waived if you get permission from the
    # #	copyright holder.
    # #  
    # #  - Nothing in this license impairs or restricts the author's moral rights.
    # #  
    # #----------------------------------------------------------------------------
    # 
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    # 
    # Compatibility:
    # 
    #   95% compatible with SDK v1.x. 80% compatible with SDK 2.x. WILL corrupt old
    #   savegames. Compatible with Blizz-ABS. Not compatible with Intelligent
    #   Passability from Blizz-ABS, it's being turned off.
    # 
    # 
    # Features:
    # 
    #   - virtually creates one continuous map from any number of map fragments
    #   - easy to configure
    # 
    # new in v1.2:
    #   
    #   - fixed bug where transferring into a non-configured map would crash the
    #	 game
    #   - fixed bug when teleporting into another set of maps would mess up
    #	 everything
    # 
    # 
    # Instructions:
    # 
    # - Explanation:
    # 
    #   This Script will allow you to make the game simulate a continuous map using
    #   smaller maps. The system displays the current map and the neighbor maps.
    #   Walking over a map border will cause the new map to be loaded as main map
    #   and the neighbor maps will be changed.
    # 
    # 
    # Notes:
    # 
    #   - You may notice lag when walking over a map border.
    #   - Do not use too big maps as it increases loading time and the short moment
    #	 of lag will become more and more visible. Due to the fact that map
    #	 loading times in Blizz-ABS are increased, those moments will be longer if
    #	 Blizz-ABS is being used.
    #   - Remember to connect ALL neighbor maps or you might experience bugs.
    # 
    # 
    # If you find any bugs, please report them here:
    # http://forum.chaos-project.com
    #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
    
    module CTMAPS
     
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    # START Configuration
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
     # define all neighbor maps here
     MAP_DATA = [
    # [MAP_ID1, MAP_ID2, X_OFFSET, Y_OFFSET]
    [1, 2, 17, 0], # connected map 1 and 2 where 2 has an X, Y offset of 25, 0
    [2, 3, 17, 0],
    [3, 4, 0, 29]
     ]
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    # END Configuration
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
     MAP_DATA.compact!
     MAPS = {}
     MAP_DATA.each {|data|
      MAPS[data[0]] = [] if MAPS[data[0]] == nil
      MAPS[data[0]] |= [data[1, 3]]
      MAPS[data[1]] = [] if MAPS[data[1]] == nil
      MAPS[data[1]] |= [[data[0], -data[2], -data[3]]]}
     MAP_DATA = nil
     $ctmaps = 1.2
     
    end
    
    
    #==============================================================================
    # Game_Temp
    #==============================================================================
    
    class Game_Temp
     
     attr_accessor :player_no_straighten
     attr_accessor :normal_transfer
     
     alias cont_maps_init initialize unless $@
     def initialize
    cont_maps_init
    @player_no_straighten = true
    @normal_transfer = false
     end
     
    end
     
    #==============================================================================
    # Game_Character
    #==============================================================================
    
    class Game_Character
     
     attr_accessor :x
     attr_accessor :y
     attr_accessor :real_x
     attr_accessor :real_y
     
     alias straighten_ctmaps_later straighten
     def straighten
    if $game_temp.player_no_straighten
      $game_temp.player_no_straighten = nil
      return
    end
    straighten_ctmaps_later
     end
     
     alias moveto_ctmaps_later moveto
     def moveto(x, y)
    ox, oy = $game_map.upper_left;
    moveto_ctmaps_later(x - ox, y - oy)
     end
     
    end
    
    #==============================================================================
    # Game_Player
    #==============================================================================
    
    class Game_Player < Game_Character
     
     alias center_ctmaps_later center
     def center(x, y)
    ox, oy = $game_map.upper_left
    center_ctmaps_later(x - ox, y - oy)
     end
     
    end
    
    #==============================================================================
    # Game_Map
    #==============================================================================
    
    class Game_Map
     
     attr_reader :upper_left
     attr_reader :lower_right
     attr_reader :maps
    
     alias init_ctmaps_later initialize
     def initialize
    @maps = {}
    @events = {}
    init_ctmaps_later
     end
     
     alias setup_ctmaps_later setup
     def setup(map_id)
    last_maps = @maps
    last_map_id = @map_id
    @upper_left = [0, 0]
    @lower_right = [0, 0]
    events = @events
    setup_ctmaps_later(map_id)
    @maps = get_neighbor_maps
    if !@maps.has_key?(last_map_id)
      @events = {}
      last_maps = {}
      last_map_id = 0
    else
      @events = events
    end
    setup_continuous_map
    setup_continuous_events(last_maps, last_map_id)
     end
    
     def get_neighbor_maps
    maps = {}
    maps[@map_id] = [@map, 0, 0]
    @upper_left = [0, 0]
    @lower_right = [@map.width, @map.height]
    if CTMAPS::MAPS.has_key?(@map_id)
      CTMAPS::MAPS[@map_id].each {|data|
    	  id, x, y = data
    	  if @maps[id] != nil
    		map = @maps[id][0]
    	  else
    		map = load_data(sprintf('Data/Map%03d.rvdata', id))
    	  end
    	  maps[id] = [map, x, y]
    	  @upper_left[0] = x if @upper_left[0] > x
    	  @upper_left[1] = y if @upper_left[1] > y
    	  width, height = x + map.width, y + map.height
    	  @lower_right[0] = width if @lower_right[0] < width
    	  @lower_right[1] = height if @lower_right[1] < height}
      maps.each_value {|data|
    	  data[1] -= @upper_left[0]
    	  data[2] -= @upper_left[1]}
    end
    return maps
     end
     
     def setup_continuous_map
    width = @lower_right[0] - @upper_left[0]
    height = @lower_right[1] - @upper_left[1]
    data = Table.new(width, height, 3)
    @map = @map.clone
    @map.events = {}
    @maps.each_key {|id|
    	map, ox, oy = @maps[id]
    	if id == @map_id
    	  map.events.each_key {|i| @map.events[i] = map.events[i]}
    	else
    	  map.events.each_key {|i| @map.events[id * 1000 + i] = map.events[i]}
    	end
    	(0...map.width).each {|x| (0...map.height).each {|y| (0...3).each {|z|
    		data[x + ox, y + oy, z] = map.data[x, y, z]}}}}
    @map.width = width
    @map.height = height
    @map.data = data
     end
     
     def setup_continuous_events(last_maps, last_map_id)
    correct_event_positions(last_maps) if last_maps[@map_id] != nil
    delete_removed_events(last_maps, last_map_id)
    shift_events_from_last_map(last_maps, last_map_id) if last_map_id != 0
    shift_events_for_new_map
    add_new_events(last_maps)
     end
     
     def delete_removed_events(last_maps, last_map_id)
    keys = []
    @maps.each_key {|id|
    	keys += @events.keys.find_all {|key|
    		@events[key].real_x < 0 || @events[key].real_y < 0 ||
    		@events[key].real_x >= (@lower_right[0] - @upper_left[0]) * 256 ||
    		@events[key].real_y >= (@lower_right[1] - @upper_left[1]) * 256}}
    (keys | keys).each {|key| @events.delete(key)}
     end
     
     def shift_events_from_last_map(last_maps, last_map_id)
    @events.each_key {|key|
    	if key < 1000
    	  @events[last_map_id * 1000 + key] = @events[key]
    	  @events.delete(key)
    	end}
     end
     
     def shift_events_for_new_map
    @events.each_key {|key|
    	if key >= @map_id * 1000 && key < (@map_id + 1) * 1000
    	  @events[key % 1000] = @events[key]
    	  @events.delete(key)
    	end}
     end
     
     def correct_event_positions(last_maps)
    sx = @maps[@map_id][1] - last_maps[@map_id][1]
    sy = @maps[@map_id][2] - last_maps[@map_id][2]
    @events.each_value {|event|
    x, y = sx, sy
    event.x += x
    event.y += y
    event.real_x += sx * 256
    event.real_y += sy * 256}
     end
     
     def add_new_events(last_maps = {})
    if last_maps[@map_id] == nil
      @maps[@map_id][0].events.each_key {|i|
    	  if @events[i] == nil
    		@events[i] = Game_Event.new(@map_id, @maps[@map_id][0].events[i])
    	  end}
    end
    (@maps.keys - last_maps.keys - [@map_id]).each {|id|
    	map, sx, sy = @maps[id]
    	sx -= @maps[@map_id][1]
    	sy -= @maps[@map_id][2]
    	map.events.each_key {|i|
    		if @events[id * 1000 + i] == nil
    		  @events[id * 1000 + i] = event = Game_Event.new(id, map.events[i])
    		  x, y = sx, sy
    		  event.x += x
    		  event.y += y
    		  event.real_x += sx * 256
    		  event.real_y += sy * 256
    		end}}
     end
     
     alias update_ctmaps_later update
     def update
    update_ctmaps_later
    return if $game_player.moving? || @maps.size <= 1
    map, x, y = @maps[@map_id]
    if $game_player.real_x < x * 256 || $game_player.real_y < y * 256 ||
    	$game_player.real_x >= x * 256 + map.width * 256 ||
    	$game_player.real_y >= y * 256 + map.height * 256
      (@maps.keys - [@map_id]).each {|id|
    	  map, x, y = @maps[id]
    	  if $game_player.real_x >= x * 256 && $game_player.real_y >= y * 256 &&
    		  $game_player.real_x < x * 256 + map.width * 256 &&
    		  $game_player.real_y < y * 256 + map.height * 256
    		  $game_temp.player_no_straighten = true
    		  nx = $game_player.real_x / 256 - x
    		  ny = $game_player.real_y / 256 - y
    		  p "map_id = #{map_id}, new_map_id = #{id}, x,y = #{nx},#{ny}" if Input.press?(Input::F5)
    		$game_player.reserve_transfer(id, nx, ny, 0)
    		break
    	  end}
    end
     end
    end
    
    class Scene_Map < Scene_Base
     
     alias cont_map_updt_transfer update_transfer_player unless $@
     def update_transfer_player
    if !$game_temp.normal_transfer
      do_new_transfer
      $game_temp.normal_transfer = false
    else
      cont_map_updt_transfer
    end
     end
     
     def do_new_transfer
    return unless $game_player.transfer?
    @spriteset.dispose			  # Dispose of sprite set
    $game_player.perform_transfer   # Execute player transfer
    $game_map.autoplay			  # Automatically switch BGM and BGS
    $game_map.update
    Graphics.wait(0)
    @spriteset = Spriteset_Map.new  # Recreate sprite set
    Input.update
     end
    end
     
    class Game_Interpreter
     
     def normal_transfer(boolean)
    $game_temp.normal_transfer = boolean
     end
    end

     

     

     

    Bugs e Conflitti Noti

    All'interno dello script vi sono le incompatibilità e i confliti. Aggiungo però un problema con lo swapxt. se si fa caso solo il terreno viene correttemente swappato, al contrario gli altri tile swappano solo quando si mette effettivamente piede nella mappa avendo un brutto effetto.

×
×
  • Create New...