RPGXP 스크립트
2013.09.24 07:25

캐릭터 그림자

조회 수 1629 추천 수 0 댓글 2
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
사용방법 :  이벤트를 만들고 ㅡ> 시작조건 결정버튼 -> 주석 -> sun -> 완료
NPC 에게 그림자를 줄 때 -> NPC 이벤트 클릭 -> 주석 -> o -> 완료
주의 : 맵처리 경량화 스크립트를 같이 병용하면 동작이 제대로 되지 않습니다.
자, 밑에 부터 복사해 가세요.
 
#==============================================================================
# ■ Sprite_Sun
# # Based on Sprite_Shadow, modified by Rataime
#==============================================================================
CATERPILLAR_COMPATIBLE = false
class Game_Party
  attr_reader :characters
end
class Sprite_Sun < RPG::Sprite
  attr_accessor :character           
 
  def initialize(viewport, character = nil, self_angle = 45,self_opacity = 128)
    super(viewport)
    @character = character
    @self_angle=self_angle
    @self_opacity=self_opacity
    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
     @direct=@character.direction
     
      if self.angle>90 or angle<-90
   
        if @direct== 6
               sy = ( 4- 2) / 2 * @ch
      end
      if @direct== 4
               sy = ( 6- 2) / 2 * @ch
        end
        if @direct != 4 and @direct !=6
        sy = (@character.direction - 2) / 2 * @ch
          end
        else
     sy = (@character.direction - 2) / 2 * @ch
     end
       self.src_rect.set(sx, sy, @cw, @ch)
    end
    self.x = @character.screen_x
    self.y = @character.screen_y-5
    self.z = @character.screen_z(@ch)-1
    self.opacity = @character.opacity
    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-90
    self.color = Color.new(0, 0, 0)
    $game_map.sun==-1 ? self.opacity = 0: self.opacity = @self_opacity
  end
end
#===================================================
# ▼ CLASS Sprite_Character edit
#===================================================
class Sprite_Character < RPG::Sprite
  alias sun_initialize initialize
  
  def initialize(viewport, character = nil)
    @character = character
    super(viewport)
    @sunlist=[]
    if (character.is_a?(Game_Event) and character.list!=nil and character.list[0].code == 108 and character.list[0].parameters == ["sun"])
      if (character.list[1]!=nil and character.list[1].code == 108)
        @self_angle=character.list[1].parameters[0]
      else
        @self_angle=45
      end
      if (character.list[2]!=nil and character.list[2].code == 108)
        @self_opacity=character.list[2].parameters[0]
      else
        @self_opacity=128
      end
     for i in $game_map.events.keys.sort
      if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["o"])
        @sunlist[i+1] = Sprite_Sun.new(viewport, $game_map.events[i],@self_angle,@self_opacity)
      end
     end
     @sunlist[1] = Sprite_Sun.new(viewport, $game_player,@self_angle,@self_opacity)
   
#===================================================
# ● Compatibility with fukuyama's caterpillar script
#===================================================
if CATERPILLAR_COMPATIBLE and $game_party.characters!=nil
  for member in $game_party.characters
    @sunlist.push(Sprite_Sun.new(viewport, member,@self_angle,@self_opacity))
  end
end
#===================================================
# ● End of the compatibility
#===================================================

    end
    sun_initialize(viewport, @character)
  end
  
  alias sun_update update
  
  def update
    sun_update
    if @sunlist!=[]
      for i in 1..@sunlist.size
        if @sunlist[i]!=nil
          @sunlist[i].update
        end
      end
    end
  end  
  
end
#===================================================
# ▼ CLASS Scene_Save edit
#===================================================
class Scene_Save < Scene_File
  
  alias sun_write_save_data write_save_data
  
  def write_save_data(file)
    $game_map.sun = nil
    sun_write_save_data(file)
  end
end
#===================================================
# ▼ CLASS Game_Map edit
#===================================================
class Game_Map
  attr_accessor :sun
end

출처: 아방스
?

  1. Mog_Battle_hud(MZ버전도 있습니다)

    Date2021.03.05 CategoryRPGMV 플러그인 By스트레이보우 Views1847 Votes0
    Read More
  2. 컷신 플러그인

    Date2020.10.30 CategoryRPGMV 플러그인 By스트레이보우 Views2453 Votes0
    Read More
  3. 업적플러그인

    Date2020.09.02 CategoryRPGMV 플러그인 By스트레이보우 Views2090 Votes0
    Read More
  4. 한글조합입력기(영어가능)

    Date2019.11.10 CategoryRPGXP 스크립트 By조규진1 Views946 Votes0
    Read More
  5. 게임에서 제공해주는 노래가 아닌 외부에서 다운받고 안에 넣어쓰려면 어떻게 해야하나요?

    Date2019.07.26 CategoryRPGMV 플러그인 ByBigOrca Views1463 Votes0
    Read More
  6. Ghost Effect

    Date2019.01.20 CategoryRPGMV 플러그인 By러닝은빛 Views1156 Votes0
    Read More
  7. RPG XP Xas액알

    Date2018.10.30 CategoryRPGXP 스크립트 By심심치 Views1161 Votes0
    Read More
  8. 커스텀 숫자 입력 패드

    Date2018.10.19 CategoryRPGMV 플러그인 By러닝은빛 Views1222 Votes0
    Read More
  9. 9마리 이상의 몬스터 설정 | More Enemies

    Date2018.08.31 CategoryRPGMV 플러그인 By러닝은빛 Views974 Votes0
    Read More
  10. 동적 맵 타일 수정 플러그인

    Date2018.07.17 CategoryRPGMV 플러그인 By베지테리안카카오 Views1035 Votes0
    Read More
  11. VXA에서 XBOX360 컨트롤러 사용 여부 체크

    Date2018.07.15 CategoryRPGVX Ace 스크립트 By러닝은빛 Views891 Votes0
    Read More
  12. RMMV 옵션 창에 메시지 속도 및 글자 크기 변경 기능 추가

    Date2018.07.15 CategoryRPGMV 플러그인 By러닝은빛 Views1636 Votes0
    Read More
  13. 한글 데미지 표시

    Date2018.07.09 CategoryRPGMV 플러그인 By러닝은빛 Views1420 Votes0
    Read More
  14. [ MV ] 심장[체력표시 하트] 플러그인

    Date2018.07.01 CategoryRPGMV 플러그인 By수성의물 Views2257 Votes0
    Read More
  15. [鳥小屋] 실적 플러그인(인게임 트로피 시스템)

    Date2017.10.31 CategoryRPGMV 플러그인 By이니군 Views1747 Votes0
    Read More
  16. LuD Script Package

    Date2017.08.16 CategoryRPGVX Ace 스크립트 ByLuD Views1674 Votes0
    Read More
  17. [VXAce] 레이어 맵 <layer> 시스템

    Date2017.08.07 CategoryRPGVX Ace 스크립트 ByLuD Views1272 Votes0
    Read More
  18. [RPG MV] 퀘스트 마커 지속 표시 플러그인

    Date2017.04.09 CategoryRPGMV 플러그인 Bylklslel Views1697 Votes0
    Read More
  19. Mirror Area - RPG Maker MV

    Date2017.01.03 CategoryRPGMV 플러그인 By러닝은빛 Views5033 Votes0
    Read More
  20. Keyboard Event - RPG Maker MV

    Date2017.01.03 CategoryRPGMV 플러그인 By러닝은빛 Views2311 Votes0
    Read More
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(김원배) | 사신지(김병국)