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
661 이동 및 탈것 Super Simple Vehicle System Enhanced 8.0 by DerVVulfman 1 Alkaid 2010.12.12 1956
660 변수/스위치 Switchless Common Events by PK8(XP/VX/VXA) Alkaid 2012.09.15 1199
659 메뉴 Tales Of Symphonia Menu 8 file 백호 2009.02.21 1744
658 기타 Tax Script 1.2 by The Darklord@rmxp.org 2 file 백호 2009.02.22 1130
657 메시지 Taylor's Simple Message System 2000 Alkaid 2020.07.05 241
656 기타 Terrain Encounter Areas by SephirothSpawn 백호 2009.02.22 778
655 기타 Tetris Attack by trickster 1 file 백호 2009.02.22 986
654 기타 Text Scroll by Dubealex (Release 3) 2 file 백호 2009.02.22 939
653 기타 Text to RGSS by DerVVulfman Alkaid 2011.04.18 1319
652 영상 The AVI Player 1.3 by DerVVulfman 3 Alkaid 2010.10.08 1706
651 기타 The General Monster Generator 1.1 by DerVVulfman 1 file Alkaid 2011.03.02 1496
650 전투 The Lycan ABS by DerVVulfman Alkaid 2013.07.22 1895
649 변수/스위치 The Self Data Suite by PK8 (XP/VX/VXA) Alkaid 2012.09.14 1232
648 기타 Trailing Characters ver.1 by SephirothSpawn 6 file 백호 2009.02.22 1551
647 그래픽 Transition Pack 1.11 by Fantasist Alkaid 2011.01.22 2043
646 스킬 Trickster's Bag of Skill Effects file 백호 2009.02.22 1077
645 스킬 Trickster's Bag of Skill Effects (SDK 필요) Alkaid 2012.09.17 1289
644 이동 및 탈것 Trickster's Caterpillar System 0.99 3 Alkaid 2010.12.23 1590
643 메뉴 Trickster's Plug 'n' Play Gradient Bar 2.0 1 file 백호 2009.02.22 2051
642 전투 Trickster씨의 전투 시스템 (SDK 필수?) Alkaid 2012.09.18 3256
Board Pagination Prev 1 ... 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ... 52 Next
/ 52