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
461 키입력 전체키 입력 스크립트 v4 by Cybersam 5 file 백호 2009.02.22 1947
460 키입력 Glitchfinder's Input Modules (XP/VX 공용) 2 Alkaid 2011.03.19 1952
459 이동 및 탈것 Super Simple Vehicle System Enhanced 8.0 by DerVVulfman 1 Alkaid 2010.12.12 1956
458 기타 [All RGSS] 윈도우 커서 숨기기/보이기 1 file Cheapmunk 2014.03.02 1956
457 기타 [신기술 체험] 오투잼 스크립트 7 file 백호 2009.02.22 1959
456 전투 KGC_BattlerEffect(버틀러 효과) 2 file 백호 2009.02.22 1959
455 저장 세이브 & 로드 화면 개조 스크립트 file 백호 2009.02.21 1962
454 메뉴 개별 메뉴 호출 단축키 스크립트 5 file 백호 2009.02.21 1965
453 HUD 맵 이름 뛰우기 10 WMN 2008.03.17 1966
452 상태/속성 KGC_StateIcon(스테이터스 아이콘 표시) 2 file 12345678 2010.02.03 1967
451 그래픽 MAWS: Modified Advanced Weather Script 1.2 by Agckuu Coceg 2 file Alkaid 2010.09.13 1969
450 기타 Project RGSS3 by joe5491 6 습작 2013.05.06 1970
449 저장 심플 세이브 로드(1개의 세이브 사용하기) 3 백호 2009.02.22 1971
448 메뉴 링 메뉴 Edited by Hypershadow180@rmxp.net 1 file 백호 2009.02.22 1975
447 스킬 스킬 레벨 스크립트 # 번역 진행중 6 빗자루씨 2010.02.11 1981
446 맵/타일 World Map 스크립트 1 file 백호 2009.02.21 1983
445 저장 Improved Save by gerrtunk 2 file Alkaid 2010.10.13 1983
444 저장 렉없는 자동세이브(중복임??) 4 캉쿤 2011.09.12 1986
443 장비 전투중에 장비변경 from RGSS Wiki 1 백호 2009.02.22 1988
442 기타 동료들이 기차처럼 줄줄 따라온다!? 7 file 백호 2009.02.21 1990
Board Pagination Prev 1 ... 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ... 52 Next
/ 52