estriole 326 Posted October 6, 2012 EST - RACE TRAITS v 1.0 Creator name : Estriole Introduction Maybe you have humans, elf, dwarf, robot, etc in your game. instead of setting the trait manually each actors. you could use this script and assign it at one armor in database and set the race for the actors to gain all the trait you set in that armor. this make it easy whenever you change your mind and want to change the trait. ex : at first. you decide elf should have 2 action in one turn a.k.a double action since elf is fast being by logic. you set it but regret it later since it's so broken when you have 4 elf in party . then you want to change it to agi + 10% instead. if you're doing it manually you have to change every elf you have in the database. but if you're using this script you only need to alter the 'elf' armor. and every elf have +10% agi and lose double action. Version History: v 1.0 - 2012.10.06 > - finish the script Features - assign race using notetags - assign race traits using armors in database - possibility of mixed race - you tell me Screenshots not needed How to Use 1) set your race in the configuration part of the script a) set the name (this will be used as notetags) set the armor id that it reference as trait adder. you could also assign multiple armor since i made it arrays in case you have mixed race. ex: hercules is half god half human. he gain both human and god trait. 2) create the armor that you assign as race trait and give it traits (ex:maxhp +100%,etc) 3) give tags to your actors <race: x> x is the race name you defined in the configuration (not case sensitive) Script =begin ============================================================================== ** EST - RACE TRAITS AND FEATURE ------------------------------------------------------------------------------ Author : ESTRIOLE Usage Level : Easy licences: Free to use in all project (except the one containing pornography) as long as i credited (ESTRIOLE). also credits to FORMAR since i use his extra trait lv up as guide. modification for your own usage is permitted just don't claim this is yours just add below the author: Modded by : .... Version History: v 1.0 - 2012.10.06 > - finish the script ------------------------------------------------------------------------------ This script assign traits to actors based on what race the actor is. actor race assigned using notetags. and the traits added is using armors as reference in the database. ------------------------------------------------------------------------------ How to use: 1) set your race in the configuration part below a) set the name set the armor id that it reference as trait adder. you could also assign multiple armor since i made it arrays in case you have mixed race. ex: hercules is half god half human. he gain both human and god trait. 2) create the armor that you assign as race trait and give it traits (ex:maxhp +100%,etc) 3) give tags to your actors <race: x> x is the race name you defined in the configuration (not case sensitive) Future Development Currently this only support traits. not attack/def/agi modifier. maybe if lots of people want it i could try making it. Author Notes none =end module ESTRIOLE ######## RACE CONFIGURATION PART ###################################### RACE = { # DO NOT TOUCH THIS LINE 1 => { NAME: "HUMAN", #this used in notetags: <race: human> ARMOR_ID: [1] #array of armor id to add starting feature }, #remember the , people tend to forget this 2 => { NAME: "ELF", ARMOR_ID: [2] }, 3 => { NAME: "DWARF", ARMOR_ID: [3,4] }, 4 => { NAME: "DEMON", ARMOR_ID: [5] }, 5 => { NAME: "HALF_ELF", #no spaces allowed if name have two words <race: half_elf> ARMOR_ID: [1,2] }, }# DO NOT TOUCH THIS LINE ####### END RACE CONFIGURATION PART ################################### RACE_TAG = /<(?:RACE|TRIBE):\s*(\w+)>/i # RACE_TAG = /<race:[ ]*(\w+.)>/ end #load notetags part class RPG::Actor < RPG::BaseItem attr_accessor :race def load_notetags_race @race = nil self.note.split(/[\r\n]+/).each { |line| case line when ESTRIOLE::RACE_TAG @race = $1 end } #end note split end end module DataManager #-------------------------------------------------------------------------- # alias method: load_database #-------------------------------------------------------------------------- class <<self; alias load_database_est_race1234 load_database; end def self.load_database load_database_est_race1234 load_notetags_est_race_333 end #-------------------------------------------------------------------------- # new method: load_notetags_armpos #-------------------------------------------------------------------------- def self.load_notetags_est_race_333 for obj in $data_actors next if obj.nil? obj.load_notetags_race end puts "Read: actor race Notetags" end end # DataManager class Game_Actor < Game_Battler alias est_race_feature_setup setup def setup(actor_id) @race_features = Race_Features.new @race_features.features = [] set_race_features(actor_id) if $data_actors[actor_id].race != nil est_race_feature_setup(actor_id) end def get_armor_race(id) for i in 1..ESTRIOLE::RACE.size actor_race = $data_actors[id].race check = /#{actor_race}/i.match(ESTRIOLE::RACE[:NAME]) return ESTRIOLE::RACE[:ARMOR_ID] if check end return nil end def set_race_features(id) armor_ref = get_armor_race(id) if armor_ref!=nil for i in 0..armor_ref.size-1 @race_features.features += $data_armors[armor_ref.to_i].features end end end alias est_feature_objects feature_objects def feature_objects est_feature_objects + [@race_features] end end class Race_Features attr_accessor :features end Demo version 1.0 http://www.mediafire.com/?6oz59l1u62y5b8g Compatibility - tell me and i will try to make it compatible. but i think it should compatible with most script. Credit and Thanks - Estriole - Formar since i use his extra trait lv up as guide Author's Notes none Share this post Link to post Share on other sites
cor2879 0 Posted January 17, 2014 Absolutely beautiful. Share this post Link to post Share on other sites