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
441 기타 ID띄우기 스크립트(新) 3 백호 2009.02.22 1280
440 기타 제작한 게임의 파일을 모두 exe파일 하나에 쓸어담기 by sheefo@Creation Asylum 1 file 백호 2009.02.22 1239
439 HUD 맵 이름 표시 by Slipknot@rmxp.net (SDK호환) 2 백호 2009.02.22 1463
438 기타 파노라마 스크롤 스크립트 개량판 by Guillaume777 1 백호 2009.02.22 896
437 맵/타일 Map Event Large Make 2 백호 2009.02.22 1132
436 기타 ABS 몬스터 HP 게이지 바 11 백호 2009.02.22 2483
435 그래픽 Bitmap update 2.0 by Linkin_T 1 백호 2009.02.22 985
434 기타 다중 파노라마 사용 by Guillaume777 file 백호 2009.02.22 886
433 스킬 Skill Shop by SephirothSpawn file 백호 2009.02.22 813
432 메시지 Animated Window Skin by Tana 1 백호 2009.02.22 1338
431 기타 Weather Script 1.02 by ccoa 1 file 백호 2009.02.22 809
430 아이템 아이템 인벤토리 2 file 백호 2009.02.22 3354
429 기타 일시정지 스크립트 2 file 백호 2009.02.22 1796
428 장비 Multi-equip script ver.6 by Guillaume777 4 file 백호 2009.02.22 1210
427 기타 KGC 디버거 (최신 올라온 것에 비해 성능은 딸리지만) file 백호 2009.02.22 929
426 메뉴 KGC 메뉴화면 개조 스크립트 번역 3 file 백호 2009.02.22 1940
425 메뉴 자작 커스텀 메뉴(데모 첨부) 3 백호 2009.02.22 2347
» 아이템 아이템을 얻으면 자동으로 아이템 입수 메세지윈도우 띄우기 4 백호 2009.02.22 2279
423 기타 아래 스크립트에 대한 Guillaume777님의 개량판입니다. 백호 2009.02.22 880
422 오디오 WinAMP 플러그인을 이용하여 RMXP에서 다른 형식의 음악파일 재생하기 file 백호 2009.02.22 1259
Board Pagination Prev 1 ... 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 ... 52 Next
/ 52