BaHaMuT Apprenti


Nombre de messages: 9 Age: 16 Emploi/loisirs: Making Projet en Cours: L'ile aux pirates ! Date d'inscription: 12/01/2008
 | Sujet: Journal Sam 12 Jan - 21:47 | |
| Voici un script qui permet d'afficher un journal indiquant vos actions realisées,ex "avoir parler a Jacky","etre aller a la peche"ect... D'abord ajouter celui la au dessus de main en l'apelant "Window_journal" | Code: | #============================================================================== # ** Journal #------------------------------------------------------------------------------ # This window displays a journal. #==============================================================================
class Window_Journal < Window_Selectable # ------------------------ def initialize super(0, 32, 460, 330) @column_max = 1 refresh self.index = 0 end
#-------------------------------------------------------------------------- # * Draw the contents of the item window #-------------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end # variables @journal_height = (2)*32 # y coord of entire journal (# of entries - 1) * 32 @n = 0 # y coord for each entry @item_max = 0 # max items to dispaly # draw the bitmap. the text will appear on this bitmap self.contents = Bitmap.new(width - 32, height+@journal_height) # populate your journal with entries. Each entry must match its switch number! @data = [] @data[1] = "Help Man" @data[2] = "Kill Chicken" @data[3] = "Make cow eat" for i in 1..3 if $game_switches[i] == true draw_item(i) @item_max += 1 end end end #-------------------------------------------------------------------------- # * Draw an individual item in the window # index : Index of the item to be drawn #--------------------------------------------------------------------------
def draw_item(index) item = @data[index] rect = Rect.new(10, @n, 640, 32) self.contents.fill_rect(rect, Color.new(0,0,0,0)) self.contents.draw_text(10, @n, 640, 32, "●", 0) self.contents.draw_text(25, @n, 640, 32, item, 0) @n += 32 end
end |
puis ajouter celui la au dessus de main en l'apelant "Scene_journal"
| Code: | #============================================================================== # ■ Scene_Status #------------------------------------------------------------------------------ # This class contains the windows for the character status menu that can be # accessed from the main menu. #==============================================================================
class Scene_Journal #-------------------------------------------------------------------------- # ● Initialize the Status menu #-------------------------------------------------------------------------- def main
@journal_window = Window_Journal.new @journal_window.x = 90 @journal_window.y = 70 Graphics.transition
loop do Graphics.update Input.update update if $scene != self break end end
Graphics.freeze @journal_window.dispose
end #-------------------------------------------------------------------------- # ● Draw the Status menu #-------------------------------------------------------------------------- def update @journal_window.update if @journal_window.active update_item return end end
#-------------------------------------------------------------------------- # ● Update menu after player makes a selection #-------------------------------------------------------------------------- def update_item # Cancel key pressed (go to menu) if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Menu.new(5) return end end end |
Pour appeller le script "$scene = Scene_Charactor.new" |
|
Korion Enchanteur


Nombre de messages: 168 Age: 20 Emploi/loisirs: lycéen fan de RPG Projet en Cours: Projet 1 Date d'inscription: 04/08/2007
 | Sujet: Re: Journal Dim 13 Jan - 1:00 | |
| pas mal, mais comment on fait pour l'utiliser ? je veux dire, comment on rajoute les évenements dedans ? |
|
KeyLad Inquisiteur


Nombre de messages: 365 Age: 17 Localisation: France, Isère Emploi/loisirs: Guitare, skate, ma copine Projet en Cours: Projet 1 Date d'inscription: 03/10/2007
 | Sujet: Re: Journal Dim 13 Jan - 2:18 | |
| Pas mal, je ne l'ai jamais trouvé ce script ^^ . Mais comme la si bien dit Korion, comment utilise-t-on ce script ? |
|
BaHaMuT Apprenti


Nombre de messages: 9 Age: 16 Emploi/loisirs: Making Projet en Cours: L'ile aux pirates ! Date d'inscription: 12/01/2008
 | Sujet: Re: Journal Dim 13 Jan - 5:53 | |
| Pour l'utiliser rien de plus simple regarder sur le script "Window_Journal" ce passage: | Code: | @data[1] = "Help Man" @data[2] = "Kill Chicken" @data[3] = "Make cow eat" |
@data["nombre de l'interrupteur"]="Description de l'interrupteur" -Exemple pour bien montrer ce que sa donne: @data["5"] = "Avoir parler au roi !" Maintenant des que l'interrupteur 5 sera activé "Avoir parler au roi !"sera ajouter dans le journal,et si l'interrupteur viens a etre desactivé la phrase se retire. |
|
Shive Empereur


Nombre de messages: 505 Age: 17 Localisation: Devant son ordi, avec ses potes et à la Réunion! Emploi/loisirs: Lycéen à plein temps Projet en Cours: Crisis, Within Rebellion Date d'inscription: 26/07/2007
 | Sujet: Re: Journal Lun 14 Jan - 15:28 | |
| Encore un super script. Pas sûr que je l'utilise maintenant. Merci bahamut! Cordialement, Shive _________________   |
|
alphonse Ecuyer

Nombre de messages: 2 Age: 17 Emploi/loisirs: jeux video, mangas Projet en Cours: Projet 1 : Rpg dragon blaster. Date d'inscription: 24/01/2010
 | Sujet: Re: Journal Dim 24 Jan - 22:47 | |
| Doc c'est un genre de journal des quêtes ? |
|