[Joe Pro] Custom Tags

● ARCHIVED · READ-ONLY
Started by JoePro 1 posts View original ↗
  1. class Custom Tags(version 1.0)

      def Initialize:
           You are no longer have to be pinned to the norm. You can now create and access as many tags as you can fit. they can be anything from 

           gender to age to weight to a favorite food or person, the choice is yours. For easy access you can even set those tags to $game_variables

           and really make your game yours.

      end

      def Features:

    • Create and access custom tags for actors.
    • Create and access custom tags for weapons.
    • Create and access custom tags for armors.
    • Create and access custom tags for items.
      end

      def How to use:
           Use this tag in any of the noteboxes listed above. tag_name can be any word you want but it must contain all words. tag_value can

           be anything from words to numbers and even symbols, just incase you want to use ♂ and ♀ for you gender tags if you do gender tags.

           More detailed infromation can be found at the top of the script in the "How To Use" section.

      end

      def Script:

    Spoiler
    #################################################################################↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓##↓ ↓##↓ Custom Tags: Version 0.1 ↓##↓ ↓##↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕↕##↑ ↑##↑ Written By: Joe Pro ↑##↑ Last Edited: July 31, 2014 ↑##↑ ↑##↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑##################################################################################◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙ ** Disclaimer ◙##◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙##◙ ◙##◙ This script is not for commercial, if you wish to use this script in a ◙##◙ game please PM me. All credit is to be given to me as the author of this ◙##◙ script. ◙##◙ ◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙ ** How To Use ◙##◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙##◙ ◙##◙ * Use the example below in an any notebox to create a tag. ◙##◙ ◙##◙ tag: "Tag_Description", "Tag_Info" ◙##◙ ◙##◙ ◙##◙ * You can check the value of $game_party.battle_members[0] tags ◙##◙ by using the following method. ◙##◙ ◙##◙ tag?("Tag_Description") ◙##◙ ◙##◙ * You can check the value of $game_actors[x], $game_party.members[x] ◙##◙ or $game_party.battle_members[x] tags by using the following method. ◙##◙ ◙##◙ actor_tag?(actor, "Tag_Description") ◙##◙ ◙##◙ * You can check the value of $data_actors[x], $data_weapons[x], ◙##◙ $data_armors[x], $data_items[x], $data_enemies[x] tags by using the ◙##◙ following method. ◙##◙ data_types are as follows; ◙##◙ 0 = Actors ◙##◙ 1 = Weapons ◙##◙ 2 = Armors ◙##◙ 3 = Items ◙##◙ 4 = Enemies ◙##◙ ◙##◙ data_tag?(data_type, ID, "Tag_Description") ◙##◙ ◙##◙ * You can change the value of $game_party.battle_members[0] tags by ◙##◙ using the following method, you can also assign the new value to ◙##◙ $game_variables. ◙##◙ ◙##◙ change_tag(handler, new_value) ◙##◙ ◙##◙ * You can change the value of $game_actors[x], $game_party.members[x] ◙##◙ or $game_party.battle_members[x] tags by using the following method, ◙##◙ you can also assign the new value to $game_variables. ◙##◙ ◙##◙ change_actor_tag(actor, handler, new_value) ◙##◙ ◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##◙ ** Updates / Version Notes ◙##◙••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••◙##◙ ◙##◙ v0.1 ◙##◙ ~◄◙◙◙◙►~ ◙##◙ * This script allows create as many and whatever tags for characters ◙##◙ weapons, armors, items and enemies as you want to. Gender, Race, ◙##◙ Height, Weight, ID.. These are just a few examples. Actors tags are ◙##◙ saved and can be changed through out the game. ◙##◙ ◙##◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙◙##################################################################################↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓##↓ ↓##↕ Custom Tags: Version 0.1 ↕##↑ ↑##↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑##################################################################################==============================================================================# ** RPG::Actor < RPG::BaseItem#------------------------------------------------------------------------------# The Data Class for actors.#==============================================================================class RPG::Actor < RPG::BaseItem #-------------------------------------------------------------------------- # * Get All Weapon's Tags #-------------------------------------------------------------------------- def tags return self.note.scan(/tag:\s*(\w*)\S*\s*(\S*)/im) end end#==============================================================================# ** RPG::Weapon < RPG::EquipItem#------------------------------------------------------------------------------# The Data Class for weapons.#==============================================================================class RPG::Weapon < RPG::EquipItem #-------------------------------------------------------------------------- # * Get All Weapon's Tags #-------------------------------------------------------------------------- def tags return self.note.scan(/tag:\s*(\w*)\S*\s*(\S*)/im) end #-------------------------------------------------------------------------- # * Return Weapon's Tag Value by Index #-------------------------------------------------------------------------- def tag?(handler) tags.each { |tag| return tag[1] if tag[0] == handler } end end#==============================================================================# ** RPG::Armor < RPG::EquipItem#------------------------------------------------------------------------------# The Data Class for Armors.#==============================================================================class RPG::Armor < RPG::EquipItem #-------------------------------------------------------------------------- # * Get All Armor's Tags #-------------------------------------------------------------------------- def tags return self.note.scan(/tag:\s*(\w*)\S*\s*(\S*)/im) end #-------------------------------------------------------------------------- # * Return Weapon's Tag Value by Index #-------------------------------------------------------------------------- def tag?(handler) tags.each { |tag| return tag[1] if tag[0] == handler } end end#==============================================================================# ** RPG::Item < RPG::UsableItem#------------------------------------------------------------------------------# The Data Class for Items.#==============================================================================class RPG::Item < RPG::UsableItem #-------------------------------------------------------------------------- # * Get All Item's Tags #-------------------------------------------------------------------------- def tags return self.note.scan(/tag:\s*(\w*)\S*\s*(\S*)/im) end #-------------------------------------------------------------------------- # * Return Weapon's Tag Value by Index #-------------------------------------------------------------------------- def tag?(handler) tags.each { |tag| return tag[1] if tag[0] == handler } end end#==============================================================================# ** RPG::Enemy < RPG::BaseItem#------------------------------------------------------------------------------# The Data Class for Enemies.#==============================================================================class RPG::Enemy < RPG::BaseItem #-------------------------------------------------------------------------- # * Get All Enemy Tags #-------------------------------------------------------------------------- def tags return self.note.scan(/tag:\s*(\w*)\S*\s*(\S*)/im) end #-------------------------------------------------------------------------- # * Return Weapon's Tag Value by Index #-------------------------------------------------------------------------- def tag?(handler) tags.each { |tag| return tag[1] if tag[0] == handler } end end#==============================================================================# ** Game_Actor#------------------------------------------------------------------------------# This class handles actors. It is used within the Game_Actors class# ($game_actors) and is also referenced from the Game_Party class ($game_party).#==============================================================================class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :tags # timers #-------------------------------------------------------------------------- # * Aliasing Method: Object Initialization #-------------------------------------------------------------------------- alias :gai1321654654 :initialize #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(*args) gai1321654654(*args) set_tags end #-------------------------------------------------------------------------- # * Set Weapon's Tags #-------------------------------------------------------------------------- def set_tags @tags = {} actor.tags.size.times { |i| @tags[actor.tags[0]] = actor.tags[1] } @tags end #-------------------------------------------------------------------------- # * Return Actor Variable's Value by Index #-------------------------------------------------------------------------- def tag?(handler) return @tags[handler] end #-------------------------------------------------------------------------- # * Change Tag Value #-------------------------------------------------------------------------- def change_tag(handler, new_value) @tags[handler] = new_value end end#==============================================================================# ** Game_Interpreter#------------------------------------------------------------------------------# An interpreter for executing event commands. This class is used within the# Game_Map, Game_Troop, and Game_Event classes.#==============================================================================class Game_Interpreter #-------------------------------------------------------------------------- # * Returns Data's Tag Value by Index and ID # 0 = Acotrs # 1 = Weapons # 2 = Armors # 3 = Items # 4 = Enemies #-------------------------------------------------------------------------- def data_tag?(type, id, handler) case type when 0 return $data_actors[id].tag?(handler) when 1 return $data_weapons[id].tag?(handler) when 2 return $data_armors[id].tag?(handler) when 3 return $data_items[id].tag?(handler) when 4 return $data_enemies[id].tag?(handler) end end #-------------------------------------------------------------------------- # * Returns Leader's Saved Tag Value by Index #-------------------------------------------------------------------------- def tag?(handler) return $game_party.battle_members[0].tags[handler] end #-------------------------------------------------------------------------- # * Returns Actors's Saved Tag Value by Index #-------------------------------------------------------------------------- def actor_tag?(actor, handler) return actor.tags[handler] end #-------------------------------------------------------------------------- # * Changes Leader's Saved Tag Value by Index #-------------------------------------------------------------------------- def change_tag(handler, new_value) $game_party.battle_members[0].tags[handler] = new_value end #-------------------------------------------------------------------------- # * Changes Actor's Saved Tag Value by Index #-------------------------------------------------------------------------- def change_tag(actor, handler, new_value) actor.tags[handler] = new_value end end
      end

      def Credit, Licence & Commercial Usage:
           This script is free to use for non-commercial use. If you want to obtain a license to use this script in a commercial game(contests included)

           please PM me. Credit is to be give to myself, JoePro.

      end

    end