irpg Community

Full Version: การถอดอุปกรณ์สวมใส่่ทีละชิ้นง่ายๆ เพียงปุ่มเดียว
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
การถอดอุปกรณ์สวมใส่่ทีละชิ้นง่ายๆ เพียงปุ่มเดียว

สคริปต์เขียนโดย : mwhidesp
ลิงค์ต้นฉบับ : http://mwhidesp.blog.shinobi.jp ตรง RGSS改造計画 ( 34 ) ไปหน้า5 ล่างสุด (競合するらしい!)

ข้อตกลงการนำไปใช้งาน :
ไม่จำเป็น

สกรีนช๊อต :
[Image: 130823123720.jpg]

รายละเอียด :
เป็นการถอดอุปกรณ์ทีละชิ้นในเมนูสวมใส่่ ในแต่ละช่องแบบง่ายๆ เพียงปุ่มเดียว(ปุ่มZ)  

โค๊ดสคริปต์
Code:
# The A when button is pushed
    if Input.trigger?(Input::A)
      if @actor.equip_fix?(@right_window.index)
        # Performing buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Performing equipment SE @right_window.item
      $game_system.se_play($data_system.equip_se)
      # Remove equipment
      @actor.equip(@right_window.index, 0)
      # Rewriting the contents of window and the item window
      @right_window.refresh
      @item_window.refresh
      @left_window.refresh
      return
    end

วิธีการใช้งาน :
ก็อปโค๊ดแล้ว ไปที่ [สคริปต์] Scene_Equip
ให้นำมาวางไว้ข้างล่าง def update_right
ตอนแรกนึกว่ากดแล้วถอดทุกชิ้นซะอีก แต่ทีละชิ้นก็ดีไปอีกแบบ