VX 스크립트

게임 만들다보니 상점의 목록쪽이 정리가 안되서 불편하네요.

간단하게 구입만 못하게 에디트 해보겠습니다.

Scene_Shop에서 143번째 줄을 보면

      if @item == nil or @item.price > $game_party.gold or number == 99

이렇게 나와있습니다.

이 부분을

      if @item == nil or @item.price > $game_party.gold or number == 99 or @item.price == 0

이렇게 만들어줍니다.

그리고 데이터베이스-> 아이템 목록에서 정리용 아이템의 가격을 0원으로 만들어줍니다.


그러면 플레이할때 가격이 0원이라도 구입이 불가능합니다.



스크립트를 배워본적이 없어서 색을 변화한다던가 가격을 없애준다던가 하는건 좀더 파봐야겠네요. (뭐랄까, 임기응변식으로 에디트하는 형편이라..)

일단 가격을 없애는거부터 해서 좀더 찾아봐야겠습니다.

Comment '14'
  • ?
    정의로운녀석 2008.07.22 20:53
    지금 RMXP에 관련 스크립트를 질문중입니다. 답변 나오는대로 업데이트하겠습니다.
  • ?
    정의로운녀석 2008.07.24 13:56

    스크립트를 답변받았습니다.

          if @item == nil or @item.price > $game_party.gold or number == 99 or @item.price == 0

    이 부분을

          if @item == nil or @item.price > $game_party.gold or number == 99 or @item.price == 9999999

    이렇게 고쳐주세요. 안고쳐도 상관없습니다만, 소유금이 무한일경우 정리용 아이템을 살 수가 있습니다.
    정리용 아이템의 가격은 0원이 아니라 9999999원으로 맞춰주세요.

    #==============================================================================
    # ** Instructions
    #------------------------------------------------------------------------------
    #
    # Item_Price - Here you put the price you wish to have that removes the price tag
    #
    # Item_Color - Here you chose the color you wish to have for the "special" item
    #                   that has the same cost as in "Item_Price".
    #
    #==============================================================================

     Item_Price = 9999999
     Item_Color = Color.new(225, 192, 20, 0)
      #--------------------------------------------------------------------------
      # * Draw Item Name
      #     item    : Item (skill, weapon, armor are also possible)
      #     x       : draw spot x-coordinate
      #     y       : draw spot y-coordinate
      #     enabled : Enabled flag. When false, draw semi-transparently.
      #--------------------------------------------------------------------------
     class Window_Base < Window
      def draw_item_name_two(item, x, y, color, enabled = true)
        if item != nil
          draw_icon(item.icon_index, x, y, enabled)
          self.contents.font.color = color
          self.contents.font.color.alpha = 255
          self.contents.draw_text(x + 24, y, 172, WLH, item.name)
        end
      end
    end

    class Window_ShopBuy < Window_Selectable
      #--------------------------------------------------------------------------
      # * Draw Item
      #     index : item number
      #--------------------------------------------------------------------------
      def draw_item(index)
        item = @data[index]
        number = $game_party.item_number(item)
        enabled = (item.price <= $game_party.gold and number < 99)
        rect = item_rect(index)
        self.contents.clear_rect(rect)
        if item.price == Item_Price
          draw_item_name_two(item, rect.x, rect.y, Item_Color, enabled)
        else
          draw_item_name(item, rect.x, rect.y, enabled)
        end
        rect.width -= 4
        unless item.price == 9999999
        self.contents.draw_text(rect, item.price, 2)
      end
    end
    end


    <적용화면>

    *처음부터 제대로 질문했으면 좀더 편한 스크립트를 답변받았을텐데, 처음엔 색상을 생각하지 못해서 빙빙 돌아서 가게 되버렸네요;
    *후에 색상추가가 가능하게도 요청해보겠습니다.

    ※스크립트 제공해 주신분 : Gando(rmxp.org)님

  • ?
    zerobm 2008.08.05 21:27
  • ?
    만들어보자꾸나 2008.08.11 14:41
     유용하네요... 잘쓰겠습니다.
  • ?
    마끼아또 2008.08.17 21:37
    정말 유용해요!
  • ?
    홍군님 2008.08.19 18:39
    너무나 유용하군요~
  • ?
    중복 2008.08.21 01:08

    좋은데요??

  • ?
    시옷청룡 2008.10.01 18:43
    물파스/....ㅋ 님 참 정의로우심... 잘쓸께염ㅋㅋ
  • ?
    몽크님 2008.10.09 18:52
    좋네요
    그런데
    상점이벤트로 아이템올리면 순서가 가격순서대로 되요..
    이거 어캐해결.?
  • ?
    다크아머 2008.10.25 11:03
    좋은자료 감사하므니다.
  • ?
    R3 2010.01.07 15:43

    감사합니다.

    근데 저는 선택지로 이용하고 있습니다.

  • ?
    서울냥이 2010.01.08 15:55

    멋있는데.. 왠지 안써도될것같은.. <응?

  • ?
    twoeye 2011.12.14 20:15

    정말 감사합니다!!

  • ?
    크리티컬 2012.05.30 19:18

    감사합니다!!


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5408
577 메뉴 Etude87's Menu Editor for VX 25 습작 2015.01.14 1461
576 메뉴 Etude87_Ace_Style_Formation_Change ver.1.01 습작 2014.10.05 758
575 기타 Etude87_GAGA_Chat 4 습작 2012.06.14 1916
574 기타 Etude87_Hangul_utf8_List 습작 2012.06.04 1665
573 이름입력 Etude87_HG_Hangul_Name_Scene file 습작 2012.06.14 1948
572 메시지 Etude87_Item_Choice ver.1.00 file 습작 2013.02.16 1771
571 맵/타일 Etude87_Map_Remember_VX ver.1.2 3 습작 2012.03.06 2430
570 전투 Etude87_Tankentai_Addon ver.1.0 7 file 습작 2012.06.03 2882
569 변수/스위치 Etude87_Variables_VX 1 file 습작 2011.11.26 2608
568 장비 Expansion_Suite V2.1! 6 Man... 2008.10.25 1593
567 맵/타일 Final Fantasy IV 모든 완성된맵 47 RPGbooster 2008.10.11 5086
566 메뉴 Final Fantasy VII Menu System 8 비극ㆍ 2010.04.19 3506
565 fog[안개] 효과 43 file RPGbooster 2008.10.08 4196
564 전투 Fomars indiviivdual battle 2 Man... 2008.10.28 1340
563 상태/속성 Full Status CMS 1.0d by Modern Algebra 1 file Alkaid 2010.09.03 2408
562 기타 Fullscreen++ by Zeus81 (VX/VXA) 2 Alkaid 2012.09.01 2230
561 기타 Gamepad Extender VX 습작 2015.01.02 672
560 Good VS EVil? 4 Man... 2008.10.28 1641
559 버그픽스 Graphical Object Global Reference VX by Mithran Alkaid 2014.03.03 1027
558 타이틀/게임오버 Graphics Load System 1.0.1 14 file NightWind AYARSB 2010.06.10 3230
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 32 Next
/ 32