Heures au format UTC + 1 heure [ Heure d’été ]


Règles du forum


Consultez la liste des Scripts : cliquez ici



Publier un nouveau sujet Répondre au sujet  [ 4 messages ] 
Auteur Message
 Sujet du message: Script Ocarina
MessagePublié: 19 Mar 2008, 10:40 
Villageois (Nv 3)

Inscrit le: 11 Fév 2008, 01:00
Messages: 42
Points d'aide: 0/60

Créations :

Voir ses créations

Auteur: RENEGADEOFBMX(nahchito)

Que serait un jeu Zelda sans Ocarina?

Tout d'abord le mode d'emploi.

Créé une flèche pointant vers le haut du nom de "arrow" que vous allez mettre dans le dossier Picture.
Et Votre bouton "A" du nom de "a" qui lui aussi va ce trouvé dans le dossier Picture.
Mettre cette image:
Image à nommé pentagrama, dans Picture.

Là c'est là que ça commence à ce corsé:
Vous allez dans la Base de donnée dans l'onglet Évenement Commun.
Code: Tout sélectionner
Le premier: Nom=>Ocarina Déclenchement=>Appel
<>"Faire disparaître" la musique : 10 secondes
<>Interrupteur(s) [X] activé
<>Script : $scene = Ocarina.new

Le deuxième nom=>Ocarina_Songs Déclenchement=>Processus Parrallèle Interrupteur de déclenchement=>X
<>Condition : si l'interrupteur [Y:] est activé (Y est égal à l'interrupteur du chant dans le script)
  <>Mémoriser Musique (BGM) / Effet sonore (BGS)
  <>Jouer Exemple: un font musical (BGM) : '001-Battle01', volume : 100, tempo : 100
  <>Attendre 13 Frames
  <>Message : Exemple : Chant du temps à été joué!
  <>Déplacer l'évènement : Héros
  :                                    :<>Modifier vitesse : 6
  :                                    :<>Modifier Fréquence : 3
  <>Message : Vos déplacement sont maintenant accélèré.
  <>Attendre 40 Frames
  <>Jouer Musique (BGM) / Effet sonore (BGS) mémorisé(e)
  <>Interrupteur [Y:] désactivé
  <>Interrupteur [X:] désactivé
  <>Stopper tous les évènements
: Fin

Et pour finir faite en sorte que un objet ait : Appelle cet évènement commun :
001: Ocarina

Puis après créé un nouveau script au dessus de Main nommé "Ocarina Script" et collé y ceci:

_________________
Spiky


Haut
 Profil  
 
 Sujet du message: Re: Script Ocarina
MessagePublié: 19 Mar 2008, 10:46 
Villageois (Nv 3)

Inscrit le: 11 Fév 2008, 01:00
Messages: 42
Points d'aide: 0/60

Créations :

Voir ses créations

Code: Tout sélectionner
#Ocarina Script
#PAR: RENEGADEOFBMX(nahchito)
#Date:16-2-2008
#Version: 1.2
#Ajouts: 2 Chants
#Présentation des Notes
#Nouvelle version: Customisation des Notes
# Traduction en français par Spiky

## = Un ajout par Spiky
### = Comentaire ajouté par Spiky

class Game_System
  attr_reader :ocarina, :ocarina_down, :ocarina_right, :ocarina_up, :ocarina_left, :ocarina_a
  alias tsu_initialize initialize
  def initialize
    @ocarina = []

    @ocarina_down = "001-System01"###Mettre le son (SE) produit par l'apuis sur la touche BAS
    @ocarina_left = "002-System02"###Mettre le son (SE) produit par l'apuis sur la touche GAUCHE
    @ocarina_right = "003-System03"###Mettre le son (SE) produit par l'apuis sur la touche DROITE
    @ocarina_up = "004-System04"###Mettre le son (SE) produit par l'apuis sur la touche HAUT
    @ocarina_a = "005-System05" ##  ###Mettre le son (SE) produit par l'apuis sur la touche C, ESPACE ou ENTRÉ

    @ocarina[0] = []        ### NUMÉRO DU CHANT
    @ocarina[0][0] = 4   #NOTE 1
    @ocarina[0][1] = 4   #NOTE 2
    @ocarina[0][2] = 6   #NOTE 3
    @ocarina[0][3] = 6   #NOTE 4
    @ocarina[0][4] = 2   #NOTE 5
    @ocarina[0][5] = 2   #NOTE 6
    @ocarina[0][6] = "Bolero of fire"  #NOM DU CHANT, APPARAIT APRÈS LA PERFORMANCE.
    @ocarina[0][7] = Color.new(0, 255, 0) # OPACITÉE DES NOTES.
    @ocarina[0][8] = "116-Raise02" #SON (SE) QUAND VOUS RÉUSSISEZ LE CHANT.
    @ocarina[0][9] = 5 #SWITH QUI VA ÊTRE ACTIVÉE (ON).
   
    @ocarina[1] = []
    @ocarina[1][0] = 8
    @ocarina[1][1] = 2
    @ocarina[1][2] = 2
    @ocarina[1][3] = 8
    @ocarina[1][4] = 2
    @ocarina[1][5] = 2
    @ocarina[1][6] = "Song of war"
    @ocarina[1][7] = Color.new(255, 0, 0)
    @ocarina[1][8] = "116-Raise02"
    @ocarina[1][9] = 4
   
    @ocarina[2] = []
    @ocarina[2][0] = 6
    @ocarina[2][1] = 10
    @ocarina[2][2] = 2
    @ocarina[2][3] = 6
    @ocarina[2][4] = 10
    @ocarina[2][5] = 2
    @ocarina[2][6] = "Song of Time"
    @ocarina[2][7] = Color.new(255, 0, 0)
    @ocarina[2][8] = "115-Raise01"
    @ocarina[2][9] = 7
   
    @ocarina[3] = []
    @ocarina[3][0] = 10
    @ocarina[3][1] = 2
    @ocarina[3][2] = 8
    @ocarina[3][3] = 10
    @ocarina[3][4] = 2
    @ocarina[3][5] = 8
    @ocarina[3][6] = "Epona Song"
    @ocarina[3][7] = Color.new(255, 0, 0)
    @ocarina[3][8] = "115-Raise01"
    @ocarina[3][9] = 8
   
    @ocarina[4] = []
    @ocarina[4][0] = 4
    @ocarina[4][1] = 2
    @ocarina[4][2] = 4
    @ocarina[4][3] = 6
    @ocarina[4][4] = 2
    @ocarina[4][5] = 2
    @ocarina[4][6] = "Song of healing"
    @ocarina[4][7] = Color.new(255, 0, 0)
    @ocarina[4][8] = "116-Raise02"
    @ocarina[4][9] = 6
   
    tsu_initialize
  end
end

class Ocarina
  def main
    @spriteset = Spriteset_Map.new
    @ocarina_window = Window_Ocarina.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      @ocarina_window.update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @spriteset.dispose
    @ocarina_window.dispose
  end
end

class Window_Ocarina < Window_Base
  def initialize
    super(0, 280, 640, 80)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Arial"##AJOUT POUR VERSION FRANÇAISE
    self.contents.font.size = 24##AJOUT POUR VERSION FRANÇAISE
    self.opacity = 0
    @song = []
    @correct = false
    @counter = 0
    refresh
  end
  def refresh
    self.contents.clear
    @back = Sprite.new
    @back.bitmap = RPG::Cache.picture("pentagrama")###Modifié le nom de la portée.
    @back.x = 40
    @back.y = 360
    @back.opacity = 160
  end
  def update
    if @correct
      if @counter == 0
        self.contents.font.color = $game_system.ocarina[@i][7]
        self.contents.font.name = "Arial"##AJOUT POUR VERSION FRANÇAISE
        self.contents.font.size = 24##AJOUT POUR VERSION FRANÇAISE
        self.contents.draw_text(0, 0, 618, 48, $game_system.ocarina[@i][6], 1)
        Audio.se_play("Audio/SE/" + $game_system.ocarina[@i][8], 80, 100)
        @arrow1.opacity = 255
        @arrow2.opacity = 255
        @arrow3.opacity = 255
        @arrow4.opacity = 255
        @arrow5.opacity = 255
        @arrow6.opacity = 255
        $game_switches[$game_system.ocarina[@i][9]] = true
      end
      @counter += 1
      if @counter >= 200
        @back.dispose
        @back.bitmap.dispose
        @arrow1.dispose
        @arrow1.bitmap.dispose
        @arrow2.dispose
        @arrow2.bitmap.dispose
        @arrow3.dispose
        @arrow3.bitmap.dispose
        @arrow4.dispose
        @arrow4.bitmap.dispose
        @arrow5.dispose
        @arrow5.bitmap.dispose
        @arrow6.dispose
        @arrow6.bitmap.dispose
        $scene = Scene_Map.new
        $game_map.autoplay
        $game_map.refresh
      end
    else
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @back.dispose
      @back.bitmap.dispose
      if @arrow1 != nil
        @arrow1.dispose
        @arrow1.bitmap.dispose
      end
      if @arrow2 != nil
        @arrow2.dispose
        @arrow2.bitmap.dispose
      end
      if @arrow3 != nil
        @arrow3.dispose
        @arrow3.bitmap.dispose
      end
      if @arrow4 != nil
        @arrow4.dispose
        @arrow4.bitmap.dispose
      end
      if @arrow5 != nil
        @arrow5.dispose
        @arrow5.bitmap.dispose
      end
      if @arrow6 != nil
        @arrow6.dispose
        @arrow6.bitmap.dispose
      end
      $scene = Scene_Map.new
      $game_map.autoplay
      $game_map.refresh
    end

_________________
Spiky


Haut
 Profil  
 
 Sujet du message: Re: Script Ocarina
MessagePublié: 19 Mar 2008, 10:46 
Villageois (Nv 3)

Inscrit le: 11 Fév 2008, 01:00
Messages: 42
Points d'aide: 0/60

Créations :

Voir ses créations

Code: Tout sélectionner
if Input.trigger?(Input::DOWN)
      Audio.se_play("Audio/SE/" + $game_system.ocarina_down, 80, 100)
      @song.push(2)
      case @song.size
      when 1
        @arrow1 = Sprite.new
        @arrow1.bitmap = RPG::Cache.picture("arrow")
        @arrow1.angle = 180
        @arrow1.opacity = 160
        @arrow1.ox = @arrow1.bitmap.width / 2
        @arrow1.oy = @arrow1.bitmap.height / 2
        @arrow1.x = 160
        @arrow1.y = 430
      when 2
        @arrow2 = Sprite.new
        @arrow2.bitmap = RPG::Cache.picture("arrow")
        @arrow2.angle = 180
        @arrow2.opacity = 160
        @arrow2.ox = @arrow2.bitmap.width / 2
        @arrow2.oy = @arrow2.bitmap.height / 2
        @arrow2.x = 240
        @arrow2.y = 430
      when 3
        @arrow3 = Sprite.new
        @arrow3.bitmap = RPG::Cache.picture("arrow")
        @arrow3.angle = 180
        @arrow3.opacity = 160
        @arrow3.ox = @arrow3.bitmap.width / 2
        @arrow3.oy = @arrow3.bitmap.height / 2
        @arrow3.x = 320
        @arrow3.y = 430
      when 4
        @arrow4 = Sprite.new
        @arrow4.bitmap = RPG::Cache.picture("arrow")
        @arrow4.angle = 180
        @arrow4.opacity = 160
        @arrow4.ox = @arrow4.bitmap.width / 2
        @arrow4.oy = @arrow4.bitmap.height / 2
        @arrow4.x = 400
        @arrow4.y = 430
      when 5
        @arrow5 = Sprite.new
        @arrow5.bitmap = RPG::Cache.picture("arrow")
        @arrow5.angle = 180
        @arrow5.opacity = 160
        @arrow5.ox = @arrow5.bitmap.width / 2
        @arrow5.oy = @arrow5.bitmap.height / 2
        @arrow5.x = 480
        @arrow5.y = 430
      when 6
        @arrow6 = Sprite.new
        @arrow6.bitmap = RPG::Cache.picture("arrow")
        @arrow6.angle = 180
        @arrow6.opacity = 160
        @arrow6.ox = @arrow6.bitmap.width / 2
        @arrow6.oy = @arrow6.bitmap.height / 2
        @arrow6.x = 560
        @arrow6.y = 430
      end
    end
    if Input.trigger?(Input::LEFT)
      Audio.se_play("Audio/SE/" + $game_system.ocarina_left, 80, 100)
      @song.push(4)
      case @song.size
      when 1
        @arrow1 = Sprite.new
        @arrow1.bitmap = RPG::Cache.picture("arrow")
        @arrow1.angle = 90
        @arrow1.opacity = 160
        @arrow1.ox = @arrow1.bitmap.width / 2
        @arrow1.oy = @arrow1.bitmap.height / 2
        @arrow1.x = 160
        @arrow1.y = 400
      when 2
        @arrow2 = Sprite.new
        @arrow2.bitmap = RPG::Cache.picture("arrow")
        @arrow2.angle = 90
        @arrow2.opacity = 160
        @arrow2.ox = @arrow2.bitmap.width / 2
        @arrow2.oy = @arrow2.bitmap.height / 2
        @arrow2.x = 240
        @arrow2.y = 400
      when 3
        @arrow3 = Sprite.new
        @arrow3.bitmap = RPG::Cache.picture("arrow")
        @arrow3.angle = 90
        @arrow3.opacity = 160
        @arrow3.ox = @arrow3.bitmap.width / 2
        @arrow3.oy = @arrow3.bitmap.height / 2
        @arrow3.x = 320
        @arrow3.y = 400
      when 4
        @arrow4 = Sprite.new
        @arrow4.bitmap = RPG::Cache.picture("arrow")
        @arrow4.angle = 90
        @arrow4.opacity = 160
        @arrow4.ox = @arrow4.bitmap.width / 2
        @arrow4.oy = @arrow4.bitmap.height / 2
        @arrow4.x = 400
        @arrow4.y = 400
      when 5
        @arrow5 = Sprite.new
        @arrow5.bitmap = RPG::Cache.picture("arrow")
        @arrow5.angle = 90
        @arrow5.opacity = 160
        @arrow5.ox = @arrow5.bitmap.width / 2
        @arrow5.oy = @arrow5.bitmap.height / 2
        @arrow5.x = 480
        @arrow5.y = 400
      when 6
        @arrow6 = Sprite.new
        @arrow6.bitmap = RPG::Cache.picture("arrow")
        @arrow6.angle = 90
        @arrow6.opacity = 160
        @arrow6.ox = @arrow6.bitmap.width / 2
        @arrow6.oy = @arrow6.bitmap.height / 2
        @arrow6.x = 560
        @arrow6.y = 400
      end
    end
    if Input.trigger?(Input::RIGHT)
      Audio.se_play("Audio/SE/" + $game_system.ocarina_right, 80, 100)
      @song.push(6)
      case @song.size
      when 1
        @arrow1 = Sprite.new
        @arrow1.bitmap = RPG::Cache.picture("arrow")
        @arrow1.angle = 270
        @arrow1.opacity = 160
        @arrow1.ox = @arrow1.bitmap.width / 2
        @arrow1.oy = @arrow1.bitmap.height / 2
        @arrow1.x = 160
        @arrow1.y = 410
      when 2
        @arrow2 = Sprite.new
        @arrow2.bitmap = RPG::Cache.picture("arrow")
        @arrow2.angle = 270
        @arrow2.opacity = 160
        @arrow2.ox = @arrow2.bitmap.width / 2
        @arrow2.oy = @arrow2.bitmap.height / 2
        @arrow2.x = 240
        @arrow2.y = 410
      when 3
        @arrow3 = Sprite.new
        @arrow3.bitmap = RPG::Cache.picture("arrow")
        @arrow3.angle = 270
        @arrow3.opacity = 160
        @arrow3.ox = @arrow3.bitmap.width / 2
        @arrow3.oy = @arrow3.bitmap.height / 2
        @arrow3.x = 320
        @arrow3.y = 410
      when 4
        @arrow4 = Sprite.new
        @arrow4.bitmap = RPG::Cache.picture("arrow")
        @arrow4.angle = 270
        @arrow4.opacity = 160
        @arrow4.ox = @arrow4.bitmap.width / 2
        @arrow4.oy = @arrow4.bitmap.height / 2
        @arrow4.x = 400
        @arrow4.y = 410
      when 5
        @arrow5 = Sprite.new
        @arrow5.bitmap = RPG::Cache.picture("arrow")
        @arrow5.angle = 270
        @arrow5.opacity = 160
        @arrow5.ox = @arrow5.bitmap.width / 2
        @arrow5.oy = @arrow5.bitmap.height / 2
        @arrow5.x = 480
        @arrow5.y = 410
      when 6
        @arrow6 = Sprite.new
        @arrow6.bitmap = RPG::Cache.picture("arrow")
        @arrow6.angle = 270
        @arrow6.opacity = 160
        @arrow6.ox = @arrow6.bitmap.width / 2
        @arrow6.oy = @arrow6.bitmap.height / 2
        @arrow6.x = 560
        @arrow6.y = 410
      end
    end
    if Input.trigger?(Input::UP)
      Audio.se_play("Audio/SE/" + $game_system.ocarina_up, 80, 100)
      @song.push(8)
      case @song.size
      when 1
        @arrow1 = Sprite.new
        @arrow1.bitmap = RPG::Cache.picture("arrow")
        @arrow1.opacity = 160
        @arrow1.ox = @arrow1.bitmap.width / 2
        @arrow1.oy = @arrow1.bitmap.height / 2
        @arrow1.x = 160
        @arrow1.y = 380
      when 2
        @arrow2 = Sprite.new
        @arrow2.bitmap = RPG::Cache.picture("arrow")
        @arrow2.opacity = 160
        @arrow2.ox = @arrow2.bitmap.width / 2
        @arrow2.oy = @arrow2.bitmap.height / 2
        @arrow2.x = 240
        @arrow2.y = 380
      when 3
        @arrow3 = Sprite.new
        @arrow3.bitmap = RPG::Cache.picture("arrow")
        @arrow3.opacity = 160
        @arrow3.ox = @arrow3.bitmap.width / 2
        @arrow3.oy = @arrow3.bitmap.height / 2
        @arrow3.x = 320
        @arrow3.y = 380
      when 4
        @arrow4 = Sprite.new
        @arrow4.bitmap = RPG::Cache.picture("arrow")
        @arrow4.opacity = 160
        @arrow4.ox = @arrow4.bitmap.width / 2
        @arrow4.oy = @arrow4.bitmap.height / 2
        @arrow4.x = 400
        @arrow4.y = 380
      when 5
        @arrow5 = Sprite.new
        @arrow5.bitmap = RPG::Cache.picture("arrow")
        @arrow5.opacity = 160
        @arrow5.ox = @arrow5.bitmap.width / 2
        @arrow5.oy = @arrow5.bitmap.height / 2
        @arrow5.x = 480
        @arrow5.y = 380
      when 6
        @arrow6 = Sprite.new
        @arrow6.bitmap = RPG::Cache.picture("arrow")
        @arrow6.opacity = 160
        @arrow6.ox = @arrow6.bitmap.width / 2
        @arrow6.oy = @arrow6.bitmap.height / 2
        @arrow6.x = 560
        @arrow6.y = 380
      end
    end
    if Input.trigger?(Input::C)## AJOUT DU BOUTON (A).
      Audio.se_play("Audio/SE/" + $game_system.ocarina_a, 80, 100)
      @song.push(10)
      case @song.size
      when 1
        @arrow1 = Sprite.new
        @arrow1.bitmap = RPG::Cache.picture("arrow")
        @arrow1.angle = 270
        @arrow1.opacity = 160
        @arrow1.ox = @arrow1.bitmap.width / 2
        @arrow1.oy = @arrow1.bitmap.height / 2
        @arrow1.x = 160
        @arrow1.y = 440
      when 2
        @arrow2 = Sprite.new
        @arrow2.bitmap = RPG::Cache.picture("a")
        @arrow2.opacity = 160
        @arrow2.ox = @arrow2.bitmap.width / 2
        @arrow2.oy = @arrow2.bitmap.height / 2
        @arrow2.x = 240
        @arrow2.y = 440
      when 3
        @arrow3 = Sprite.new
        @arrow3.bitmap = RPG::Cache.picture("a")
        @arrow3.opacity = 160
        @arrow3.ox = @arrow3.bitmap.width / 2
        @arrow3.oy = @arrow3.bitmap.height / 2
        @arrow3.x = 320
        @arrow3.y = 440
      when 4
        @arrow4 = Sprite.new
        @arrow4.bitmap = RPG::Cache.picture("a")
        @arrow4.opacity = 160
        @arrow4.ox = @arrow4.bitmap.width / 2
        @arrow4.oy = @arrow4.bitmap.height / 2
        @arrow4.x = 400
        @arrow4.y = 440
      when 5
        @arrow5 = Sprite.new
        @arrow5.bitmap = RPG::Cache.picture("a")
        @arrow5.opacity = 160
        @arrow5.ox = @arrow5.bitmap.width / 2
        @arrow5.oy = @arrow5.bitmap.height / 2
        @arrow5.x = 480
        @arrow5.y = 440
      when 6
        @arrow6 = Sprite.new
        @arrow6.bitmap = RPG::Cache.picture("a")
        @arrow6.opacity = 160
        @arrow6.ox = @arrow6.bitmap.width / 2
        @arrow6.oy = @arrow6.bitmap.height / 2
        @arrow6.x = 560
        @arrow6.y = 440
      end
    end
    if @song.size >= 6
      for @i in 0...$game_system.ocarina.size
        if @song[0] == $game_system.ocarina[@i][0] &&
          @song[1] == $game_system.ocarina[@i][1] &&
          @song[2] == $game_system.ocarina[@i][2] &&
          @song[3] == $game_system.ocarina[@i][3] &&
          @song[4] == $game_system.ocarina[@i][4] &&
          @song[5] == $game_system.ocarina[@i][5]
          @correct = true
          break
        end
      end
    end
      if @song.size >= 6 && @correct == false
        @counter += 1
        if @counter >= 40
          @back.dispose
          @back.bitmap.dispose
          @arrow1.dispose
          @arrow1.bitmap.dispose
          @arrow2.dispose
          @arrow2.bitmap.dispose
          @arrow3.dispose
          @arrow3.bitmap.dispose
          @arrow4.dispose
          @arrow4.bitmap.dispose
          @arrow5.dispose
          @arrow5.bitmap.dispose
          @arrow6.dispose
          @arrow6.bitmap.dispose
          $scene = Scene_Map.new
        end
      end
    end
  end
end

_________________
Spiky


Haut
 Profil  
 
 Sujet du message: Re: Script Ocarina
MessagePublié: 17 Mar 2009, 21:23 
Villageois (Nv 4)

Inscrit le: 25 Juil 2007, 00:00
Messages: 68
Points d'aide: 0/60

Créations :

Voir ses créations

C'est super... A part que j'ai quelque bugs.

1) Si ma mélodie commencre par 10 (donc A) il m'affiche 6 (flèche vers la droite)

2) Quand on rempli la totalité de la partition, donc qu'on ne sait plus rajuter de notes, ce serait bien d'afficher un sons d'erreur si la mélodie tapée n'existe pas et de permettre de recommancer directement.

3) Dans la même optique, en pressant une touche (B sur N64) on devrait pouvoir recommancer à etrer une mélodie.


Haut
 Profil  
 
Afficher les messages depuis:  Trier par  
Publier un nouveau sujet Répondre au sujet  [ 4 messages ] 

Heures au format UTC + 1 heure [ Heure d’été ]


Qui est en ligne ?

Utilisateurs parcourant actuellement ce forum : Aucun utilisateur inscrit et 3 invités


Vous ne pouvez pas publier de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas insérer de pièces jointes dans ce forum

Rechercher pour:
Sauter vers:  
cron
RPG Creative Forum version 5 ; Tous droits réservés
phpBB Group (Traduit par Xaphos)
Optimisé pour une résolution 1024*728