질문과 답변

Extra Form
Comment '3'
  • profile
    Lighna 2012.02.17 20:07

    그림의 표시로 하신거 같은데, 표시하실때 "가산 보통 감산" 세가지중 어느걸로 하셨는지 채크해보세요.

  • ?
    네이피어 2012.02.17 22:06

    $imported = {} if $imported == nil
    $imported["ReiLimitedVision"] = true

    #---------------------------------------------------------------------------
    # ** Rei Module
    #---------------------------------------------------------------------------
    module Rei
      module LimitedVision
      TOG = 11   # Switch Id to activate this script
      HFR = 72   # How far is the picture's placement from the player
                 # 0 is on the player , negative is behind, positive is in front
      IZX = 130  # Initial horizontal zoom % of the visibility
      IZY = 130  # Initial vertical zoom % of the visibility
      # negative = reduce, positive = add
      RUN = -30  # When player's running, visibility will be added/reduced to this %
      STD = 50   # When player's didn't running, visibility will be added/reduced to
                 # this %
      LGT = 15   # Switch Id to activate "player has a flashlight" that can increase
                 # or reduce visibility when flashlight is active
      BUT = Input::F5 # Player must press this button to activate the flashlight
      RWL = 20   # When player's running (flashlight on), visibility will be
                 # added/reduced to this %
      SWL = 80   # When player's didn't running (flashlight on), visibility will be
                 # added/reduced to this %
      DLY = 20   # Delay to change visibility in frames (60frames=1sec)
                 # Higher values are smoother, but may looks weird when running..
                
                
      KTS = false # true = Using KTS, false = not using KTS
      KGC = false  # true = Using KGC's DayNight, false = no   (V.1.2)
     
      # Below is only usable if KTS = true or KGC = true
     
      # Above percentage will be added with these..
     
      # -- For Indoor Maps (Maps without [KTS] OR maps WITH [DN_VOID]) --
      INT = -50  # At the night, visibility will be added/reduced to this %
      IMN = 50   # At the morning, visibility will be added/reduced to this %
      IDY = 75   # At the day, visibility will be added/reduced to this %
      IEN = -25  # At the evening, visibility will be added/reduced to this %
     
      # -- For Outdoor Maps (Maps with [KTS] OR maps WITHOUT [DN_VOID] ) --
      ONT = -30  # At the night, visibility will be added/reduced to this %
      OMN = 75   # At the morning, visibility will be added/reduced to this %
      ODY = 100  # At the day, visibility will be added/reduced to this %
      OEN = -10  # At the evening, visibility will be added/reduced to this %
     
      # V.1.1
      #----
      VSP = []      # < Don't edit or remove this
      #----
     
      USV = 1       # Variable Id used to change visibility.
                    # To change it, just set variable value to one of the number below

      VSP[0] = "av"  # < Visibility picture no.0
      VSP[1] = "av1" # < Visibility picture no.1
      VSP[2] = "av2" # < Visibility picture no.2
      VSP[3] = "av3" # < Visibility picture no.3
      VSP[4] = "av4" # < Visibility picture no.4
      # Add as many as you want
     
      SET = 1        # Set this switch Id on if you want the visibility picture's
                     # tone to be changed with the one below.
                    
      TON = Tone.new(255,255,255,255)
      # To change TON variable in game,
      # use REI::LIMITEDVISION::TON = Tone.new(r,g,b,a)
      # Example : REI::LIMITEDVISION::TON = Tone.new(255,0,0,255)
      # r = red, g = green, b = blue, a = alpha/grey
      end
    end

    #------------------------------------------------------------------------------
    # Module RPG
    #------------------------------------------------------------------------------
    module RPG
      class State
        def mod_vis
          self.note.each_line {|line|
          return line.gsub!('%mod ', '').chomp.to_i if line.include?('%mod ')
          }
          return 0
        end
      end
    end
    #==============================================================================
    # ** Scene_Map
    #------------------------------------------------------------------------------
    #  This class performs the map screen processing.
    #==============================================================================
    class Scene_Map < Scene_Base
      # Alias things
      alias reilimitedvisioninit initialize unless method_defined?('reilimitedvisioninit')
      alias reilimitedvisionstart start unless method_defined?('reilimitedvisionstart')
      alias reilimitedvisionupdate update unless method_defined?('reilimitedvisionupdate')
      alias reilimitedvisionterminate terminate unless method_defined?('reilimitedvisionterminate')
      #--------------------------------------------------------------------------
      # * Initialize
      #--------------------------------------------------------------------------
      def initialize
        $reivisibility_sprite = Game_Picture.new(21)
        reilimitedvisioninit
      end
      #--------------------------------------------------------------------------
      # * Start processing
      #--------------------------------------------------------------------------
      def start
        if $game_switches[Rei::LimitedVision::TOG]
          index = $game_variables[Rei::LimitedVision::USV]
          @pic = Rei::LimitedVision::VSP[index]
          $reivisibility_sprite.show(@pic,1,getvis[0],getvis[1],
          Rei::LimitedVision::IZX+Rei::LimitedVision::STD+mod_state_range[0],
          Rei::LimitedVision::IZY+Rei::LimitedVision::STD+mod_state_range[1],255, 0)
          dovisibilitythingy(1)
          @showed = true
        end
        reilimitedvisionstart
      end
      #--------------------------------------------------------------------------
      # * Get modified range by states
      #--------------------------------------------------------------------------
      def mod_state_range
        result = [0,0]
        for actor in $game_party.members
          next if actor.states.empty?
          for state in actor.states
            next if state.nil? or state.mod_vis == 0
            zoomx = state.mod_vis
            zoomy = state.mod_vis
            result = [zoomx,zoomy]
          end
        end
      return result
      end
      #--------------------------------------------------------------------------
      # * Setup visibility coordinate
      #--------------------------------------------------------------------------
      def getvis
        result = []
          case $game_player.direction
          when 2
            x = $game_player.screen_x
            y = $game_player.screen_y + Rei::LimitedVision::HFR
          when 4
            x = $game_player.screen_x - Rei::LimitedVision::HFR
            y = $game_player.screen_y
          when 6
            x = $game_player.screen_x + Rei::LimitedVision::HFR
            y = $game_player.screen_y
          when 8
            x = $game_player.screen_x
            y = $game_player.screen_y - Rei::LimitedVision::HFR
          end
        result = [x,y]
        return result
      end
      #--------------------------------------------------------------------------
      # * Setup visibility
      #--------------------------------------------------------------------------
      def dovisibilitythingy(dur = Rei::LimitedVision::DLY)
        zoomx = Rei::LimitedVision::IZX + mod_state_range[0]
        zoomy = Rei::LimitedVision::IZY + mod_state_range[1]
        opa = 255
        if Rei::LimitedVision::KTS == true
          if $kts_map_data[$game_map.map_id].outside_tint?
            zoomx += Rei::LimitedVision::ONT if $game_switches[KTS::NIGHT]
            zoomy += Rei::LimitedVision::ONT if $game_switches[KTS::NIGHT]
            zoomx += Rei::LimitedVision::OMN if $game_switches[KTS::DAWN]
            zoomy += Rei::LimitedVision::OMN if $game_switches[KTS::DAWN]
            zoomx += Rei::LimitedVision::ODY if $game_switches[KTS::DAY]
            zoomy += Rei::LimitedVision::ODY if $game_switches[KTS::DAY]
            zoomx += Rei::LimitedVision::OEN if $game_switches[KTS::SUNSET]
            zoomy += Rei::LimitedVision::OEN if $game_switches[KTS::SUNSET]
          else
            zoomx += Rei::LimitedVision::INT if $game_switches[KTS::NIGHT]
            zoomy += Rei::LimitedVision::INT if $game_switches[KTS::NIGHT]
            zoomx += Rei::LimitedVision::IMN if $game_switches[KTS::DAWN]
            zoomy += Rei::LimitedVision::IMN if $game_switches[KTS::DAWN]
            zoomx += Rei::LimitedVision::IDY if $game_switches[KTS::DAY]
            zoomy += Rei::LimitedVision::IDY if $game_switches[KTS::DAY]
            zoomx += Rei::LimitedVision::IEN if $game_switches[KTS::SUNSET]
            zoomy += Rei::LimitedVision::IEN if $game_switches[KTS::SUNSET]
          end
        elsif Rei::LimitedVision::KGC == true
          if $game_map.daynight_void?
            phase = KGC::DayNight::PHASE_VARIABLE
            zoomx += Rei::LimitedVision::ODY if phase == 0
            zoomy += Rei::LimitedVision::ODY if phase == 0
            zoomx += Rei::LimitedVision::OEN if phase == 1
            zoomy += Rei::LimitedVision::OEN if phase == 1
            zoomx += Rei::LimitedVision::ONT if phase == 2
            zoomy += Rei::LimitedVision::ONT if phase == 2
            zoomx += Rei::LimitedVision::OMN if phase == 3
            zoomy += Rei::LimitedVision::OMN if phase == 3
          else
            phase = KGC::DayNight::PHASE_VARIABLE
            zoomx += Rei::LimitedVision::IDY if phase == 0
            zoomy += Rei::LimitedVision::IDY if phase == 0
            zoomx += Rei::LimitedVision::IEN if phase == 1
            zoomy += Rei::LimitedVision::IEN if phase == 1
            zoomx += Rei::LimitedVision::INT if phase == 2
            zoomy += Rei::LimitedVision::INT if phase == 2
            zoomx += Rei::LimitedVision::IMN if phase == 3
            zoomy += Rei::LimitedVision::IMN if phase == 3
          end
        end
        if $game_player.moving? and $game_player.dash?
          zoomx += Rei::LimitedVision::RUN
          zoomy += Rei::LimitedVision::RUN
        else
          zoomx += Rei::LimitedVision::STD
          zoomy += Rei::LimitedVision::STD
        end
        if Input.press?(Rei::LimitedVision::BUT) and $game_switches[Rei::LimitedVision::LGT]
          if $game_player.moving? and $game_player.dash?
            zoomx += Rei::LimitedVision::RWL
            zoomy += Rei::LimitedVision::RWL
          else
            zoomx += Rei::LimitedVision::SWL
            zoomy += Rei::LimitedVision::SWL
          end
        end
        if $game_switches[Rei::LimitedVision::SET]
          $reivisibility_sprite.start_tone_change(Rei::LimitedVision::TON,0)
        else
          $reivisibility_sprite.start_tone_change(Tone.new(0,0,0,0),0)
        end
        $reivisibility_sprite.move(1, getvis[0], getvis[1], zoomx,zoomy,opa, 0, dur)
      end
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
        reilimitedvisionupdate
        if $game_switches[Rei::LimitedVision::TOG]
          if @showed == true
            if  @pic != Rei::LimitedVision::VSP[$game_variables[Rei::LimitedVision::USV]]
              @pic = Rei::LimitedVision::VSP[$game_variables[Rei::LimitedVision::USV]]
              @showed = false
            end
            dovisibilitythingy
            $reivisibility_sprite.update
          else
            if  @pic != Rei::LimitedVision::VSP[$game_variables[Rei::LimitedVision::USV]]
              @pic = Rei::LimitedVision::VSP[$game_variables[Rei::LimitedVision::USV]]
            end
            $reivisibility_sprite.show(@pic,1,getvis[0],getvis[1],
            Rei::LimitedVision::IZX+Rei::LimitedVision::STD+mod_state_range[0],
            Rei::LimitedVision::IZY+Rei::LimitedVision::STD+mod_state_range[1],255, 0)
            @showed = true
            dovisibilitythingy(1)
          end
        else
          if $reivisibility_sprite.name != ""
            $reivisibility_sprite.erase
            @showed = false
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Termination Processing
      #--------------------------------------------------------------------------
      def terminate
        $reivisibility_sprite.erase
        @showed = false
        reilimitedvisionterminate
      end
    end
    #==============================================================================
    #------------------------------------------------------------------------------
    # Woratana script, my version
    #------------------------------------------------------------------------------
    class Spriteset_Map
      alias reicreatepic create_pictures unless method_defined?('reicreatepic')
      #--------------------------------------------------------------------------
      # * Create Picture Sprite
      #--------------------------------------------------------------------------
      def create_pictures(*args);reicreatepic(*args)
        @picture_sprites.push(Sprite_Picture.new(@viewport1,$reivisibility_sprite))
      end
    end
    class Sprite_Picture < Sprite
      alias reipic_upd update unless method_defined?('reipic_upd')
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update(*args);reipic_upd(*args)
        self.z = $game_player.screen_z + 125 if @picture.number == 21;end
    end
    이 스크립트 따와서 고대로 쓴겁니다.

    그림도 따서 하나도 안고치고요.

  • ?
    네이피어 2012.02.17 23:56

    아이고 됬습니다.

    스크립트에서 색조를 (255,255,255,255)인걸 0으로 바꿔주니 됬습니다.

    (내가 왜 이생각을 못했지.)

     

    데모 프로젝트에선 255해도 잘만 되던데 제 스크립트에선 0으로 해야하는군요.

    왜그럴까요 ㅎㅎ


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12392
RMVX 메뉴창들을 투명하게 할 수 있는 스크립트 위치를 모르겠습니다. 4 file 1년이지났네 2014.07.22 1181
RMVX 화면 여백을 없애고 늘리는 방법 10 file 크리스토퍼 2014.01.09 1181
RMVXA 월드맵을 시점을 내려서 만들수 있을까요? 7 file H.M. 2013.10.27 1182
RMXP 대화창에 사진넣는방법 2 봉지스 2012.08.12 1182
RMVXA 플레이어 뒤에 이벤트가 따라붙게 하고싶어요. 4 Virtus 2013.11.27 1183
RMVXA VX ACE 온라인 스크립트 질문과 그외질문 anrkd23 2012.06.21 1183
기타 레벨 포인트같은거.. 1 고자몬 2011.07.10 1183
RMXP 대화창 색깔바꾸기 1 봉지스 2012.08.14 1183
RMXP rpg xp로 아오오니처럼 어캐만들어요? 1 팡팡이 2013.05.08 1183
RMXP 용병시스템 2 준프로겜 2012.09.11 1183
RMVX 타이틀에 글자 바꾸기 1 펜슬 2011.02.09 1184
RMVX RMVX 맵칩을 추가하고싶은데... 5 file Kasahime 2013.05.12 1184
RMXP 이 캐릭터좀 찾아주세요 file ★RPG마스터★ 2011.03.06 1185
기타 웹 문제...이거 어떻게 하나요.. file 은색바람 2011.08.15 1185
기타 아방스에서 완성작게임자료실,일반게임자료실의 차이점은 무엇인가요? 1 라유 2011.10.12 1185
RMVXA 타일셋을 바꿧는데 캐릭터가 안움직입니다(방향만움직임) 2 file PengBle 2013.05.06 1185
기타 화면에캐릭터가안떠요 3 이솔 2012.12.03 1185
기타 rpg만들기 파일이 실행하면 팅겨요 2 고마구 2014.01.08 1185
RMVXA RPG VXA 스크립트 게시판에 올라온 사이드 뷰 스크립트에 대해 질문 홍색의환상향 2013.05.05 1186
툴선택 RMXP 정품 6 낙원의공허 2013.05.20 1186
Board Pagination Prev 1 ... 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 ... 516 Next
/ 516