XP 스크립트

RPG Advocate의 커스텀 윈도우 튜토리얼 - http://www.phylomortis.com/resource/script/tut002.html
이벤트에서 스크립트를 사용하는 대신 아이템을 얻으면 자동으로 윈도우가 뜨게 수정 -
http://www.rmxp.net/forums/index.php?showtopic=10874&hl=
(내용을 보려면 로그인 필요)

  아래 스크립트는 위의 링크에 있는 내용을 한데 모은 것입니다:

class Window_ItemGet < Window_Base #아이템 입수시 표시되는 윈도우
  #------------------------------
  attr_accessor :type
  attr_accessor :id
  #--------------------------------------------------------------------------
  # Initialize the Object.
  #--------------------------------------------------------------------------
  def initialize(type, id)
    super(220, 180, 220, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 255
    self.contents.font.name = ["Arial","돋움"]
    self.contents.font.size = 18
    @type = type
    @id = id
    refresh
  end
  #--------------------------------------------------------------------------
  # Refresh.
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 180, 32, "입수:")
    if @type == 1
      self.draw_item_name($data_items[@id], 4, 32)
    end
    if @type == 2
      self.draw_item_name($data_weapons[@id], 4, 32)
    end
    if @type == 3
      self.draw_item_name($data_armors[@id], 4, 32)
    end
    if @type == 4
      @type = 4
    end
  end
  #--------------------------------------------------------------------------
  # Frame Update.
  #--------------------------------------------------------------------------
  def update
    super
    end
  end


class Interpreter
  #--------------------------------------------------------------------------
  # * Change Items
  #--------------------------------------------------------------------------
  def command_126
    # Get value to operate
    value = operate_value(@parameters[1], @parameters[2], @parameters[3])
    # Increase / decrease items
    $game_party.gain_item(@parameters[0], value)
    # Continue
    $scene.item_acquired[0] = 1 #아이템 입수시 입수 메세지창 표시
    $scene.item_acquired[1] = (@parameters[0])
    $game_system.se_play(-SE-name-) #추가 끝.  (-SE-name에는 원하는 SE파일명을 넣음)
    return true
  end
  #--------------------------------------------------------------------------
  # * Change Weapons
  #--------------------------------------------------------------------------
  def command_127
    # Get value to operate
    value = operate_value(@parameters[1], @parameters[2], @parameters[3])
    # Increase / decrease weapons
    $game_party.gain_weapon(@parameters[0], value)
    # Continue
    $scene.item_acquired[0] = 2 #아이템 입수시 입수 메세지창 표시
    $scene.item_acquired[1] = (@parameters[0])
    $game_system.se_play(-SE-name-) #추가 끝.  (-SE-name에는 원하는 SE파일명을 넣음)
    return true
  end
  #--------------------------------------------------------------------------
  # * Change Armor
  #--------------------------------------------------------------------------
  def command_128
    # Get value to operate
    value = operate_value(@parameters[1], @parameters[2], @parameters[3])
    # Increase / decrease armor
    $game_party.gain_armor(@parameters[0], value)
    # Continue
    $scene.item_acquired[0] = 3 #아이템 입수시 입수 메세지창 표시
    $scene.item_acquired[1] = (@parameters[0])
    $game_system.se_play(-SE-name-) #추가 끝.  (-SE-name에는 원하는 SE파일명을 넣음)
    return true
  end
end


class Scene_Map
  # ---------------------
  attr_accessor :item_acquired #추가 -아이템 입수시 입수 메세지창 표시
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make sprite set
    @spriteset = Spriteset_Map.new
    # Make message window
    @message_window = Window_Message.new
    #추가 -아이템 입수시 입수 메세지창 표시
    @acquire_window = Window_ItemGet.new(1, 0) #
    @acquire_window.visible = false #
    @itemdelay = -1 #
    @item_acquired = [0, 0] # 추가 끝
    # Transition run
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of sprite set
    @spriteset.dispose
    # Dispose of message window
    @message_window.dispose
    @acquire_window.dispose #추가 -아이템 입수시 입수 메세지창 표시
    # If switching to title screen
    if $scene.is_a?(Scene_Title)
      # Fade out screen
      Graphics.transition
      Graphics.freeze
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Loop
    loop do
      # Update map, interpreter, and player order
      # (this update order is important for when conditions are fulfilled
      # to run any event, and the player isn't provided the opportunity to
      # move in an instant)
      $game_map.update
      $game_system.map_interpreter.update
      $game_player.update
      # Update system (timer), screen
      $game_system.update
      $game_screen.update
      # Abort loop if player isn't place moving
      unless $game_temp.player_transferring
        break
      end
      # Run place move
      transfer_player
      # Abort loop if transition processing
      if $game_temp.transition_processing
        break
      end
    end
    # Update sprite set
    @spriteset.update
    #추가 -아이템 입수시 입수 메세지창 표시
    if @itemdelay > 0
      @itemdelay -= 1 # 2
    end
    if @itemdelay == 0 # 3
      @itemdelay = -1
      @acquire_window.visible = false
      @item_acquired[0] = 0
      @item_acquired[1] = 0
    end #추가 끝
    # Update message window
    @message_window.update
    #추가 -아이템 입수시 입수 메세지창 표시
    if @item_acquired[0] != 0 &&
      @item_acquired[1] != 0 && @itemdelay < 0 # 1
      @acquire_window.type = @item_acquired[0]
      @acquire_window.id = @item_acquired[1]
      @acquire_window.refresh
      @acquire_window.visible = true
      @itemdelay = 125
    end #추가 끝
    # If game over
    if $game_temp.gameover
      # Switch to game over screen
      $scene = Scene_Gameover.new
      return
    end
    # If returning to title screen
    if $game_temp.to_title
      # Change to title screen
      $scene = Scene_Title.new
      return
    end
    # If transition processing
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    # If showing message window
    if $game_temp.message_window_showing
      return
    end
    # If encounter list isn't empty, and encounter count is 0
    if $game_player.encounter_count == 0 and $game_map.encounter_list != []
      # If event is running or encounter is not forbidden
      unless $game_system.map_interpreter.running? or
            $game_system.encounter_disabled
        # Confirm troop
        n = rand($game_map.encounter_list.size)
        troop_id = $game_map.encounter_list[n]
        # If troop is valid
        if $data_troops[troop_id] != nil
          # Set battle calling flag
          $game_temp.battle_calling = true
          $game_temp.battle_troop_id = troop_id
          $game_temp.battle_can_escape = true
          $game_temp.battle_can_lose = false
          $game_temp.battle_proc = nil
        end
      end
    end
    # If B button was pressed
    if Input.trigger?(Input::B)
      # If event is running, or menu is not forbidden
      unless $game_system.map_interpreter.running? or
            $game_system.menu_disabled
        # Set menu calling flag or beep flag
        $game_temp.menu_calling = true
        $game_temp.menu_beep = true
      end
    end
    # If debug mode is ON and F9 key was pressed
    if $DEBUG and Input.press?(Input::F9)
      # Set debug calling flag
      $game_temp.debug_calling = true
    end
    # If player is not moving
    unless $game_player.moving?
      # Run calling of each screen
      if $game_temp.battle_calling
        call_battle
      elsif $game_temp.shop_calling
        call_shop
      elsif $game_temp.name_calling
        call_name
      elsif $game_temp.menu_calling
        call_menu
      elsif $game_temp.save_calling
        call_save
      elsif $game_temp.debug_calling
        call_debug
      end
    end
  end
end

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '4'
  • ?
    [A]중딩 2009.12.31 20:17

    에러가뜨네요; 59,73,87에러요..

    득된돈과 경치도 메세지로떴으면...

  • ?
    카비 2010.01.01 18:49

    음..

    이름을써넣어도 에러는 여전하네요.

  • ?
    똥꾸빵구 2010.01.03 20:47

    이거 그냥 ABS쓰는게 날 것 같네요.........

  • ?
    지존!! 2010.07.21 17:46

    뭔지는 몰겠는데


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
1021 아이템 흠..몬스터도감말고 아이템도감~ 9 백호 2009.02.21 2028
1020 전투 흠.. 아직도 이 스크립트가 없군요 ㅋㅋ(제가올림..) 1 file 백호 2009.02.21 3335
1019 전투 횡스크롤형식의 스크립트 7 백호 2009.02.21 2972
1018 기타 횡스크롤 스크립트 한국말 번역. 15 file 백호 2009.02.21 3311
1017 기타 회복으로 데미지를 받는 좀비 스크립트 7 백호 2009.02.22 2004
1016 메뉴 화살표 모양 셀렉트 커서 사용 2 백호 2009.02.22 2118
1015 그래픽 화면을 부드럽게 해주는스크립트[ 아주 유용] 56 file - 하늘 - 2009.08.05 6561
1014 미니맵 화면에 축소된 미니맵을 표시하는 스크립트 - 한글 번역 - 6 file 백호 2009.02.21 2560
1013 화면에 축소된 맵을 표시하는 스크립트 7 file 백호 2009.02.21 2394
1012 기타 홈페이지 띄우기 (VX 상관없음.) 6 KNAVE 2009.08.25 2137
1011 메뉴 혹시있나해서-_-.. 대화창에 테두리치기 스크립트 7 백호 2009.02.22 2592
1010 기타 현재시간표시 33 file 코아 코스튬 2010.10.09 2528
1009 기타 현재 맵BGM을 그대로 전투 BGM으로 연결 from phylomortis.com 백호 2009.02.22 1180
1008 이름입력 한글조합입력기(영어가능) file 조규진1 2019.11.10 497
1007 메시지 한글자씩 뜨는 스크립트 6 백호 2009.02.21 3001
1006 키입력 한글입력스크립트 16 file 아방스 2007.11.09 11823
1005 키입력 한글입력기(자음, 모음 분리. 아마 중복일 듯...) 11 캉쿤 2011.09.13 3225
1004 키입력 한글입력기 6 백호 2009.02.22 4298
1003 이름입력 한글이름 입력기 스크립트 14 백호 2009.02.22 4205
1002 메시지 한글 채팅 스크립트 32 file こなた 2009.01.22 4947
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52