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
34 아이템 아이템 소지수 한계돌파(중복일 확률 높음) 3 캉쿤 2011.09.13 1478
33 아이템 Categorized Items Menu 1.3 by albertfish 1 file Alkaid 2010.09.09 1795
32 아이템 아이템창변경 27 카르닉스 2010.02.26 3631
31 아이템 아이템소지수 한계돌파 (중복일지도) 12 카르닉스 2010.02.26 1498
30 아이템 [LPG] 아이템 상세정보 - ◇ Last Update : 2009/08/11 ◇ 11 file Claymore 2009.08.16 3307
29 아이템 CSSR14-아이템 합성 3 file 백호 2009.02.22 2833
28 아이템 아이템 사용 클래스 한정 스크립트! 2 백호 2009.02.22 1146
27 아이템 지정한 아이템 갯수 제한 3 백호 2009.02.22 1282
26 아이템 아이템 단축키로 구입 스크립트 3 백호 2009.02.22 1243
25 아이템 [신기술 체험] 인벤토리 8 file 백호 2009.02.22 2962
24 아이템 Easy Item & Gold Gain by SephirothSpawn (SDK호환) 백호 2009.02.22 880
23 아이템 Additional Item Drop by SephirothSpawn (SDK호환) 1 백호 2009.02.22 891
22 아이템 SG_Item Break by sandgolem (SDK호환) 백호 2009.02.22 897
21 아이템 SG_Escape Only Items by sandgolem (SDK호환) 백호 2009.02.22 850
20 아이템 SG_Hide free item cose by sandgolem (SDK호환) 백호 2009.02.22 935
19 아이템 Item Acquired Window by SiliconHero@rmxp.net 백호 2009.02.22 1096
18 아이템 아이템 인벤토리 2 file 백호 2009.02.22 3354
» 아이템 아이템을 얻으면 자동으로 아이템 입수 메세지윈도우 띄우기 4 백호 2009.02.22 2279
16 아이템 소지/구입 아이템 갯수 99개 이상 가능(약간 수정) 2 백호 2009.02.22 1103
15 아이템 아이템 정리기능 S크립T 1 file 백호 2009.02.21 1080
Board Pagination Prev 1 2 Next
/ 2