Citadin Lv.7
Age : 28 Inscrit le : 09/01/2010 Messages : 219
| Sujet: [VX] Apprendre un sort en utilisant un autre Mer 3 Mar 2010 - 17:02 | |
| Bonjours. Auteur:modern algebra Trouver sur:rmrk.net C'est une vraie mine d'or Description:Ce script vous permet de crée des branche de compétence.C'est a dire,quand un sort a atteint un nombre de foix utilisé,il débloque une autre compétence. (Non non,y'as pas une fenêtre ou est afficher l'arbre de sort d'un hero ^^') Utilisation:Insserez - Code:
-
\ROOT_SKILL[skill_id, number_of_uses, <supplement_skills>, forget] Dans la boite a note d'une competence. Remplacer skill_id par l'Id de la prochaine compétence a debloquer. number_of_uses par le nombre d'utilisation avant de débloquer la compétence. les competences qui doivent être utiliser pour debloquer l'autre competence. le format est x,y,z sont l'id des compétences. Si vous remplacer forget par 1, quand vous apprendraie la prochaine competence,celle qui vous a permit d'apprendre cette compétence sera oublier. Pour plus d'information voir le script. script:ADD-ON:Affiche le nombre d'utilisation d'un sort. - Spoiler:
- Code:
-
#============================================================================== # Show Skill Count in Help # (Addon to Learn Skills By Use 1.0) # Version: 1.1 # Author: modern algebra (rmrk.net) # Date: January 23, 2010 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Description: # # This is an Addon to Learn Skills By Use that will draw the number of times # the actor has used a skill onto the Help Window when selecting skills. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Instructions: # # Place this script in its own slot in the script Editor (F11) somewhere # below the default scripts but still above Main. Then, set the text that you # want to signify the count under LSUVOCAB_USECOUNT at line 23, and you can # set the color of the text at line 24 - LSU_COUNT_FONTCOLOR. If this is an # integer, it takes the color from the windowskin palette. You could also set # it as an array of the form: [red, green, blue, alpha]. # Alternatively, you could set it up to only show the skill count if the # player presses a specified button. You would not get to choose the color in # that case, but would get to specify alignment. #==============================================================================
LSUVOCAB_USECOUNT = "Used: " # Text to label skill count LSU_BUTTONSHOW = false # Whether or not it shows up with the description # or is drawn only when pressing a button LSU_BUTTON = Input::SHIFT # If LSU_BUTTONSHOW is true, what button needs to # be pressed to show the skill use count LSU_SHOWCOUNT_ALIGN = 0 # Alignment of text if LSU_BUTTONSHOW is true LSU_COUNT_FONTCOLOR = 16 # Font color if LSU_BUTTONSHOW is false
#============================================================================== # ** Window_Help #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # new method - lsu_set_secondary_text #==============================================================================
class Window_Help #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Set Secondary Text #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def lsu_insert_secondary_text (text, align = 2) # Check if real text has changed if (@changed_text != @text) || (@changed_align != @align) if LSU_COUNT_FONTCOLOR.is_a? (Integer) self.contents.font.color = text_color (LSU_COUNT_FONTCOLOR) else self.contents.font.color = Color.new (*LSU_COUNT_FONTCOLOR) end self.contents.draw_text(4, 0, self.width - 40, WLH, text, align) @changed_text, @changed_align = @text, @align end end end
#============================================================================== # ** Window_Skill #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # aliased method - update_help #==============================================================================
class Window_Skill #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Update Help Text #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias ma_lsu_updhelp_uses_8kh2 update_help def update_help (*args) if LSU_BUTTONSHOW if Input.press? (LSU_BUTTON) && @actor @help_window.set_text (LSUVOCAB_USECOUNT + @actor.skill_count(skill.id).to_s, LSU_SHOWCOUNT_ALIGN) else ma_lsu_updhelp_uses_8kh2 (*args) end else ma_lsu_updhelp_uses_8kh2 (*args) return unless @actor && skill @help_window.lsu_insert_secondary_text (LSUVOCAB_USECOUNT + @actor.skill_count(skill.id).to_s) end end end
Le script: - Spoiler:
- Code:
-
#============================================================================== # Learn Skills By Use # Version: 1.0 # Author: modern algebra (rmrk.net) # Date: August 27, 2009 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Description: # # This script allows you to have actors learn skills by using other skills. # For instance, you could set it so that an actor will learn Fire II only # after he has used Fire 50 times. You can also set it so that there can be # multiple paths to learning a skill and multiple skill requirements. For # instance, that same actor could also learn Fire II if he has used Flame # 60 times and Flame II 25 times. However, you can also set class # prohibitions and level requirements, so if you never want a Paladin to # learn Fire II no matter how many times he uses its root skills, then it is # easy to set that up, and if you don't want Fire II to be learned by any # actor until they are at least level 7, then that can be setup too. You may # also set it up so that it is like an upgrade - Fire becomes obsolete once # Fire II is learned, and so you can simply forget Fire once you have Fire II # # Also, the actors will only learn these skills upon level up, not as soon # as they meet requirements, so if you are using any display levelup scripts, # the skills learned by use should show up in that script no problem. # # Further, this doesn't interfere with the regular skill learning system, so # if you set it that a mage will learn Fire II at level 6 in the Class Tab # of the database, than the mage will learn Fire II at level 6 no matter if # she has met the use requirements of its root skills, and no matter what # the class prohibitions or level requirements are. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Instructions: # # Place this script above Main and below Materials in the Editor. It should # also be below any custom levelup scripts you may have. # # To set up a skill to be learned through use, you must use this code in a # notes box: # # \ROOT_SKILL[skill_id, number_of_uses, <supplement_skills>, forget] # skill_id : The ID of the root skill that leads to this skill. # number_of_uses : An integer - the number of times the root skill has # be used before it teaches this skill. # <supplement_skills> : a list of skill IDs that also have to have their # root requirements fulfilled before the skill will be learned. It is # of the format: <x, y, z> where x, y, and z are the IDs of the other # skills that must have usage requirements met. You can have as many # as you like. Note, however, that you must set up one of these # requirements notes for each of the other skills as well, and you # must cross-reference the skills in this path. Defaults to <>, # meaning that the only usage requirements needed to be filled is this # one # forget : If this is set to 1, then the root skills will be forgotten # once this skill is learned. If left blank or set to any other digit, # than the root skills will be retained. # # EXAMPLE A: # # This code in the notebox of a skill: # # \ROOT_SKILL[9, 100] # # There is only one path to learning this skill: # (i) Use the skill with ID 9 at least 100 times. # # No skill is forgotten # # EXAMPLE B: # # These codes in the notebox of a skill: # # \ROOT_SKILL[1, 20, 1] # \ROOT_SKILL[4, 15, <5>] # \ROOT_SKILL[5, 8, <4>] # # With these codes, there are two paths to learning this skill. # (i) Use the skill with ID 1 at least 20 times. # (ii) Use the skill with ID 4 at least 15 times and use the skill with # ID 5 at least 8 times. # # No matter which path is taken to the skill, the skill with ID 1 will be # forgotten as soon as the new skill is learned. # # EXAMPLE C: # # The following codes in the notebox of a skill: # # \ROOT_SKILL[6, 100] # \ROOT_SKILL[7, 100] # \ROOT_SKILL[6, 20, <7, 8>] # \ROOT_SKILL[7, 25, <6, 8>] # \ROOT_SKILL[8, 15, <6, 7>] # # With these codes, there are three paths to learning this skill. # (i) Use the skill with ID 6 at least 100 times # (ii) Use the skill with ID 7 at least 100 times # (iii) Use the skill with ID 6 at least 20 times, the skill with ID 7 at # least 25 times, and the skill with ID 8 at least 15 times. # # No matter which path is taken, no skills will be forgotten. # # To prohibit a class from learning a skill through usage requirements, # put this code in a notebox of a skill: # # \PROHIBIT_CLASS[class_id] # class_id : ID of class not allowed to learn this skill through use # # To set a minimum level for learning a skill through usage requirements, # put this code in the notebox of a skill: # # \MIN_LEVEL[x] # x : an integer that is the minimum level. An actor cannot learn # the skill until his level is at least equal to x. #==============================================================================
#============================================================================== # ** Skill #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # new methods - ma_root_skills, ma_class_prohibited, ma_level_requirement #==============================================================================
class RPG::Skill #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Skill roots # \Root_Skill[skill_ID, # of uses, <supplement_skills>, forget?] #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def ma_root_skills if @ma_root_skills.nil? @ma_root_skills = [] text = self.note.dup while text.sub!(/\\ROOT_SKILL\[(\d+),?\s*?(\d+),?\s*?<?(.*?)>?,?\s*?(\d?)\]/i) { "" } != nil id = $1.to_i n = $2.nil? ? 0 : $2.to_i forget = $4.nil? ? false : $4.to_i == 1 supplement_skills = [] unless $3.nil? txt = $3 while txt.sub! (/(\d+?)/) { "" } != nil supplement_skills.push ($1.to_i) end end @ma_root_skills.push ([id, n, forget, supplement_skills]) end end return @ma_root_skills end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Class Prohibited? # \Prohibit_Class[class_ID] #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def ma_class_prohibited? (class_id) if @ma_prohibited_classes.nil? @ma_prohibited_classes = [] text = self.note.dup while text.sub! (/\\PROHIBIT_CLASS\[(\d+)\]/i) { "" } != nil @ma_prohibited_classes.push ($1.to_i) end end return @ma_prohibited_classes.include? (class_id) end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Level Requirement #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def ma_level_requirement if @ma_level_req.nil? @ma_level_req = self.note[/\\MIN_LEVEL\[(\d+)\]/i] != nil ? $1.to_i : 1 end return @ma_level_req end end
#============================================================================== # ** Game_Actor #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # aliased methods - initialize, level_up # new_method - lsbu_check_skill_requirements, skill_count #==============================================================================
class Game_Actor #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Object Initialization #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias modalg_brnchskill_init_1cx3 initialize def initialize (*args) @lsbu_skill_count = [] @lsbu_forget_skills = [] # Run Original Method modalg_brnchskill_init_1cx3 (*args) end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Level Up #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias malg_skl_brnches_byuse_lvlplus_0kb2 level_up def level_up (*args) # Run Original Method malg_skl_brnches_byuse_lvlplus_0kb2 (*args) # Check all skills to see if requirements have been met to learn the skill $data_skills.each { |skill| next if skill.nil? || skill.ma_root_skills.empty? if !@skills.include? (skill.id) && lsbu_check_skill_requirements (skill) # Learn Skill learn_skill (skill.id) @lsbu_forget_skills.each { |id| forget_skill (id) } end @lsbu_forget_skills.clear } end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Retrieve Skill Count # skill_id : ID of skill checked #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def skill_count (skill_id) @lsbu_skill_count[skill_id] = 0 if @lsbu_skill_count[skill_id].nil? return @lsbu_skill_count[skill_id] end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Increase Skill Count # skill_id : ID of skill increased #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def increase_skill_count (skill_id) @lsbu_skill_count[skill_id] = skill_count (skill_id) + 1 end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Check Skill Requirements # skill_id : ID of skill checked #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def lsbu_check_skill_requirements (skill) return false if skill.ma_class_prohibited? (@class_id) return false if @level < skill.ma_level_requirement skill_paths = [] skill.ma_root_skills.each { |requirements| @lsbu_forget_skills.push (requirements[0]) if requirements[2] # FALSE If root skill not possessed next if !@skills.include? (requirements[0]) # If skill not used enough next if skill_count (requirements[0]) < requirements[1] # Add path to skill_paths only if other requirements are true path = [requirements[0]] requirements[3].each { |supplement| path.push (supplement) } path.sort! # Add to skill paths array skill_paths.push (path) } # Check if any paths to this skill have been fulfilled while skill_paths.size > 0 path = skill_paths[0].dup skill_paths.delete_at (0) count = 1 # Check if the number of true requirements of this path equal to path size while count < path.size index = skill_paths.index (path) # If there aren't enough reqs for this path, do not return true break if index == nil skill_paths.delete_at (index) count += 1 end return true if count == path.size end return false end end
#============================================================================== # ** Scene Battle #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # aliased methods - execute_action_skill #==============================================================================
class Scene_Battle #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Execute Skill #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias mdrnalg_exctskl_lsbu_4nv2 execute_action_skill def execute_action_skill (*args) # Increase User's skill count if actor @active_battler.increase_skill_count (@active_battler.action.skill.id) if @active_battler.actor? # Run Original Method mdrnalg_exctskl_lsbu_4nv2 (*args) end end
#============================================================================== # ** Scene Skill #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # aliased method - use_skill_nontarget #==============================================================================
class Scene_Skill #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Use Skill Nontarget #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias malgbra_usesklnotrg_lsbu_5na2 use_skill_nontarget def use_skill_nontarget (*args) # Increase User's skill count @actor.increase_skill_count (@skill.id) # Run Original Method malgbra_usesklnotrg_lsbu_5na2 (*args) end end
|
|
Poulet trizo Lv.3
Age : 33 Inscrit le : 04/04/2011 Messages : 39
| Sujet: Re: [VX] Apprendre un sort en utilisant un autre Jeu 17 Nov 2011 - 21:41 | |
| bonsoir se script m’intéresse mais j'ai un question peux t'on avoir deux compétence grâce a une seul par exemple :
soin 25 fois utiliser on gagne soin + soin 50 fois utiliser on gagne résurrection
si cela est possible comment procéder ?
bonne soiré |
|
Illusionniste Lv.12
Age : 34 Inscrit le : 14/02/2010 Messages : 796
| Sujet: Re: [VX] Apprendre un sort en utilisant un autre Jeu 17 Nov 2011 - 22:12 | |
| T'as essayé de mettre deux lignes, tout simplement ? |
|
Poulet trizo Lv.3
Age : 33 Inscrit le : 04/04/2011 Messages : 39
| Sujet: Re: [VX] Apprendre un sort en utilisant un autre Ven 18 Nov 2011 - 10:21 | |
| bonjour tiroflan
je n'y ai pas panser merci je vais essayer |
|
Poulet Lv.1
Inscrit le : 21/11/2011 Messages : 4
| Sujet: Re: [VX] Apprendre un sort en utilisant un autre Lun 21 Nov 2011 - 13:03 | |
| bonjour je vient d'essayer se script et je n'arive pas a avoir la competence suivante faut t'il metre \ROOT_SKILL[skill_id, number_of_uses, , forget] dans la competence qu'on utilise ou celle qu'on veux avoir |
|
Maître des Duels
Age : 32 Inscrit le : 29/07/2009 Messages : 7841
| Sujet: Re: [VX] Apprendre un sort en utilisant un autre Lun 21 Nov 2011 - 13:09 | |
| Par exemple disons que tu souhaites obtenir la compétence d'id 2 après avoir utilisé 50 fois la compétence d'id 1. Il te suffira de mettre dans la notebox du skill d'id 2 ceci :
\ROOT_SKILL[1,50] |
|
Poulet Lv.1
Inscrit le : 21/11/2011 Messages : 4
| Sujet: Re: [VX] Apprendre un sort en utilisant un autre Lun 21 Nov 2011 - 13:28 | |
| je m'excuse je viens d'essayer je vais te dire se que je viens de faire
j'ai mis \ROOT_SKILL[13,10]
dans la boite commentaire de la compétence vent + (id 14) pour que si j'utilise au bout de 10 fois la compétence vent (id 13) je gagne la compétence vent +
me suis je tromper quelque part |
|
Maître des Duels
Age : 32 Inscrit le : 29/07/2009 Messages : 7841
| Sujet: Re: [VX] Apprendre un sort en utilisant un autre Lun 21 Nov 2011 - 14:26 | |
| D'après le script c'est bon. Ca marche ? |
|
Poulet Lv.1
Inscrit le : 21/11/2011 Messages : 4
| Sujet: Re: [VX] Apprendre un sort en utilisant un autre Lun 21 Nov 2011 - 14:34 | |
| non pas du tout , il n'y a aucun problème avec les script , la competence ne vient pas faut t'il faire quelque chose en particulier
c'est bon j'ai trouver il faut monter de niveau sinon cela ne marche pas |
|
Croisé Lv.14
Age : 26 Inscrit le : 22/05/2011 Messages : 1141
| Sujet: Re: [VX] Apprendre un sort en utilisant un autre Lun 21 Nov 2011 - 17:09 | |
| nn zang' faut pas mettre le commentaire dans la prochen compétence, mais dans le prmier sort exemple : pour le sort vend + ont met dans les commentaire de vent !!! ( pas de vent +) - Code:
-
\ROOT_SKILL[14,10] ont met l'id 14 celui de vend + non pas 13 de vent ++ |
|
Maître des Duels
Age : 32 Inscrit le : 29/07/2009 Messages : 7841
| Sujet: Re: [VX] Apprendre un sort en utilisant un autre Lun 21 Nov 2011 - 19:01 | |
| Merci mais je sais lire l'anglais ^^ Donc ce que j'ai dit est exact. - Code:
-
# The following codes in the notebox of a skill: # # \ROOT_SKILL[6, 100] # \ROOT_SKILL[7, 100] # \ROOT_SKILL[6, 20, <7, 8>] # \ROOT_SKILL[7, 25, <6, 8>] # \ROOT_SKILL[8, 15, <6, 7>] # # With these codes, there are three paths to learning this skill. # (i) Use the skill with ID 6 at least 100 times # (ii) Use the skill with ID 7 at least 100 times # (iii) Use the skill with ID 6 at least 20 times, the skill with ID 7 at # least 25 times, and the skill with ID 8 at least 15 times. |
|
| Sujet: Re: [VX] Apprendre un sort en utilisant un autre | |
| |
|