조회 수 4994 추천 수 7 댓글 4
Atachment
첨부 '1'
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
acoc_2_1194197981_01.jpg

스크립트 Main 에서 오른쪽 클릭 새로운 섹션을 만듭니다.


이름은 아무거나 정하시고.


아래 내용을 붙여넣습니다.


 


 


#==============================================================================
# ■ Sprite_Reflection
# Based on Sprite_Mirror, Modified By: JmsPlDnl, rewritten entirely by Rataime
#==============================================================================
CATERPILLAR_COMPATIBLE = true


class Game_Party
 attr_reader :characters
end


class Sprite_Reflection < RPG::Sprite


attr_accessor :character


def initialize(viewport=nil, character=nil,self_angle = 180)
  super(viewport)
  @character = character
  @self_angle=self_angle
  self.opacity=0
  @reflected=false
  @former=false
  @moving=false
  if $game_map.terrain_tag(@character.real_x/128,@character.real_y/128+1)==7
    @reflected=true
    @former=true
  end
  update
end


def update
  super
  if @tile_id != @character.tile_id or
     @character_name != @character.character_name or
     @character_hue != @character.character_hue
    @tile_id = @character.tile_id
    @character_name = @character.character_name
    @character_hue = @character.character_hue
    if @tile_id >= 384
      self.bitmap = RPG::Cache.tile($game_map.tileset_name,
        @tile_id, @character.character_hue)
      self.src_rect.set(0, 0, 32, 32)
      self.ox = 16
      self.oy = 32
    else
      self.bitmap = RPG::Cache.character(@character.character_name,
        @character.character_hue)
      @cw = bitmap.width / 4
      @ch = bitmap.height / 4
      self.ox = @cw / 2
      self.oy = @ch
    end
  end
 
  self.visible = (not @character.transparent)
  if @tile_id == 0
    sx = (@character.pattern) * @cw
    sy = (@character.direction - 2) / 2 * @ch
    if @character.direction== 6
          sy = ( 4- 2) / 2 * @ch
    end
    if @character.direction== 4
          sy = ( 6- 2) / 2 * @ch
   end
   if @character.direction != 4 and @character.direction != 6
         sy = (@character.direction - 2) / 2 * @ch
   end
  end
 
  self.x = @character.screen_x
  self.y = @character.screen_y-5
  @moving=!(@character.real_x%128==0 and @character.real_y%128==0)
  @d=@character.direction
  @rect=[sx, sy, @cw, @ch]
  if !(@moving)
    if $game_map.terrain_tag(@character.real_x/128,@character.real_y/128+1)==7
      @reflected=true
      @former=true
    else
      @reflected=false 
      @former=false
    end
   
  else
      case @d
     
      when 2
      if $game_map.terrain_tag(@character.real_x/128,@character.real_y/128+2)==7
        @reflected=true
        if @former==false
          @offset = (@character.screen_y%32)*@ch/32
          @rect=[sx, sy, @cw, @offset]
         
self.y=@character.screen_y-5
        end
      else
        @reflected=false 
      end
     
      when 4
      if $game_map.terrain_tag(@character.real_x/128,@character.real_y/128+1)!=7
        @offset = ((@character.screen_x-@cw/2)%32)*@cw/32
        @rect=[sx, sy, @offset, @ch]
       
self.x=@character.screen_x
      else
        @reflected=true
        if @former==false
          @offset = ((@character.screen_x-@cw/2)%32)*@cw/32
          @rect=[sx+@offset, sy, @cw-@offset, @ch]
         
self.x=@character.screen_x-@offset
        end
      end
     
      when 6
      if $game_map.terrain_tag(@character.real_x/128+1,@character.real_y/128+1)!=7
        @offset = ((@character.screen_x-@cw/2)%32)*@cw/32
        @rect=[sx+@offset, sy, @cw-@offset, @ch]
       
self.x=@character.screen_x-@offset
      else
        @reflected=true
        if @former==false
          @offset = ((@character.screen_x-@cw/2)%32)*@cw/32
          @rect=[sx, sy, @offset, @ch]
         
self.x=@character.screen_x
        end
      end
     
      when 8
      if $game_map.terrain_tag(@character.real_x/128,@character.real_y/128+2)==7
        @reflected=true
        if $game_map.terrain_tag(@character.real_x/128,@character.real_y/128+1)!=7
          @offset = (@character.screen_y%32)*@ch/32
          @rect=[sx, sy, @cw, @offset]
         
self.y=@character.screen_y-5
        end
      else
        @reflected=false 
      end
     
      end


  end
  if @reflected
    self.opacity=128
  else
   @rect=[sx, sy, @cw, @ch]
   self.opacity=0
  end
 
  if $game_map.terrain_tag((@character.real_x+64)/128,@character.real_y/128+2)!=7
    if $game_map.terrain_tag((@character.real_x+64)/128,@character.real_y/128+2)!=7
      @rect[1]= @rect[1]+@ch/2
      @rect[3]= @rect[3]/2
      self.y = self.y - @ch/2
    else
      @reflected=false
    end
  end
   
  self.src_rect.set(@rect[0],@rect[1],@rect[2],@rect[3])
 
  @character.is_a?(Game_Player) ? self.z = 9 : self.z = 5
  self.blend_type = @character.blend_type
  self.bush_depth = @character.bush_depth
  if @character.animation_id != 0
    animation = $data_animations[@character.animation_id]
    animation(animation, true)
    @character.animation_id = 0
  end


  self.angle = @self_angle
end
end


#===================================================
# ▼ CLASS Sprite_Character edit
#===================================================


class Sprite_Character < RPG::Sprite
 alias reflect_initialize initialize
 
 def initialize(viewport, character = nil)
   @character = character
   @reflection = []
   super(viewport)
   if (character.is_a?(Game_Event) and character.list!=nil and character.list[0].code == 108 and character.list[0].parameters == ["r"])
    @reflection.push(Sprite_Reflection.new(viewport,@character))
   end
   if (character.is_a?(Game_Event) and character.list!=nil and character.list[0].code == 108 and character.list[0].parameters == ["hero_r"])
    @reflection.push(Sprite_Reflection.new(viewport,$game_player))
#===================================================
# ● Compatibility with fukuyama's caterpillar script-x
#===================================================
if CATERPILLAR_COMPATIBLE and $game_party.characters!=nil


 for member in $game_party.characters
   @reflection.push(Sprite_Reflection.new(viewport,member))
 end


end
#===================================================
# ● End of the compatibility
#===================================================
   end
   reflect_initialize(viewport, @character)
 end
 
 alias reflect_update update
 
 def update
  reflect_update
  if @reflection!=nil
    for reflect in @reflection
      reflect.update
    end
  end
 end
 
end


 


 


이후 데이타베이스 > 타일 세트 > 지형 태그 > 원하는 오토타일의 번호를 7번으로 설정.


 


그리고 이벤트를 하나 만드신후..


시작조건 > 병렬처리 > 삽입 > 주석 > hero_r > 끝



Who's 창조도시

profile

도움이 필요하면 메일이나 민원실 이용해주세요.

chunmu1@naver.com

 

 

?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수 추천 수
248 RPGXP 스크립트 윈도우 링 메뉴 1 2013.10.01 840 0
247 RPGXP 스크립트 자동 세이브 스크립트 1 청담 2013.09.24 841 0
246 RPGXP 스크립트 컬러 비트맵 타이틀 스크립트 3  운 2015.01.20 852 1
245 RPGMV 플러그인 이벤트(엑스트라) 좌표 콘트롤 플러그인(Move Route Extras - Version 1.1) 1 plam 2015.11.07 858 0
244 RPGMV 플러그인 Mouse System Ex 마우스 입력 시스템 파란별빛 2015.10.30 859 0
243 RPGXP 스크립트 자동으로 장애물을 피해가는 스크립트 청담 2013.09.24 860 0
242 RPGXP 스크립트 커다란 그래픽 좁은 길 못지나가는 스크립트 청담 2013.09.24 866 0
241 RPGXP 스크립트 헤드 업 디스플레이 스크립트 3  운 2015.01.30 867 0
240 RPGMV 플러그인 크리티컬 데미지 배수 설정 3 file 백난화백 2015.11.01 873 0
239 RPGXP 스크립트 아이템 조합 스크립트 2013.10.01 890 0
238 RPGMV 플러그인 MBS - Map Zoom plugin (맵을 확대,축소해주는 플러그인) HT9MAN 2016.01.06 896 0
237 RPGXP 스크립트 텔레포트 스크립트 1 2013.10.01 896 0
236 RPGXP 스크립트 현재 시간 확인 2 2013.10.01 899 0
235 RPGMV 플러그인 Icon Inventory and Details Window (인벤토리 아이템을 아이콘으로 보이게) plam 2016.01.06 903 0
234 RPGXP 스크립트 장비 레벨 제한 2 2013.10.01 903 1
233 RPGXP 스크립트 간단한 여관 스크립트 1 청담 2013.09.24 909 0
232 RPGMV 플러그인 MKMV_SaveManager (심플 세이브 & 세이브 슬롯 확장) 2 file 최빛빛 2015.10.27 912 1
231 RPGMV 플러그인 CSS 캔버스 필터 file 러닝은빛 2016.10.06 912 0
230 RPGMV 플러그인 게임시작하면 바로 뉴게임으로 가는 플러그인! 1 willmv 2015.11.07 924 0
229 RPGXP 스크립트 복권 스크립트 청담 2013.09.24 925 0
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 15 Next
/ 15






[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)