RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
FFVIII Card Mod System

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 83
プログラマです
FFVIII Card Mod System
Version: 1.0
Author: SeMcDun
Date: 22.08.2011

Version History


  • <Version 1.0> 2011.08.22 - Original Release

Planned Future Versions

  • <Version 2.0> Make it more user friendly. More customisation

Description


This script requires my FFVIII Card Menu script. ( http://rmrk.net/index.php/topic,43614.0.html )
This script replicates FFVIII's Card Mod system. The player can choose to refine his cards into items. The card is destroyed in the process.

Features

  • Simple design.
  • Can choose to refine cards into items, weapons or armour.

Screenshots



Instructions

Check the top of the script.

Script


Code: [Select]
#=begin

#===============================================================================
# FFVIII Card Mod
# v1.0
# By SeMcDun
# Started: 17/08/2011
# Last Update: 22/08/2011
#===============================================================================
# Remake of Final Fantasy VIII's Card Mod ability.
# Credit would be nice if used.
#
# Ps. This cannot be used in commercial games.
#===============================================================================
# Author's Notes:
#-- This script was created to be used alongside my Final Fantasy
#   VIII Triple Triad Script.
#===============================================================================
# Version History;
#
# v1.0
#-- Card Mod System
#===============================================================================
# HOW TO USE:
#
# Card Mod Menu
#-- To call the Card Mod Menu use $scene = Scene_Card_Mod.new
#
# Changing Mods
#-- Locate the $Mod_Cards[x] = [a, b, c, d] arrays.
#   x = Card Index. The number of the card who's values you wish to change.
#   a = The quantity of cards needed to mod.
#   b = The index of the item you wish to receive when modding.
#       (^^ This can be found in the database ^^)
#   c = The number of items received after modding.
#   d = Item Type. Item, Weapon or Armour.
#
#===============================================================================
module Card_Mod_Details
  $Mod_Cards = [[]]
# $Mod_Cards[Index] = [Quantity Needed, Item Index to return, Quantity of Item returned, Type]
# Type : 0 = Item, 1 = Weapon, 2 = Armour
 
  # Level One
  $Mod_Cards[0] = [1, 23, 5, 0] # It takes 1 Geezard card to create 5 Screws (index 23)
  $Mod_Cards[1] = [1, 24, 1, 0]
  $Mod_Cards[2] = [1, 24, 1, 0]
  $Mod_Cards[3] = [1, 25, 1, 0]
  $Mod_Cards[4] = [4, 32, 1, 2]
  $Mod_Cards[5] = [1, 26, 1, 0]
  $Mod_Cards[6] = [1, 27, 1, 0]
  $Mod_Cards[7] = [5, 28, 1, 0]
  $Mod_Cards[8] = [1, 29, 1, 0]
  $Mod_Cards[9] = [1, 30, 1, 0]
  $Mod_Cards[10] = [1, 31, 1, 0]
 
  # Level Two
  $Mod_Cards[11] = [1, 33, 5, 0]
  $Mod_Cards[12] = [1, 33, 1, 0]
  $Mod_Cards[13] = [1, 34, 1, 0]
  $Mod_Cards[14] = [1, 35, 1, 0]
  $Mod_Cards[15] = [4, 36, 1, 0]
  $Mod_Cards[16] = [1, 37, 1, 0]
  $Mod_Cards[17] = [1, 38, 1, 0]
  $Mod_Cards[18] = [5, 39, 1, 0]
  $Mod_Cards[19] = [1, 40, 1, 0]
  $Mod_Cards[20] = [1, 33, 1, 0]
  $Mod_Cards[21] = [1, 41, 1, 0]
 
  # Level Three
  $Mod_Cards[22] = [1, 43, 1, 0]
  $Mod_Cards[23] = [1, 44, 1, 0]
  $Mod_Cards[24] = [1, 45, 1, 0]
  $Mod_Cards[25] = [1, 28, 1, 0]
  $Mod_Cards[26] = [1, 46, 1, 0]
  $Mod_Cards[27] = [1, 47, 1, 0]
  $Mod_Cards[28] = [1, 48, 1, 0]
  $Mod_Cards[29] = [1, 41, 1, 0]
  $Mod_Cards[30] = [1, 49, 1, 0]
  $Mod_Cards[31] = [1, 50, 1, 0]
  $Mod_Cards[32] = [1, 51, 1, 0]
 
  # Level Four
  $Mod_Cards[33] = [1, 31, 1, 0]
  $Mod_Cards[34] = [1, 31, 1, 0]
  $Mod_Cards[35] = [1, 31, 1, 0]
  $Mod_Cards[36] = [1, 31, 1, 0]
  $Mod_Cards[37] = [1, 31, 1, 0]
  $Mod_Cards[38] = [1, 31, 1, 0]
  $Mod_Cards[39] = [1, 31, 1, 0]
  $Mod_Cards[40] = [1, 31, 1, 0]
  $Mod_Cards[41] = [1, 31, 1, 0]
  $Mod_Cards[42] = [1, 31, 1, 0]
  $Mod_Cards[43] = [1, 31, 1, 0]
 
  # Level Five
  $Mod_Cards[44] = [1, 31, 1, 0]
  $Mod_Cards[45] = [1, 31, 1, 0]
  $Mod_Cards[46] = [1, 31, 1, 0]
  $Mod_Cards[47] = [1, 31, 1, 0]
  $Mod_Cards[48] = [1, 31, 1, 0]
  $Mod_Cards[49] = [1, 31, 1, 0]
  $Mod_Cards[50] = [1, 31, 1, 0]
  $Mod_Cards[51] = [1, 31, 1, 0]
  $Mod_Cards[52] = [1, 31, 1, 0]
  $Mod_Cards[53] = [1, 31, 1, 0]
  $Mod_Cards[54] = [1, 31, 1, 0]
 
  # Level Six
  $Mod_Cards[55] = [1, 31, 1, 0]
  $Mod_Cards[56] = [1, 31, 1, 0]
  $Mod_Cards[57] = [1, 31, 1, 0]
  $Mod_Cards[58] = [1, 31, 1, 0]
  $Mod_Cards[59] = [1, 31, 1, 0]
  $Mod_Cards[60] = [1, 31, 1, 0]
  $Mod_Cards[61] = [1, 31, 1, 0]
  $Mod_Cards[62] = [1, 31, 1, 0]
  $Mod_Cards[63] = [1, 31, 1, 0]
  $Mod_Cards[64] = [1, 31, 1, 0]
  $Mod_Cards[65] = [1, 31, 1, 0]
 
  # Level Seven
  $Mod_Cards[66] = [1, 31, 1, 0]
  $Mod_Cards[67] = [1, 31, 1, 0]
  $Mod_Cards[68] = [1, 31, 1, 0]
  $Mod_Cards[69] = [1, 31, 1, 0]
  $Mod_Cards[70] = [1, 31, 1, 0]
  $Mod_Cards[71] = [1, 31, 1, 0]
  $Mod_Cards[72] = [1, 31, 1, 0]
  $Mod_Cards[73] = [1, 31, 1, 0]
  $Mod_Cards[74] = [1, 31, 1, 0]
  $Mod_Cards[75] = [1, 31, 1, 0]
  $Mod_Cards[76] = [1, 31, 1, 0]
 
  # Level Eight
  $Mod_Cards[77] = [1, 31, 1, 0]
  $Mod_Cards[78] = [1, 31, 1, 0]
  $Mod_Cards[79] = [1, 31, 1, 0]
  $Mod_Cards[80] = [1, 31, 1, 0]
  $Mod_Cards[81] = [1, 31, 1, 0]
  $Mod_Cards[82] = [1, 31, 1, 0]
  $Mod_Cards[83] = [1, 31, 1, 0]
  $Mod_Cards[84] = [1, 31, 1, 0]
  $Mod_Cards[85] = [1, 31, 1, 0]
  $Mod_Cards[86] = [1, 31, 1, 0]
  $Mod_Cards[87] = [1, 31, 1, 0]
 
  # Level Nine
  $Mod_Cards[88] = [1, 31, 1, 0]
  $Mod_Cards[89] = [1, 31, 1, 0]
  $Mod_Cards[90] = [1, 31, 1, 0]
  $Mod_Cards[91] = [1, 31, 1, 0]
  $Mod_Cards[92] = [1, 31, 1, 0]
  $Mod_Cards[93] = [1, 31, 1, 0]
  $Mod_Cards[94] = [1, 31, 1, 0]
  $Mod_Cards[95] = [1, 31, 1, 0]
  $Mod_Cards[96] = [1, 31, 1, 0]
  $Mod_Cards[97] = [1, 31, 1, 0]
  $Mod_Cards[98] = [1, 31, 1, 0]
 
  # Level Ten
  $Mod_Cards[99] = [1, 31, 1, 0]
  $Mod_Cards[100] = [1, 31, 1, 0]
  $Mod_Cards[101] = [1, 31, 1, 0]
  $Mod_Cards[102] = [1, 31, 1, 0]
  $Mod_Cards[103] = [1, 31, 1, 0]
  $Mod_Cards[104] = [1, 31, 1, 0]
  $Mod_Cards[105] = [1, 31, 1, 0]
  $Mod_Cards[106] = [1, 31, 1, 0]
  $Mod_Cards[107] = [1, 31, 1, 0]
  $Mod_Cards[108] = [1, 31, 1, 0]
  $Mod_Cards[109] = [1, 31, 1, 0]
 
end #module Card_Mod_Details

class Scene_Card_Mod < Scene_Base
  def start
    # card quantity used in refining
    $card_use_quantity = [$card_use_quantity, 99].max
    $card_use_quantity = 1
    # Refine number is the number of refines you are doing
    $refine_number = 1
    $game_party.list_index = 0
    $game_party.level_index = 0
    $game_party.virtual_index = 0

    create_windows
    update
    $game_party.allow_input = true
    @Mod_Confirm.refresh
   
  end

  def create_windows
    @Mod_Name = Window_Card_Mod_Name.new
    @Mod_Title = Window_Card_Mod_Title.new
    @Mod_List = Window_Card_Mod_List.new
    @Mod_Help = Window_Card_Mod_Help.new
    @Mod_Confirm = Window_Confirm_Mod.new
    @Mod_List.active = true
    @Mod_Confirm.active = false
    @Mod_List.index = 0
  end
 
  def update
    @Mod_Var = $Mod_Cards[$game_party.virtual_index]
    @Mod_Help.refresh
    @Mod_Name.refresh
    @Mod_Title.refresh
    @Mod_List.refresh
    @Mod_Help.refresh
    if @Mod_List.active == true
      $card_use_quantity = @Mod_Var[0]
    end
    update_input
    @Mod_Confirm.refresh
  end
 
  def update_input
   
    if $game_party.allow_input == true
      if Input.trigger?(Input::C)
        if @Mod_List.active == true
          if $game_party.card_list[$game_party.virtual_index] == 0
            # no card, play buzzer
            Sound.play_buzzer
            return
          else
            if $game_party.card_list[$game_party.virtual_index] < $card_use_quantity
              # no card, play buzzer
              Sound.play_buzzer
              return
            else
              # Activate the Confirm window
              Sound.play_decision
              @Mod_List.active = false
              @Mod_Confirm.active = true
              @Mod_Confirm.index = 8
              return
            end
          end
        end
        if @Mod_Confirm.active == true
          number = $game_party.item_number($mod_item)
          if @Mod_Var[2]*$refine_number+number > 99
            #too many
            Sound.play_buzzer
          else
            Sound.play_decision
            $game_party.gain_item($mod_item, @Mod_Var[2]*$refine_number)
            $game_party.card_list[$game_party.virtual_index] -= $card_use_quantity*$refine_number
            @Mod_List.active = true
            @Mod_Confirm.active = false
            $refine_number = 1
            @Mod_Confirm.cursor_rect.empty
          end
          @Mod_Confirm.refresh
          return
        end
      end # If C is triggered
     
      if Input.trigger?(Input::B)
        Sound.play_cancel
        if @Mod_Confirm.active == true
          @Mod_Confirm.active = false
          @Mod_List.active = true
          $refine_number = 1
          @Mod_Confirm.cursor_rect.empty
          return
        end
        if @Mod_List.active == true
          Sound.play_cancel
          return_scene
          return
        end
        if @Mod_Item_Gained.active == true
          return_item_gained
        end
      end
     
      if Input.repeat?(Input::UP)
        if @Mod_List.active != false
          Sound.play_cursor
          if $game_party.list_index != 0
            # IF the index is NOT hitting 0 (the top)
            $game_party.list_index -= 1
            @Mod_List.index = $game_party.list_index
          else
            # The index is 0
            $game_party.list_index = 10
            @Mod_List.index = $game_party.list_index
          end #if $game_party.list_index != 0
        end # Mod card list.active == true
       
        if @Mod_Confirm.active == true
          Sound.play_cursor
          return
        end #Mod_Confirm.active == true
        $game_party.virtual_index = ((11*$game_party.level_index) + $game_party.list_index)
        @Mod_Title.refresh
        @Mod_List.refresh
        @Mod_Confirm.refresh
       
      end
      if Input.repeat?(Input::DOWN)
        if @Mod_List.active != false
          Sound.play_cursor
          if $game_party.list_index != 10
            # If the index is NOT hitting the bottom of the list
            $game_party.list_index += 1
            @Mod_List.index = $game_party.list_index
          else
            # The index IS hitting the bottom of the list
            $game_party.list_index = 0
            @Mod_List.index = $game_party.list_index
          end
        end
        if @Mod_Confirm.active == true
          Sound.play_cursor
          return
        end #Mod_Confirm.active == true
        $game_party.virtual_index = ((11*$game_party.level_index) + $game_party.list_index)
        @Mod_Title.refresh
        @Mod_List.refresh
        @Mod_Confirm.refresh
      end
     
      if Input.repeat?(Input::RIGHT)
        if @Mod_List.active != false
          Sound.play_cursor
          @Mod_List.contents.clear
          if $game_party.level_index != 9
            $game_party.level_index += 1
          else
            $game_party.level_index = 0
          end
        end
       
        if @Mod_Confirm.active == true
          if (($refine_number+1)*@Mod_Var[0]) > $game_party.card_list[$game_party.virtual_index]
            Sound.play_cursor
          else
            $refine_number += 1
            Sound.play_cursor
          end
          @Mod_Confirm.refresh
          return
        end #Mod_Confirm.active == true
        $game_party.virtual_index = ((11*$game_party.level_index) + $game_party.list_index)
        @Mod_Title.refresh
        @Mod_List.refresh
        @Mod_Confirm.refresh
      end
     
      if Input.repeat?(Input::LEFT)
        if @Mod_List.active != false
          Sound.play_cursor
          @Mod_List.contents.clear
          if $game_party.level_index != 0
            $game_party.level_index -= 1
          else
            $game_party.level_index = 9
          end
        end
       
        if @Mod_Confirm.active == true
          if ($refine_number-1) < 1
            Sound.play_cursor
          else
            $refine_number -= 1
            Sound.play_cursor
          end
          @Mod_Confirm.refresh
          return
        end #Mod_Confirm.active == true
        $game_party.virtual_index = ((11*$game_party.level_index) + $game_party.list_index)
        @Mod_Title.refresh
        @Mod_List.refresh
        @Mod_Confirm.refresh
      end
    end #allow_input
  end # def input_update
 
  def return_scene
    $scene = Scene_Menu.new(5)
  end

  def return_item_gained
    Sound.play_cancel
    if @Mod_Var[0] > $game_party.card_list[$game_party.virtual_index]
      @Mod_Confirm.active = false
      @Mod_List.active = true
    else
      @Mod_Confirm.active = true
    end
    $refine_number = 1
    @Mod_Item_Gained.dispose
  end
 
  def terminate
    $game_party.allow_input = false
    $game_party.list_index = 0
    $game_party.level_index = 0
    $game_party.virtual_index = 0
    @Mod_Name.dispose
    @Mod_Title.dispose
    @Mod_List.dispose
    @Mod_Help.dispose
    @Mod_Confirm.dispose
  end
end #Scene_Card_Mod
#===============================================================================
class Window_Card_Mod_Name < Window_Base
  def initialize
    super(544-160,0,160,WLH+32)
    create_contents
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.draw_text(0,0,width-32,WLH,"Ability",1)
  end
end #Window_Card_Mod_Name
#===============================================================================
class Window_Card_Mod_Title < Window_Base
  def initialize
    super(0,0,544-160,WLH+32)
    create_contents
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.draw_text(0,0,width-32,WLH,"Card Mod",1)
  end
end #Window_Viewer_Title
#===============================================================================
class Window_Card_Mod_List < Window_Selectable
  def initialize
    super(0, (WLH+32)*2, 544/2, 416-((WLH+32)*2))
    @column_max = 1
    create_contents
    refresh
  end
 
  def refresh
    @item_max = 10
    self.contents.clear
    @name_level_start = 0
    @name_level_popper = 0
    # Find the level being displayed and make a variable which is that level
    case $game_party.level_index
      when 0
        @name_level_start = 0
        @name_level_popper = 10
      when 1
        @name_level_start = 11
        @name_level_popper = 21
      when 2
        @name_level_start = 22
        @name_level_popper = 32
      when 3
        @name_level_start = 33
        @name_level_popper = 43
      when 4
        @name_level_start = 44
        @name_level_popper = 54
      when 5
        @name_level_start = 55
        @name_level_popper = 65
      when 6
        @name_level_start = 66
        @name_level_popper = 76
      when 7
        @name_level_start = 77
        @name_level_popper = 87
      when 8
        @name_level_start = 88
        @name_level_popper = 98
      when 9
        @name_level_start =99
        @name_level_popper = 109
    end
        itwo = 0
    #Begin popping out card names
    #This loop is for the correct index

    for i in @name_level_start..@name_level_popper
      # This loop is for the name spacing
      @card_index = $game_party.card_list[i]
      @card_number = $Cards[i]
      # Now grab the array using that index
      @card_details = @card_number[1]
      if @card_index == 0
        #No card, display no name.
        self.contents.draw_text(8,(WLH*(i%11)),(544/2)-32,WLH, "",0)
      else
        @card_number = $Cards[i]
        # Now grab the array using that index
        @card_details = @card_number[1]
        rect = item_rect($game_party.list_index)
        self.contents.draw_text(rect,"")
        self.contents.draw_text(3,(WLH*(i%11)),(544/2)-32,WLH, "#{@card_details}",0)
        self.contents.draw_text(0,(WLH*(i%11)),(544/2)-32,WLH, "#{@card_index}",2)
      end #if there are no cards...
    end #loop for name spacing
  end # Window_Card_Mod_list
 

end #Window_Card_Mod_List
#===============================================================================
class Window_Card_Mod_Help < Window_Base
  def initialize
    super(0, WLH+32, 544, WLH+32)
    create_contents
    refresh
  end
 
  def refresh
    self.contents.clear
      @Mod_Variables = $Mod_Cards[$game_party.virtual_index]
      case @Mod_Variables[3]
      when 0
        $mod_item = $data_items[@Mod_Variables[1]]
      when 1
        $mod_item = $data_weapons[@Mod_Variables[1]]
      when 2
        $mod_item = $data_armors[@Mod_Variables[1]]
      end
    if $game_party.card_list[$game_party.virtual_index] != 0
      self.contents.clear
      if $game_party.card_list[$game_party.virtual_index] != 0
        if @Mod_Variables[2] == 1
            self.contents.draw_text(0,0,544,WLH,"#{@Mod_Variables[0]} will refine into #{@Mod_Variables[2]} #{$mod_item.name}")
        else
          self.contents.draw_text(0,0,544,WLH,"#{@Mod_Variables[0]} will refine into #{@Mod_Variables[2]} #{$mod_item.name}s")
        end
      end
    else
      self.contents.clear
    end
  end
end #Window_Card_Mod_Help
#===============================================================================
class Window_Confirm_Mod < Window_Selectable
  def initialize
    super(544/2, (WLH+32)*2, 544/2, (416-((WLH+32)*2)))
    create_contents
    refresh
   
  end
 
  def refresh
    self.contents.clear
    @Card_Variables = $Cards[$game_party.virtual_index]
    @Mod_Variables = $Mod_Cards[$game_party.virtual_index]
    number = $game_party.item_number($mod_item)
    if $game_party.card_list[$game_party.virtual_index] != 0
      if @Mod_Variables[0] > $game_party.card_list[$game_party.virtual_index]

      else
        self.contents.draw_text(0,WLH*1,(544/2)-32,WLH,"#{@Card_Variables[1]}",1)
            if @Mod_Variables[2] == 1
          self.contents.draw_text(0,WLH*3,(544/2)-32,WLH,"#{@Mod_Variables[0]} will refine into",1)
          self.contents.draw_text(0,WLH*4,(544/2)-32,WLH,"#{@Mod_Variables[2]} #{$mod_item.name}",1)
        else
          self.contents.draw_text(0,WLH*3,(544/2)-32,WLH,"#{@Mod_Variables[0]} will refine into",1)
          self.contents.draw_text(0,WLH*4,(544/2)-32,WLH,"#{@Mod_Variables[2]} #{$mod_item.name}s",1)
        end

        # Draw the cards to refine thing
        self.contents.draw_text(0,WLH*7,(544/2)-32,WLH,"#{@Card_Variables[1]}",0)
        self.contents.draw_text(0,WLH*7,(544/2)-32,WLH,"#{$game_party.card_list[$game_party.virtual_index]}",2)
        # Draw the number of items to receive
        self.contents.draw_text(0,WLH*8,(544/2)-32,WLH,"Number to refine",0)
        if self.active == true
          self.contents.draw_text(0,WLH*8,(544/2)-32,WLH,"#{$refine_number}",2)
        else
          self.contents.draw_text(0,WLH*8,(544/2)-32,WLH,"0",2)
        end #if self.active == true
        # Draw the current number of the item
        self.contents.draw_text(0,WLH*9,(544/2)-32,WLH,"#{$mod_item.name}",0)
        if self.active == true
          self.contents.draw_text(0,WLH*9,(544/2)-32,WLH,"#{number + ($refine_number*@Mod_Variables[2])}",2)
        else
          self.contents.draw_text(0,WLH*9,(544/2)-32,WLH,"#{number}",2)
        end # if self.active == true

      end # if @Mod_Variables[0] > $game_party.card_list[$game_party.virtual_index]
    else

    end #if $game_party.card_list[$game_party.virtual_index] != 0
  end # refresh
 
end #Window_Confirm_Mod
#===============================================================================

#=end

Credit


  • SeMcDun

Thanks

  • FFVIII for having the neato system in the first place.

Support


If you find any bugs feel free to post in this thread and I'll try to reply and fix the problem when I can :) .

Known Compatibility Issues

I don't think there will be any compatibility issues.

Demo


See attached files.

Author's Notes


Again, if you didn't read it earlier in the post, this script requires my FFVIII Card Menu script.
Get that here >> http://rmrk.net/index.php/topic,43614.0.html

Restrictions

For non-commercial games only.