AccueilFAQRechercherS’enregistrerConnexion
 

Journal

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
BaHaMuT
Apprenti
Apprenti


Sexe:Masculin
Age : 15
Inscrit le : 12 Jan 2008
Messages : 9
Emploi/loisirs : Making
Projet en Cours : L'ile aux pirates !

MessageSujet: 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"
Revenir en haut Aller en bas
Korion
Enchanteur
Enchanteur


Sexe:Masculin
Age : 18
Inscrit le : 04 Aoû 2007
Messages : 168
Emploi/loisirs : lycéen fan de RPG

MessageSujet: 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 ?
Revenir en haut Aller en bas
KeyLad
Inquisiteur
Inquisiteur


Sexe:Masculin
Age : 16
Inscrit le : 03 Oct 2007
Messages : 364
Localisation : France, Isère
Emploi/loisirs : Guitare, skate, ma copine
Projet en Cours : Projet 1

MessageSujet: 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 ?
_________________
- Lisez les règles
- Faite de la pub
Revenir en haut Aller en bas
BaHaMuT
Apprenti
Apprenti


Sexe:Masculin
Age : 15
Inscrit le : 12 Jan 2008
Messages : 9
Emploi/loisirs : Making
Projet en Cours : L'ile aux pirates !

MessageSujet: 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.
Revenir en haut Aller en bas
Shive
Empereur
Empereur


Sexe:Masculin
Age : 16
Inscrit le : 26 Juil 2007
Messages : 505
Localisation : Devant son ordi, avec ses potes et à la Réunion!
Emploi/loisirs : Lycéen à plein temps
Projet en Cours : Crisis, Within Rebellion

MessageSujet: Re: Journal   Lun 14 Jan - 15:28

Encore un super script. Pas sûr que je l'utilise maintenant. Merci bahamut!

Cordialement, Shive
_________________

Revenir en haut Aller en bas

Journal

Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPG Sunrise :: Alchimisterie :: Scripts :: Scripts Libres-