질문과 답변

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 12448
RMVX 차지 기능?? 2 옵티머스 2014.07.13 646
RMVX RPGVX 폰트 변경법 1 칭칭 2014.07.12 1476
RMVX 무기를 장착하면 멋대로 공격력이 적용됩니다. MMM 2014.07.10 577
RMVX $game_party.item_number로 아이템 숫자가 호출이 안 되는데 뭐가 문제일까요? 1 MMM 2014.07.07 751
RMVX 전투 끝나고 바로 페이드아웃 하는 방법 없나요? MMM 2014.07.06 801
RMVX 몬스터 시야 제한 1 붉은 원숭이 2014.07.05 1463
RMVX vx사이드뷰 배틀게임 만들던도중 4 fuckingpassword 2014.07.05 953
RMVX KGC_EquipExtension으로 만든 슬롯의 참조값은 무엇인가요? MMM 2014.07.01 568
RMVX 엘아르디아 게임 있으신분 있으신가요? 빡새 2014.06.22 682
RMVX 스크립트 이건 또 뭐땜에 이런가요 ㅠㅠ(system stack error) 12 file 구레귈궭 2014.06.20 1001
RMVX 멤버 바꾸기로 뺏다가 다시 합류시키면 레벨이 초기화되나요? 1 바크지누크 2014.06.18 610
RMVX 맵이 갑자기 사라지는 경우도 있나요? Mareno 2014.06.18 544
RMVX 스크립트 오류... 3 file 구레귈궭 2014.06.17 936
RMVX (RMVX)타이틀글씨는 뜨는데 메세지글씨가 안뜹니다 3 file 늑대치 2014.06.16 964
RMVX vx 상태를 추가하는 방법이 있는지요? file 피망군 2014.06.16 681
RMVX vx 스킬 쿨타임 생성문의 피망군 2014.06.16 694
RMVX vx 어그로 스크립트 있나요? 피망군 2014.06.15 564
RMVX 이벤트로 그래픽 지정하면 2 파닥이 2014.06.14 541
RMVX 배경설정 1 PDplayer 2014.06.14 487
RMVX RPG VX 캐릭터 그래픽을 어떻게 만드나요? 6 베이비슈 2014.06.12 961
Board Pagination Prev 1 ... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ... 127 Next
/ 127