-40%
Le deal à ne pas rater :
-40% sur le Pack Gaming Mario PDP Manette filaire + Casque filaire ...
29.99 € 49.99 €
Voir le deal

Aller en bas
Spytje
Spytje
Administrateur

Nombre de messages : 5935
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008

Balloon Popup SE Empty Balloon Popup SE

Dim 25 Oct 2015 - 13:07
Balloon Popup SE
                                                                                     

Introduction

Ce plugin permet de jouer un SE (son) lors de l'affichage d'un balloon


Paramètres

Il est possible de changer le son, le volume ainsi que la vitesse de lecture.

4 commandes sont également présentent pour changer des paramètres en jeu.



  • BalpopSE name              Vous permet de changer le son joué.Allows you to change the popup SE to another SE.


  • BalpopVol number           Vous permet de changer la valeur du son par une autre valeur (volume)another value.


  • BalpopPitch number        Vous permet de changer la vitesse de lecture.


  • BalpopDefault                Reset des valeurs et les met les valeurs par défaut.



Utilisation

Ajoutez le plugin et nommez le Jtanooki_PopupSE.js ensuite il ne reste plus qu'à paramétrer les différentes valeurs.


Le code

Code:
//=============================================================================
// Balloon Popup SE
// Jtanooki_PopupSE.js
// Version: 1.00
// No credit required, can be used commercially or non commercially.
//=============================================================================
/*:
 * @plugindesc Plays a Sound Effect when you use the Show Balloon Icon command in an event.
 * @author Jtanooki
 * @version 1.0
 *
 * @param Name
 * @desc Filname of the SE for the balloon popup.
 * Default: Jump1
 * @default Jump1

 * @param Volume
 * @desc Volume of SE for the balloon popup.
 * Default: 75
 * @default 75

 * @param Pitch
 * @desc Pitch of SE for the balloon popup.
 * Default: 100
 * @default 100
 *
 *@help This script has a couple of Plugin Commands that allow you to change the
 *settings of the script Mid-game.
 *======================================================================================
 *                                   Plugin Commands
 *======================================================================================
 *      BalpopSE Jump1                 This command changes the default popup
 *                                     SE sound to "Jump 1"
 *
 *      BalpopVol 80                   This command changes the default
 *                                     SE Volume to 80
 *
 *      BalopopPitch 120               This command changes the default
 *                                     SE Pitch to 120
 *      
 *      BalpopDefault                  Resets all of the parameters back to their
 *                                     default values
 */

(function() {

//Initializing variables to parameter values
var parameters = PluginManager.parameters('Jtanooki_PopupSE');
var name = String(parameters['Name']);
var volume = Number(parameters['Volume'] || 75);
var pitch = Number(parameters['Pitch'] || 100);

//Plugin Commands//
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;

    Game_Interpreter.prototype.pluginCommand = function(command, args) {
        _Game_Interpreter_pluginCommand.call(this, command, args);
         if (command === 'BalpopSe') name = args;
         if (command === 'BalpopVol') volume = args;
         if (command === 'BalpopPitch') pitch = args;
         if (command === 'BalpopDefault')
         {
            name = String(parameters['Name']);
            volume = Number(parameters['Volume'] || 75);
            pitch = Number(parameters['Pitch'] || 100);
         }
    };
//Override Start Balloon Function
var _Sprite_Character_start_Balloon = Sprite_Character.prototype.startBalloon;

Sprite_Character.prototype.startBalloon = function() {
        _Sprite_Character_start_Balloon.call(this);
        var audio = {};
        audio.name = name;
        audio.pitch = pitch;
        audio.volume = volume;
        audio.pan = 0;
        AudioManager.playSe(audio);
};

})();

Auteur

Jtanooki

...
Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum