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 5407
637 기타 Gamepad Extender VX 습작 2015.01.02 672
636 버그픽스 DerVVulfman's Tileset Reader VX Bug Fix 습작 2014.11.16 701
635 아이템 현재있는 파티원 선택 레벨업 아이템 만들기 1 file 싸패 2016.06.06 713
634 메뉴 Etude87_Ace_Style_Formation_Change ver.1.01 습작 2014.10.05 758
633 저장 세이브 파일 개수 16개로 늘리기 (기본 세이브 엔진용) 1 file Bunny_Boy 2015.09.07 817
632 ??? 1 Man... 2008.10.27 1020
631 버그픽스 Graphical Object Global Reference VX by Mithran Alkaid 2014.03.03 1027
630 키입력 No F1, F12 and Alt+Return (Kein F1, F12 und Alt+Eingabe) by cremno 습작 2013.04.19 1046
629 메시지 Etude87 Dialogue History Scene file 습작 2014.07.07 1069
628 ??(다 영어)여기서 부터 드레그만 빼고 Man... 2008.10.27 1078
627 메뉴 KGC - 커스텀 메뉴 커멘드 (번역) 1 듀란테 2015.07.27 1079
626 Scene_Credit script Plug & Play 1 Man... 2008.10.27 1085
625 Multi-threader snippet by Omegazion Man... 2008.10.28 1107
624 메뉴 MOG - Scroll Bar for VX file 습작 2014.07.06 1115
623 Screen Shortcut Script Man... 2008.10.27 1142
622 LevelMe v1.2 3 Man... 2008.10.27 1154
621 Screen Resolution 3 Man... 2008.10.28 1171
620 키입력 Key Simulator by Fantasist 습작 2013.05.01 1176
619 MAX Level Limitation System 3 Man... 2008.10.28 1198
618 Simple Fon Chage 3 Man... 2008.10.28 1212
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