Ace 스크립트

  1. #Sleek Item Popup v1.10
  2. #----------#
  3. #Features: A nice and sleek little pop up you can use to tell the player
  4. #           they received (or lost) an item! Now with automatic popups whenever
  5. #           you use the gain item commands in events!
  6. #
  7. #Usage:   Event Script Call:
  8. #           popup(type,item,amount,[duration],[xoff],[yoff])
  9. #
  10. #          Where: type is category of item (0 = item, 1 = weapon,
  11. #                                            2 = armor, 3 = gold)
  12. #                 item is the id number of the item
  13. #                 amount is the amount lost or gained
  14. #                 duration is the time the window is up and is optional
  15. #          
  16. #          Examples:
  17. #            popup(0,1,5)
  18. #            popup(2,12,1,120)
  19. #            $PU_AUTOMATIC_POPUP = false
  20. #            $PU_AUTOMATIC_POPUP = true
  21. #        
  22. #Customization: Everything down there under customization
  23. #
  24. #----------#
  25. #-- Script by: V.M of D.T
  26. #
  27. #- Questions or comments can be:
  28. #    posted on the thread for the script
  29. #    given by email: sumptuaryspade@live.ca
  30. #    provided on facebook: http://www.facebook.com/DaimoniousTailsGames
  31. #    posed on site: daimonioustails.wordpress.com
  32. #
  33. #--- Free to use in any project, commercial or non-commercial, with credit given
  34. # - - Though a donation's always a nice way to say thank you~ (I also accept actual thank you's)
  35.  
  36. #Sound effect played on popup: # "Filename", Volume(0-100), Pitch(50-150)
  37. PU_SOUND_EFFECT = ["Item3",100,50]
  38.  
  39. #Animation to be played on the player during popup
  40. PU_USE_ANIMATION = false
  41. PU_POPUP_ANIMATION = 2
  42.  
  43. #Duration in frames of Item Popup fadein and fadeout
  44. PU_FADEIN_TIME = 30
  45. PU_FADEOUT_TIME = 30
  46.  
  47. #Default duration of the popup
  48. PU_DEFAULT_DURATION = 90
  49.  
  50. #Use automatic popup? Can be enabled/disabled in game, see examples
  51. $PU_AUTOMATIC_POPUP = true
  52.  
  53. #Whether to use a custom or default font
  54. PU_USE_CUSTOM_FONT = false
  55.  
  56. #Settings for custom item popup font
  57. PU_DEFAULT_FONT_NAME = ["Verdana"]
  58. PU_DEFAULT_FONT_SIZE = 16
  59. PU_DEFAULT_FONT_COLOR = Color.new(255,255,255,255)
  60. PU_DEFAULT_FONT_BOLD = false
  61. PU_DEFAULT_FONT_ITALIC = false
  62. PU_DEFAULT_FONT_SHADOW = false
  63. PU_DEFAULT_FONT_OUTLINE = true
  64.  
  65. #Compact mode will hide the amount unless it's greater then 1
  66. PU_COMPACT_MODE = true
  67.  
  68. #Background Icon to be displayed under item icon
  69. PU_USE_BACKGROUND_ICON = true
  70. PU_BACKGROUND_ICON = 102
  71.  
  72. #Gold details:
  73. PU_GOLD_NAME = "Gold"
  74. PU_GOLD_ICON = 262
  75.  
  76. #True for single line, false for multi line
  77. PU_SINGLE_LINE = true
  78.  
  79. class Item_Popup < Window_Base
  80.   def initialize(item, amount, duration, nosound,xoff,yoff)
  81.     super(0,0,100,96)
  82.     Audio.se_play('Audio/SE/' + PU_SOUND_EFFECT[0],PU_SOUND_EFFECT[1],PU_SOUND_EFFECT[2]) unless PU_SOUND_EFFECT.nil? or nosound
  83.     self.opacity = 0
  84.     self.x = $game_player.screen_x - 16
  85.     self.y = $game_player.screen_y - 80
  86.     @xoff = 0
  87.     @yoff = 0
  88.     @duration = 90
  89.     @item = item
  90.     @amount = amount
  91.     @name = item.name.clone
  92.     @text = ""
  93.     @timer = 0
  94.     @split = (PU_FADEIN_TIME) / @name.size
  95.     @split = 2 if @split < 2
  96.     amount > 0 ? @red = false : @red = true
  97.     if PU_USE_CUSTOM_FONT
  98.       contents.font.size = PU_DEFAULT_FONT_SIZE
  99.     else
  100.       contents.font.size = 16
  101.     end
  102.     @textsize = text_size(@name)
  103.     textsize2 = text_size("+" + amount.to_s)
  104.     self.width = @textsize.width + 54
  105.     self.width += textsize2.width + 48 if PU_SINGLE_LINE
  106.     self.height = @textsize.height + 54
  107.     self.height -= 24 if PU_SINGLE_LINE
  108.     self.x -= self.width / 4
  109.     create_contents
  110.     if PU_USE_CUSTOM_FONT
  111.       contents.font.name = PU_DEFAULT_FONT_NAME
  112.       contents.font.size = PU_DEFAULT_FONT_SIZE
  113.       contents.font.color = PU_DEFAULT_FONT_COLOR
  114.       contents.font.bold = PU_DEFAULT_FONT_BOLD
  115.       contents.font.italic = PU_DEFAULT_FONT_ITALIC
  116.       contents.font.shadow = PU_DEFAULT_FONT_SHADOW
  117.       contents.font.outline = PU_DEFAULT_FONT_OUTLINE
  118.     end
  119.     self.contents_opacity = 0
  120.     $game_player.animation_id = PU_POPUP_ANIMATION if PU_USE_ANIMATION
  121.     update
  122.   end
  123.   def update
  124.     #super
  125.     return if self.disposed?
  126.     self.visible = true if !self.visible
  127.     self.x = $game_player.screen_x - 16 + @xoff
  128.     self.y = $game_player.screen_y - 80 + @yoff
  129.     self.x -= self.width / 4
  130.     open if @timer < (PU_FADEIN_TIME)
  131.     close if @timer > (PU_FADEOUT_TIME + @duration)
  132.     @timer += 1
  133.     @text += @name.slice!(0,1) if @timer % @split == 0
  134.     contents.clear
  135.     @red ? color = Color.new(255,0,0) : color = Color.new(0,255,0)
  136.     contents.font.color = color
  137.     stringamount = @amount
  138.     stringamount = "+" + @amount.to_s if @amount > 0
  139.     if PU_SINGLE_LINE
  140.       width = text_size(@item.name).width#@textsize.width
  141.       draw_text(27 + width,0,36,24,stringamount) unless PU_COMPACT_MODE and @amount == 1
  142.       contents.font.color = Font.default_color
  143.       draw_text(24,0,contents.width,contents.height,@text)
  144.       draw_icon(PU_BACKGROUND_ICON,0,0) if PU_USE_BACKGROUND_ICON
  145.       draw_icon(@item.icon_index,0,0)
  146.     else
  147.       draw_text(contents.width / 4 + 16,24,36,24,stringamount) unless PU_COMPACT_MODE and @amount == 1
  148.       contents.font.color = Font.default_color
  149.       draw_icon(PU_BACKGROUND_ICON,contents.width / 4 - 12,24) if PU_USE_BACKGROUND_ICON
  150.       draw_icon(@item.icon_index,contents.width / 4 - 12,24)
  151.       draw_text(0,0,contents.width,contents.height,@text)
  152.     end
  153.   end
  154.   def close
  155.     self.contents_opacity -= (255 / (PU_FADEOUT_TIME))
  156.   end
  157.   def open
  158.     self.contents_opacity += (255 / (PU_FADEIN_TIME))
  159.   end
  160. end
  161.  
  162. class Game_Interpreter
  163.   alias pu_command_126 command_126
  164.   alias pu_command_127 command_127
  165.   alias pu_command_128 command_128
  166.   alias pu_command_125 command_125
  167.   def popup(type,item,amount,duration = PU_DEFAULT_DURATION,nosound = false, xo = 0, yo = 0)
  168.     data = $data_items[item] if type == 0
  169.     data = $data_weapons[item] if type == 1
  170.     data = $data_armors[item] if type == 2
  171.     if type == 3
  172.       data = RPG::Item.new
  173.       data.name = PU_GOLD_NAME
  174.       data.icon_index = PU_GOLD_ICON
  175.     end
  176.     Popup_Manager.add(data,amount,duration,nosound,xo,yo)
  177.   end
  178.   def command_126
  179.     pu_command_126
  180.     value = operate_value(@params[1], @params[2], @params[3])
  181.     popup(0,@params[0],value) if $PU_AUTOMATIC_POPUP
  182.   end
  183.   def command_127
  184.     pu_command_127
  185.     value = operate_value(@params[1], @params[2], @params[3])
  186.     popup(1,@params[0],value) if $PU_AUTOMATIC_POPUP
  187.   end
  188.   def command_128
  189.     pu_command_128
  190.     value = operate_value(@params[1], @params[2], @params[3])
  191.     popup(2,@params[0],value) if $PU_AUTOMATIC_POPUP
  192.   end
  193.   def command_125
  194.     pu_command_125
  195.     value = operate_value(@params[0], @params[1], @params[2])
  196.     popup(3,@params[0],value) if $PU_AUTOMATIC_POPUP
  197.   end
  198. end
  199.  
  200. module Popup_Manager
  201.   def self.init
  202.     @queue = []
  203.   end
  204.   def self.add(item,value,dura,ns,xo,yo)
  205.     @queue.insert(0,[item,value,dura,ns,xo,yo])
  206.   end
  207.   def self.queue
  208.     @queue
  209.   end
  210. end  
  211.  
  212. Popup_Manager.init
  213.  
  214. class Scene_Map
  215.   alias popup_update update
  216.   alias popup_preterminate pre_terminate
  217.   def update
  218.     popup_update
  219.     update_popup_window unless $popupwindow.nil?
  220.     return if Popup_Manager.queue.empty?
  221.     if $popupwindow.nil? or $popupwindow.contents_opacity == 0
  222.       var = Popup_Manager.queue.pop
  223.       $popupwindow = Item_Popup.new(var[0],var[1],var[2],var[3],var[4],var[5])
  224.     end
  225.   end
  226.   def update_popup_window
  227.     $popupwindow.update
  228.     if !$popupwindow.disposed? and $popupwindow.contents_opacity == 0
  229.       $popupwindow.dispose
  230.       $popupwindow = nil
  231.     end
  232.   end
  233.   def pre_terminate
  234.     popup_preterminate
  235.     $popupwindow.visible = false unless $popupwindow.nil?
  236.   end
  237. end

 

그러합니다.

제작중인 게임에도 적용해볼까 생각중. . . .

Who's 스리아씨

?
뺘라뺘뺘
  • profile
    Kazu 2013.10.26 16:31
    잘 쓰겠습니다~
  • ?
    Kazu님 축하합니다.^^ 2013.10.26 16:31
    포인트 팡팡!에 당첨되셨습니다.
    Kazu님은 50포인트를 보너스로 받으셨습니다.
  • ?
    Mr.Pig 2013.11.09 06:33
    써보니까 좋네요
    잘 쓰겠습니다
  • ?
    Otte 2013.11.12 17:18
    와우..
  • ?
    Soo'sE_Box 2014.01.06 13:08
    좋당 ㅎㅎ
  • ?
    Soo'sE_Box 2014.01.08 15:29

    궁금한게 있는데요, 몇 번 째줄까지가 아이템을 획득했을때 팝업이고, 아이템이 없어질때 팝업뜨는 스크랩이죠?? ㅠㅠ아이템을 획득했을때만 뜨게 하고 싶어서 ㅎㅎㅎ 부탁드립니다! 수동으로 팝업 하려니까 너무 복잡할꺼 같아서요 ㅠ

  • profile
    시캐 2014.02.03 00:27

    앞에 번호까지 복사되는 건 나만 그런건가...??

    122번 줄에서 unexpected keyword_end, expecting $end end라는 오류가 나는데 저만 그런가요?

  • ?
    스리아씨 2014.02.03 16:49
    어..
    저거 기존에 쓰던 세이브파일 쓰면 안되는거로 압니다.
    새로 시작해야해요.
  • profile
    시캐 2014.02.03 23:48
    타이틀화면이 나오기도 전에 오류가 납니다;; 그러니까 새로하기, 이어하기 이런 거 선택하기도 전에
    오류가 나와요
    그래서 새 프로젝트 만들고 해도 똑같이 오류납니다.ㅠ_ㅠ
  • ?
    AltusZeon 2014.02.12 17:54
    에러 문구를 보니 문법 오류입니다.
    세이브 파일과는 관계 없습니다.
  • profile
    슈팅스타* 2014.02.12 17:48
    저 번호 어떻게 없애는 방법 없나여.
    스크립트 에디터에 번호째로 들어가서 에러날거같음
  • ?
    AltusZeon 2014.02.12 17:56
    http://pastebin.com/Vfk6eG7F
  • profile
    슈팅스타* 2014.02.12 17:57
    올ㅋ
  • ?
    jindou 2014.06.27 17:47
    감사
  • ?
    skeskin 2014.10.21 19:54
    오오ㅗ

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 5110
공지 RPG VX ACE 유용한 링크 모음 16 아방스 2012.01.03 28930
197 전투 Ace 경험치 직접 설정 12 쿠쿠밥솥 2012.02.05 4004
196 장비 장비 장착을 통한 스킬 습득 및 삭제 4 아이미르 2012.02.05 3597
195 전투 능력 강화/약화의 누적식 개조(버그수정) 13 아이미르 2012.02.08 3876
194 타이틀/게임오버 타이틀 화면 없이 게임을 시작하게 만드는법. 6 마에르드 2012.02.11 4586
193 메뉴 Customizable Main Menu 1.0b by modern algebra 4 file Alkaid 2012.02.13 5452
192 스킬 스킬 숙련도 시스템 8 아이미르 2012.02.24 4918
191 전투 전투시 나오는 메세지 삭제 10 Nintendo 2012.03.03 4358
190 스킬 VXACE 패시브 스킬 스크립트 Ver. 0.82 21 file 아이미르 2012.03.07 6669
189 변수/스위치 Etude87_Variables_Ace 6 file 습작 2012.04.13 3368
188 메뉴 [VX Ace] 다이얼 링 메뉴 스크립트 8 file RaonHank 2012.04.16 6673
187 전투 SRPG 컨버터 for Ace (SRPGコンバータ for Ace) by AD.Bank 27 file 습작 2012.04.17 7274
186 기타 원하는 글씨체로 변경하기 12 조말생 2012.04.20 8847
185 이동 및 탈것 [스크립트] Setp Sound (발걸음 소리) 20 file 허걱 2012.05.19 4660
184 전투 [스크립트] Sideview Battle System ver. 1.00 (일본어) 7 file 허걱 2012.05.20 6912
183 메시지 [스크립트] Ace Message System - by. Yanfly 17 file 허걱 2012.05.21 7271
182 전투 vx ace 애니메이션 배틀 3 gor 2012.05.27 7664
181 HUD Variables-Display Script System 8 file 허걱 2012.05.27 5452
180 스킬 [VX/VX Ace] Skill_Update_System 10 file 허걱 2012.06.11 3995
179 상점 VXAce 상점 스크립트 V0.9 17 아이미르 2012.06.29 5380
178 이름입력 전체키 + 조합한글 + 이름입력처리 변경 47 file 허걱 2012.07.04 8200
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 Next
/ 11