Trabounet Nouvel Arrivant
Nombre de messages : 7 Age : 28 Localisation : Chez moi Niveau : : A vous de juger Projet(s) : : Collège & Kaziku I Argent (Po) : : Date d'inscription : 02/02/2008
| Sujet: Objet qui permet de choisir à qui on apprend un skill Sam 2 Fév - 12:21 | |
| ce script qui permet de faire apprendre au personnage de son choix un skill. Un petit screen : https://servimg.com/view/11678258/15Le script est appellé par la commande : $scene = Scene_Learn.new(x), où x est le numéro du skill dans votre base de données. Copiez le script au dessus du main et appellez le comme vous voulez : - Code:
-
#============================================================================== # Scene_Learn : Apprentissage d'une compétence #------------------------------------------------------------------------------ # Créé par Raven - [email][color=#cc0000]ravenevans@hotmail.com[/color][/email] pour RPG Creative # Date: 16/02/07 #==============================================================================
class Window_LearnHelp < Window_Base #-------------------------------------------------------------------------- # ● Création de la fenêtre # skill_index : Id du Skill #-------------------------------------------------------------------------- def initialize(skill_index = 0) super(120, 75, 400, 70) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = 'Arial' self.contents.font.size = 20 skill = $data_skills[skill_index] text = skill.description sp = skill.sp_cost.to_s @text = text + " - MP : " + sp refresh end #-------------------------------------------------------------------------- # ● Affichage du titre #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.draw_text(0, 0, 500, 40, @text) end end
class Window_LearnName < Window_Base #-------------------------------------------------------------------------- # ● Création de la fenêtre # skill_index : Id du Skill #-------------------------------------------------------------------------- def initialize(skill_index = 0) super(170, 10, 300, 60) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = 'Arial' self.contents.font.size = 22 @skill = $data_skills[skill_index] text = @skill.name @text = text refresh end #-------------------------------------------------------------------------- # ● Affichage du titre #-------------------------------------------------------------------------- def refresh self.contents.clear bitmap = RPG::Cache.icon(@skill.icon_name) self.contents.blt(0, 4, bitmap, Rect.new(0, 0, 24, 24)) self.contents.draw_text(34, 0, 300, 30, @text) end end
class Scene_Learn #-------------------------------------------------------------------------- # ● Initialisation # skill_index : Id du Skill #-------------------------------------------------------------------------- def initialize(skill_index = 0) @skill_index = skill_index end #-------------------------------------------------------------------------- # ● Principal #-------------------------------------------------------------------------- def main @spriteset = Spriteset_Map.new @help_window = Window_LearnHelp.new(@skill_index) @name_window = Window_LearnName.new(@skill_index) list=[] for i in 0..$game_party.actors.size - 1 actor = $game_party.actors[i] list.push(actor.name) end @command_window = Window_Command.new(200, list) @help_window.opacity = 170 @name_window.opacity = 170 @command_window.opacity = 170 @command_window.active = true @command_window.index = 0 @command_window.x = 220 @command_window.y = 180 Graphics.transition if $game_party.actors.size == 0 $scene = Scene_Map.new end loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @help_window.dispose @name_window.dispose @command_window.dispose @spriteset.dispose end #-------------------------------------------------------------------------- # ● Mise à jour #-------------------------------------------------------------------------- def update @help_window.update @name_window.update @command_window.update if Input.trigger?(Input::B) $scene = Scene_Map.new end if Input.trigger?(Input::C) $game_system.se_play($data_system.shop_se) $game_party.actors[@command_window.index].learn_skill(@skill_index) $scene = Scene_Map.new end end end | |
|
Lunatic Maître des Lieux
Nombre de messages : 110 Age : 116 Localisation : En vacance. Revient le 9 février ! Niveau : : Assez bon. Projet(s) : : Zelda Project - Pause -, PET's : version Dog. Argent (Po) : : Date d'inscription : 26/01/2008
| Sujet: Re: Objet qui permet de choisir à qui on apprend un skill Sam 2 Fév - 12:45 | |
| Merci pour la partage ! Continus comme ca ! | |
|
Zexion Surveillant
Nombre de messages : 158 Age : 31 Argent (Po) : : Date d'inscription : 28/01/2008
| Sujet: Re: Objet qui permet de choisir à qui on apprend un skill Sam 2 Fév - 16:22 | |
| Oui, continue à enrichir la section script, c'est très sympa. | |
|
Kylan VIP
Nombre de messages : 17 Age : 30 Localisation : Eure et Loir. Chartres Niveau : : Bon en scénario, moyen en script. Event maker surtout. ? Projet(s) : : Adra-Evera Argent (Po) : : Date d'inscription : 27/01/2008
| Sujet: Re: Objet qui permet de choisir à qui on apprend un skill Sam 2 Fév - 21:10 | |
| C'est super cool : j'attendais un script comme ça ! Un grand merci à Trabounet pour le partage | |
|
Contenu sponsorisé
| Sujet: Re: Objet qui permet de choisir à qui on apprend un skill | |
| |
|