XP 스크립트

이벤트에서 스크립트로 Window_ItemAcquired.new(갯수, 타입, ID)로 화면 상단에 아이템 입수창을 띄우는 스크립트입니다.

#==============================================================================
# ** Window_ItemAcquired
#------------------------------------------------------------------------------
# This window displays a message when the player acquires an item.
# Script version 1.1 written by SiliconHero (09/22/2005)
#
# To use this in an event, use the Script command and type the following:
# Window_ItemAcquired.new(quantity, type, index)
# quantity = the number of items that have been found
# type = the type of item that is found (1 = item, 2 = weapon, 3 = armor)
# index = the item index (see the database)
#
# 1.1 (9/22/2005) - Window fades out when the "C" button is pressed.
# 1.0 (9/18/2005) - First version of the script.
#
# Special thanks to MagicMagor and Huitzilopoctli from RMXP.net for
# ideas and help.
#==============================================================================

class Window_ItemAcquired < Window_Base
def initialize(quantity, type, index)
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@quantity = quantity
@type = type
@index = index
self.pause = false
self.back_opacity = 127

self.contents.font.color = normal_color
# Process the item type
# type: 1 = item, 2 = weapon, 3 = armor
case @type
when 1
item = $data_items[@index]
when 2
item = $data_weapons[@index]
when 3
item = $data_armors[@index]
end
# Piece together the item acquisition string
# If more than one item is found, add the quantity to the message string
if @quantity > 1 then
text = "Acquired " + item.name + " ×" + @quantity.to_s + "!"
else
text = "Acquired " + item.name + "!"
end
# Play Item Acquired SE
Audio.se_play("Audio/SE/056-Right02.ogg", 100, 100)
self.pause = true
# draw the window
while not Input.trigger?(Input::C)
Input.update
Graphics.update
self.contents.clear
self.contents.draw_text(4, 0, self.width - 40, 32, text, 1)
end
# Fade out the window
while self.opacity > 0
self.opacity -= 24
Graphics.update
end
self.dispose
end
end

**주의: C버튼으로 창을 사라지게 만들기 때문에 이벤트에 아이템 입수 후 스위치가 설정되지 않았다면 C버튼(또는 거기에 해당하는 키)을 누를때마다 창이 뜹니다.(즉, 무한......) 

**이 스크립트는 아이템 입수창만 띄우므로 이벤트에서 별도로 아이템 입수를 지정해야 합니다.  만일 스크립트로 아이템창을 띄우면서 바로 아이템을 추가하고 싶다면

case @type
when 1
item = $data_items[@index]
when 2
item = $data_weapons[@index]
when 3
item = $data_armors[@index]
end

이 부분을

case @type
    when 1
      item = $data_items[@index]
      $game_party.gain_item(@index,@quantity) #
    when 2
      item = $data_weapons[@index]
      $game_party.gain_weapon(@index,@quantity) #
    when 3
      item = $data_armors[@index]
      $game_party.gain_armor(@index,@quantity) #
    end   

이렇게 수정하면 됩니다.

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
901 기타 sandgolem Script Archive (RMXP SDK 1.5 이상 필요) file Alkaid 2011.02.17 1453
900 HUD 맵 이름을 표시해주는 스크립트입니다. 25 임희성 2011.02.12 2937
899 액터 시트르산의 XP용 감정 말풍선 표시 스크립트 37 file 시트르산 2011.01.25 6110
898 전투 MrMo DVV Add-On #13: Tinuke's Smart Missiles 2 Alkaid 2011.01.24 1843
897 HUD 시트르산의 나침반 스크립트 19 file 시트르산 2011.01.23 3195
896 그래픽 Transition Pack 1.11 by Fantasist Alkaid 2011.01.22 2043
895 그래픽 Weather Creator 1.0 by ForeverZer0 2 file Alkaid 2011.01.22 1920
894 시스템2C 4 file 글러브111 2011.01.15 2118
893 장비 Angie's Equipment Sets 2.3 by DerVVulfman 7 Alkaid 2010.12.31 1869
892 전투 XAS Hero Edition v3.82 19 아방스 2010.12.27 4346
891 맵/타일 H-Mode7 Engine 1.0 by MGCaladtogel 8 Alkaid 2010.12.23 2161
890 이동 및 탈것 Trickster's Caterpillar System 0.99 3 Alkaid 2010.12.23 1590
889 이동 및 탈것 Super Simple Vehicle System Enhanced 8.0 by DerVVulfman 1 Alkaid 2010.12.12 1956
888 기타 [게이지바]게이지바 스크립트 2.5 (실용적?) 17 file 코아 코스튬 2010.12.05 4219
887 HUD 주인공,NPC이름 머리 나타내기 49 file 송긔 2010.11.28 6060
886 미니맵 미니맵 만들기~! 14 file 블리치캐릭셋원함 2010.11.24 4350
885 기타 Upload & Download files with RGSS 2.1 by berka (XP/VX 공용) 5 Alkaid 2010.11.20 2134
884 오디오 FMOD Ex Audio Module Rewrite 1.51 by Cowlol 2 file Alkaid 2010.11.18 1793
883 기타 Advanced Gold Display by Dubealex (돈 액수를 세자리씩 끊어 표기) 2 Alkaid 2010.11.18 1559
882 장비 Equipment Upgrade System 1.1 by Charlie Fleed Alkaid 2010.11.18 1928
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