nomorehero Posted May 22, 2012 Share Posted May 22, 2012 (edited) Trait namerDescrizione Traduce il database in inglese (inutile in caso usiate la patch del buon holy) e crea nuovi vocaboli(Es. salute Xs per le cure minori) PersonalizzabileUtile perchè necessario al funzionamento dello script Runic Enchantment sempre di Kread-Ex Autore Kread_Ex [ Istruzioni per l'uso Le poche notizie necessarie sono nello script [/ #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:= # ▼ Traits Namer # Author: Kread-EX # Version: 1.01 # Release date: 11/03/2012 #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:= #------------------------------------------------------------------------------------------------- # ▼ UPDATES #------------------------------------------------------------------------------------------------- # # 24/03/2012. Added methods used by Alchemic Synthesis. # # 23/03/2012. Version 1.0, now help window generation is included. #------------------------------------------------------------------------------------------------- # ▼ TERMS OF USAGE #------------------------------------------------------------------------------------------------- # # You are free to adapt this work to suit your needs. # # You can use this work for commercial purposes if you like it. # # Credit is appreciated. # # # # For support: # # grimoirecastle.wordpress.com # # rpgmakerweb.com # # rpgrevolution.com #------------------------------------------------------------------------------------------------- # ▼ INTRODUCTION #------------------------------------------------------------------------------------------------- # # This is a core script. By itself, it doesn't do anything but it used by # # Runic Enchantment and Alchemic Synthesis. The purpose of this script # # is to provide an automated way to name traits: the script retrieve the traits # # data and generates a name based on a customizable template. #------------------------------------------------------------------------------------------------- $imported = {} if $imported.nil? $imported['KRX-TraitsNamer'] = true puts 'Load: Traits Namer v1.01 by Kread-EX' module KRX module TraitsNamer #=========================================================================== # ■ CONFIGURATION #=========================================================================== X_PARAMETERS = [ 'Accuracy', 'Evasion', 'Critical rate', 'M. Evasion', 'Counter rate', 'HP Regen', 'MP Regen', 'TP Regen' ] S_PARAMETERS = [ 'Aggro effect', 'Guard effect', 'Recovery rate', 'Pharmacology', 'MP cost', 'TP charge rate', 'Physical damage', 'Magical damage', 'Floor damage', 'EXP rate' ] SPECIAL_FLAGS = [ 'Autobattle', 'Guard', 'Cover', 'TP Saver' ] PARTY_ABILITY = [ 'Half Encounter', 'No Encounter', 'No surprise attacks', 'No preemptive attacks', 'Gold x2', 'Item Drops x2' ] CODENAMES = { 11 => '%s resist: %d%%' , # Element rate 12 => '%s debuff rate: %d%%' , # Debuff rate 13 => '%s resist: %d%%' , # State rate 14 => 'Immunity: %s' , # State immunity 21 => '%s: %d%%' , # Parameter rate 22 => '%s: %d%%' , # Additional parameter rate 23 => '%s: %d%%' , # Special parameter rate 31 => 'Attack %s' , # Physical attack attribute 32 => 'Attack %s %d%%' , # Physical attack state 33 => 'Attack speed %d' , # Attack speed correction 34 => 'Attack x%d' , # Additional attacks 41 => 'Command: %s' , # Add skill type 42 => 'Seal: %s' , # Seal skill type 43 => 'Skill: %s' , # Add skill 44 => 'Skill Seal: %s' , # Seal skill 51 => 'Can equip: %s' , # Add equip type (weapon) 52 => 'Can equip: %s' , # Add equip type (armor) 53 => 'Fix equip: %s' , # Fix equip slot 54 => 'Seal equip: %s' , # Seal equip slot 55 => 'Dual Wielding' , # Dual Wield 61 => 'Bonus Actions: +%d%%' , # Bonus actions 62 => '%s' , # Special flag 63 => 'Collapse type' , # Collapse type (will never be used, I think) 64 => '%s' , # Party ability } CODEHELP = { # Element rate 11 => 'Grants %d%% %s resistance.', # Debuff rate 12 => 'Grants %d%% resistance to %s debuff.', # State rate 13 => 'Grants %d%% %s resistance.', # State immunity 14 => 'Grants immunity to %s.', # Parameter rate 21 => 'Raises %s by %d%%.', # Additional parameter rate 22 => 'Raises %s by %d%%.', # Special parameter rate 23 => 'Grants a %d% modifier to %s.', # Physical attack attribute 31 => 'Adds %s element to normal attacks.', # Physical attack state 32 => 'Adds %s to normal attacks (%d%% accuracy).', # Attack speed correction (bonus) 33 => ['Raises attack speed by %d.', # Attack speed correction (malus) 'Reduces attack speed by %d.'], # Additional attacks 34 => 'Grants %d additional attacks.', # Add skill type 41 => 'Enables the %s battle command.', # Seal skill type 42 => 'Seals the %s battle command.', # Add skill 43 => 'Allows the use of the %s skill', # Seal skill 44 => 'Seals the %s skill.', # Add equip type (weapon) 51 => 'Allows %s to be equipped.', # Add equip type (armor) 52 => 'Allows %s to be equipped.', # Fix equip slot 53 => 'Fixes the %s equipment slot.', # Seal equip slot 54 => 'Seals the %s equipment slot.', # Dual Wield 55 => 'Allows to use two weapons as the same time.', # Bonus actions 61 => 'Raises the action rate by %d%%.', # Autobattle 62 => ['The character will act on his/her own in battle.', # Guard 'The character will permanently defend.', # Cover 'The character will take hits for his/her wounded comrades.', # TP Saver 'TP are kept after battles.'], # Collapse type (no need to use it but meh) 63 => 'Alters the collapse animation.', # Half encounter 64 => ['Halves the random encounter rate.', # No encounter 'Disables random encounters.', # No surprise attacks 'Disables surprise attacks.', # No preemptive attacks 'Disables preemptive attacks.', # Gold x2 'Doubles the money obtained after a battle.', # Item Drops x2 'Doubles the drop rate of items.'] } EFFECTS_CODENAMES = { 11 => 'HP Recovery' , # HP Recovery 12 => 'MP Recovery' , # MP Recovery 13 => 'TP Recovery' , # TP Gain 21 => 'Add %s' , # Add State 22 => 'Cleanse %s' , # Remove State 31 => '%s+' , # Add buff 32 => '%s-' , # Add debuff 33 => 'Dispel %s+' , # Remove buff 34 => 'Cancel %s-' , # Remove debuff 41 => 'Escape' , # Escape 42 => '%s Bonus' , # Permanent stat growth 43 => 'Learn %s' , # Permanent skill learning 44 => 'Common Event' , # Common event } EFFECTS_CODEHELP = { # HP Recovery (static) 11 => ['Restores %d HP.', # HP Recovery (dynamic) 'Restores %d%% of maximum HP.'], # MP Recovery (static) 12 => ['Restores %d MP.', # MP Recovery (dynamic) 'Restores %d%% of maximum MP.'], # TP Gain 13 => 'Restores %d%% TP.', # Add State 21 => 'Inflicts %s (%d%% chance).', # Remove State 22 => 'Cancels %s.', # Add buff 31 => 'Increases %s for %d turns.', # Add debuff 32 => 'Decreases %s for %d turns.', # Remove buff 33 => 'Cancels a previously applied %s buff.', # Remove debuff 34 => 'Dispels an active %s debuff.', # Escape 41 => 'Automatically escape from battle.', # Permanent stat growth 42 => 'Boosts %d by %d permanently.', # Permanent skill learning 43 => 'Teaches the %s skill permanently.', # Common Event 44 => 'Calls a common event.' } #=========================================================================== # ■ CUSTOM TRAITS/EFFECTS CONFIGURATION #=========================================================================== # INSTRUCTIONS # Here you can define custom traits names and descriptions. # # Syntax: # [type, code, data_id, value 1, value2] => [name, description] # # type: 0 (for equipment), 1 (for usables) # # code: the code number. Refer to default naming to know what is what. # # data_id: the number of the option you've choosen in the trait droplist. # # value1: what you typed in the first field where you can write numbers. # For equipment this is the only one. # # value2: usable items only. What you typed in the second field. # # description: If you want to also use a custom description. If you only # want the custom name, set this to nil. CUSTOM_TRAITS = { [0, 32, 2, 50] => ['Poisonous', nil], [0, 32, 2, 100] => ['Venomous', nil], [1, 11, 0, 0, 10] => ['HP Recovery XS', nil], [1, 11, 0, 0, 25] => ['HP Recovery S', nil], [1, 11, 0, 0, 50] => ['HP Recovery M', nil], [1, 11, 0, 0, 75] => ['HP Recovery L', nil], [1, 11, 0, 0, 100] => ['HP Recovery XL', 'Restores all HP!'], [1, 12, 0, 0, 10] => ['MP Recovery XS', nil], [1, 12, 0, 0, 25] => ['MP Recovery S', nil], [1, 12, 0, 0, 50] => ['MP Recovery M', nil], [1, 12, 0, 0, 75] => ['MP Recovery L', nil], [1, 12, 0, 0, 100] => ['MP Recovery XL', 'Restores all MP!'], [1, 13, 0, 2, 0] => ['TP Recovery XS', nil], [1, 13, 0, 5, 0] => ['TP Recovery S', nil], [1, 13, 0, 10, 0] => ['TP Recovery M', nil], [1, 13, 0, 16, 0] => ['TP Recovery L', nil], [1, 13, 0, 20, 0] => ['TP Recovery XL', nil], } #=========================================================================== # ■ CONFIGURATION ENDS HERE #=========================================================================== #-------------------------------------------------------------------------- # ● Generates traits name #-------------------------------------------------------------------------- def self.feature_name(code, data_id, value) custom = CUSTOM_TRAITS[[0, code, data_id, self.convert_value(code, value)]] return custom[0] unless custom.nil? || custom[0].nil? base_name = CODENAMES[code] data_name = case code when 11, 31 $data_system.elements[data_id] when 12, 21 Vocab.param(data_id) when 13, 14, 32 $data_states[data_id].name when 22 X_PARAMETERS[data_id] when 23 S_PARAMETERS[data_id] when 41, 42 $data_system.skill_types[data_id] when 43, 44 $data_skills[data_id].name when 51 $data_system.weapon_types[data_id] when 52 $data_system.armor_types[data_id] when 53, 54 Vocab.etype(data_id) when 62 SPECIAL_FLAGS[data_id] when 64 PARTY_ABILITY[data_id] end final_value = case code when 11, 13 100 - (value * 100) when 33, 34 value else value * 100 end if data_name.nil? name = sprintf(base_name, final_value) else name = sprintf(base_name, data_name, final_value) end name end #-------------------------------------------------------------------------- # ● Generates traits description #-------------------------------------------------------------------------- def self.feature_description(code, data_id, value) custom = CUSTOM_TRAITS[[0, code, data_id, self.convert_value(code, value)]] return custom[1] unless custom.nil? || custom[1].nil? if CODEHELP[code].is_a?(Array) base_help = CODEHELP[code][data_id] else base_help = CODEHELP[code] end data_name = case code when 11, 31 $data_system.elements[data_id] when 12, 21 Vocab.param(data_id) when 13, 14, 32 $data_states[data_id].name when 22 X_PARAMETERS[data_id] when 23 S_PARAMETERS[data_id] when 41, 42 $data_system.skill_types[data_id] when 43, 44 $data_skills[data_id].name when 51 $data_system.weapon_types[data_id] when 52 $data_system.armor_types[data_id] when 53, 54 Vocab.etype(data_id) when 62 SPECIAL_FLAGS[data_id] when 64 PARTY_ABILITY[data_id] end final_value = case code when 11, 13 100 - (value * 100) when 33, 34 value else value * 100 end if data_name.nil? name = sprintf(base_help, final_value) else name = sprintf(base_help, data_name, final_value) end name end #-------------------------------------------------------------------------- # ● Generates effects name #-------------------------------------------------------------------------- def self.effect_name(code, data_id, value1, value2) custom = CUSTOM_TRAITS[[1, code, data_id, self.convert_value(code, value1, false), self.convert_value(code, value2, false)]] return custom[0] unless custom.nil? || custom[0].nil? base_name = EFFECTS_CODENAMES[code] data_name = case code when 21, 22 $data_states[data_id].name when 31, 32, 33, 34, 42 Vocab.param(data_id) when 43 $data_skills[data_id] end if data_name.nil? name = sprintf(base_name, value1, value2) else name = sprintf(base_name, data_name, value1, value2) end name end #-------------------------------------------------------------------------- # ● Generates effects description #-------------------------------------------------------------------------- def self.effect_description(code, data_id, value1, value2) custom = CUSTOM_TRAITS[[1, code, data_id, self.convert_value(code, value1, false), self.convert_value(code, value2, false)]] return custom[1] unless custom.nil? || custom[1].nil? if EFFECTS_CODEHELP[code].is_a?(Array) base_help = value2 > 0 ? EFFECTS_CODEHELP[code][0] : EFFECTS_CODEHELP[code][1] else base_help = EFFECTS_CODEHELP[code] end data_name = case code when 21, 22 $data_states[data_id].name when 31, 32, 33, 34, 42 Vocab.param(data_id) when 43 $data_skills[data_id] end value1 = self.convert_value(code, value1, false) value2 = self.convert_value(code, value2, false) value1 = value2 if value1 == 0 if data_name.nil? name = sprintf(base_help, value1, value2) else name = sprintf(base_help, data_name, value1, value2) end name end #-------------------------------------------------------------------------- # ● Converts the real value to the one entered in the editor #-------------------------------------------------------------------------- def self.convert_value(code, value, feature = true) if feature && [33, 34].include?(code) return value.to_i elsif feature && [21].include?(code) return (value.to_f / 100) elsif [11, 12].include?(code) && value <= 1 return (value.to_i * 100).to_i elsif [21, 22].include?(code) return (value * 100).to_i else value.to_i end end #-------------------------------------------------------------------------- # ● Points towards either feature name or effect name #-------------------------------------------------------------------------- def self.trait_name(trait) if trait.is_a?(RPG::BaseItem::Feature) return self.feature_name(trait.code, trait.data_id, trait.value) end self.effect_name(trait.code, trait.data_id, trait.value1, trait.value2) end #-------------------------------------------------------------------------- # ● Points towards either feature description or effect description #-------------------------------------------------------------------------- def self.trait_description(trait) if trait.is_a?(RPG::BaseItem::Feature) return self.feature_description(trait.code, trait.data_id, trait.value) end self.effect_description(trait.code, trait.data_id, trait.value1, trait.value2) end end end Bugs e Conflitti Noti N/A Edited May 22, 2012 by nomorehero http://i.imgur.com/NwhgV4X.png Link to comment Share on other sites More sharing options...
Dilos Posted May 22, 2012 Share Posted May 22, 2012 (edited) Mmm...script particolare...ma serve per forza per quegli script? Non può essere indipendente? Spiega un po. :smile:Anche qui devi applicare il template. Edited May 22, 2012 by Dilos |FIRMA| http://img190.imageshack.us/img190/4826/pizzamannew.png Uomo Delle Pizze Uomo Misterioso http://img209.imageshack.us/img209/6190/dilos.jpg Link to comment Share on other sites More sharing options...
nomorehero Posted May 22, 2012 Author Share Posted May 22, 2012 (edited) Pare che servano per forza... Se non c'è da errore e non carica il menù delle rune... Edited May 22, 2012 by nomorehero http://i.imgur.com/NwhgV4X.png Link to comment Share on other sites More sharing options...
Guardian of Irael Posted May 22, 2012 Share Posted May 22, 2012 Argh il templetaccio! Leggi i regolamenti nohero! ;____ ;Anche qui sarà il caso di linkare gli altri topic in cui serve, comunque se da solo non ha valenza conta di fare un topic unico la prossima volta o non ha senso far vagare l'utente! XD^ ^ (\_/)(^ ^) <----coniglietto rosso, me! (> <) Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^ http://i.imgur.com/KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^ http://i.imgur.com/FwnGMI3.png completo! Giocabile online, qui i dettagli! ^ ^ REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^ 🖤http://www.rpg2s.net/dax_games/r2s_regali2s.png E:3 http://www.rpg2s.net/dax_games/xmas/gifnatale123.gifhttp://i.imgur.com/FfvHCGG.png by Testament (notare dettaglio in basso a destra)! E:3http://i.imgur.com/MpaUphY.jpg by Idriu E:3Membro Onorario, Ambasciatore dei Coniglietti (Membro n.44) http://i.imgur.com/PgUqHPm.pngUfficiale"Ad opera della sua onestà e del suo completo appoggio alla causa dei Panda, Guardian Of Irael viene ufficialmente considerato un Membro portante del Partito, e Ambasciatore del suo Popolo presso di noi"http://i.imgur.com/TbRr4iS.png<- Grazie Testament E:3Ricorda...se rivolgi il tuo sguardo ^ ^ a Guardian anche Guardian volge il suo sguardo ^ ^ a te ^ ^http://i.imgur.com/u8UJ4Vm.gifby Flame ^ ^http://i.imgur.com/VbggEKS.gifhttp://i.imgur.com/2tJmjFJ.gifhttp://projectste.altervista.org/Our_Hero_adotta/ado2.pngGrazie Testament XD Fan n°1 ufficiale di PQ! :DVivail Rhaxen! <- Folletto te lo avevo detto (fa pure rima) che nonavevo programmi di grafica per fare un banner su questo pc XD (ora ho dinuovo il mio PC veramente :D) Rosso Guardiano dellahttp://i.imgur.com/Os5rvhx.pngRpg2s RPG BY FORUM:Nome: Darth Reveal PV totali 2PA totali 16Descrizione: ragazzo dai lunghi capelli rossi ed occhi dello stesso colore. Indossa una elegante giacca rossa sopra ad una maglietta nera. Porta pantaloni rossi larghi, una cintura nera e degli stivali dello stesso colore. E' solito trasportare lo spadone dietro la schiena in un fodero apposito. Ha un pendente al collo e tiene ben legato un pezzo di stoffa (che gli sta particolarmente a cuore) intorno al braccio sinistro sotto la giacca, copre una cicatrice.Bozze vesti non definitive qui.Equipaggiamento:Indossa:60$ e 59$ divisi in due tasche interneLevaitanSpada a due mani elsa lungaGuanti del Defender (2PA)Anello del linguaggio animale (diventato del Richiamo)Scrinieri da lanciere (2 PA)Elmo del Leone (5 PA)Corazza del Leone in Ferro Corrazzato (7 PA) ZAINO (20) contenente:Portamonete in pelle di cinghiale contenente: 100$Scatola Sanitaria Sigillata (può contenere e tenere al sicuro fino a 4 oggetti curativi) (contiene Benda di pronto soccorso x3, Pozione di cura)CordaBottiglia di idromeleForma di formaggioTorcia (serve ad illuminare, dura tre settori)Fiasca di ceramica con Giglio Amaro (Dona +1PN e Velocità all'utilizzatore)Ampolla BiancaSemi di Balissa CAVALLO NORMALE + SELLA (30 +2 armi) contentente:66$Benda di pronto soccorso x3Spada a due maniFagotto per Adara (fazzoletto ricamato) Link to comment Share on other sites More sharing options...
Ryuma Posted August 20, 2012 Share Posted August 20, 2012 (edited) scusate (spero di aver scritto nel posto giusto), io ho provato ad usarlo in un mio progetto con altri scrip (un po' troppi forse xD)e mi da questo errore quando vado a fare un combattimento: script "window_selectable" line 61: zero division error occurred. divided by 0. questo è quello che c'è dalla riga 57 alla 62: #-------------------------------------------------------------------------- # * Get Row Count #-------------------------------------------------------------------------- def row_max [(item_max + col_max - 1) / col_max, 1].max end so poco niente di scripting, quindi vi dico tutto ciò che ho notato, non so se poi centrerà qualcosa o no...comunque l'errore è su un altro script, il "Windows_Selectable" appunto. (sotto "finestre") all'inizio pensavo fosse un problema di incompatibilità con lo yamfly equip engin (http://yanflychannel...e-equip-engine/)ma ho visto che in un altro progetto con solo questi 2 non c'erano problemi... ah, un altra cosa, credo che il "runic enchantment" non centri, infatti l'ho provato anche senza e succedeva la stessa cosa... grazie mille in anticipo!no! no! scusate, avevo sbagliato a mettere una cosa nella battaglia ora non fa più quell'errore!!!scusate ancora, elimitate, pure questo post Edited August 20, 2012 by Ryuma Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now