re00be Vagabond
Aide à la vie du forum : Messages : 8 Mapping : Base de donnée : Graphiste : Eventmaker : Scénariste : Scripteur : Date d'inscription : 19/06/2009
| Sujet: Press Start v.02 Ven 19 Juin - 16:54 | |
| Bonjour, je poste mon script ici car il n'y a pas de rubrique pour les script sur la page d'accueil, d'ailleurs je recommande aux admins d'en mettre un, car c'est vraiment pratique. Ceci est une amélioration par rapport au premier script "press start" que j'avais créé il y a quelques jours. Dans l'ancienne version, il y avait un bug qui affichait l'image choisie pour l'écran titre, au début des combats, ce qui n'est plus présent dans cette version. Je vous laisse apprécier mon travail: "Press Start" avant l'écran titre
Créateur : moi, Re00be Ressources nécessaires : Title.png (image de l'écran titre) Screen:- Spoiler:
Explications:Permet d'afficher une fenetre "appuyez sur entrer" juste avant l'écran titre Testé et fonctionnelDémonstration : A Venir script: - Code:
-
#------------------------------------------------------------------------ # Afficher "Appuyez sur Entrer" avant l'écran titre # script créé par Re00be #------------------------------------------------------------------------ class Scene_titre< Scene_Base def start super create_title_graphic create_command_window play_title_music $data_system = load_data("Data/System.rvdata") end
def create_command_window s1 = "Appuyez sur Entrer" #changez le texte comme vous le voulez @command_window = Window_Command.new(172, [s1]) @command_window.x = (544 - @command_window.width) / 2 #emplacement de la fenetre - coordonnée x @command_window.y = 288 #emplacement de la fenetre - coordonnée y @command_window.openness = 0 @command_window.open end def update super @command_window.update if Input.trigger?(Input::C) case @command_window.index when 0 $scene = Scene_title_re00be.new end end end def perform_transition Graphics.transition(20) end
def post_start super open_command_window end
def pre_terminate super close_command_window end
def terminate super dispose_command_window end
def create_title_graphic @sprite = Sprite.new @sprite.bitmap = Cache.system("Title") #nom de l'image de fond(dans le dossier system) end
def dispose_title_graphic @sprite.bitmap.dispose @sprite.dispose end
def dispose_command_window @command_window.dispose end
def open_command_window @command_window.open begin @command_window.update Graphics.update end until @command_window.openness == 255 end
def close_command_window @command_window.close begin @command_window.update Graphics.update end until @command_window.openness == 0 end
def play_title_music Audio.bgm_play("Audio/BGM/Scene2.mid",150,100) #emplacement de la musique de fond RPG::BGS.stop RPG::ME.stop end def command_shutdown Sound.play_decision RPG::BGM.fade(800) RPG::BGS.fade(800) RPG::ME.fade(800) $scene = nil end
end #============================================================================== # ** Scene_Title #==============================================================================
class Scene_title_re00be < Scene_Base #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main if $BTEST # If battle test battle_test # Start battle test else # If normal play super # Usual main processing end end #-------------------------------------------------------------------------- # * Start processing #-------------------------------------------------------------------------- def start super load_database # Load database create_game_objects # Create game objects check_continue # Determine if continue is enabled create_title_graphic # Create title graphic create_command_window # Create command window play_title_music # Play title screen music end #-------------------------------------------------------------------------- # * Execute Transition #-------------------------------------------------------------------------- def perform_transition Graphics.transition(20) end #-------------------------------------------------------------------------- # * Post-Start Processing #-------------------------------------------------------------------------- def post_start super open_command_window end #-------------------------------------------------------------------------- # * Pre-termination Processing #-------------------------------------------------------------------------- def pre_terminate super close_command_window end #-------------------------------------------------------------------------- # * Termination Processing #-------------------------------------------------------------------------- def terminate super dispose_command_window snapshot_for_background dispose_title_graphic end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super @command_window.update if Input.trigger?(Input::C) case @command_window.index when 0 #New game command_new_game when 1 # Continue command_continue when 2 # Shutdown command_shutdown end elsif Input.trigger?(Input::B) $scene = Scene_titre.new end end #-------------------------------------------------------------------------- # * Load Database #-------------------------------------------------------------------------- def load_database $data_actors = load_data("Data/Actors.rvdata") $data_classes = load_data("Data/Classes.rvdata") $data_skills = load_data("Data/Skills.rvdata") $data_items = load_data("Data/Items.rvdata") $data_weapons = load_data("Data/Weapons.rvdata") $data_armors = load_data("Data/Armors.rvdata") $data_enemies = load_data("Data/Enemies.rvdata") $data_troops = load_data("Data/Troops.rvdata") $data_states = load_data("Data/States.rvdata") $data_animations = load_data("Data/Animations.rvdata") $data_common_events = load_data("Data/CommonEvents.rvdata") $data_system = load_data("Data/System.rvdata") $data_areas = load_data("Data/Areas.rvdata") end #-------------------------------------------------------------------------- # * Load Battle Test Database #-------------------------------------------------------------------------- def load_bt_database $data_actors = load_data("Data/BT_Actors.rvdata") $data_classes = load_data("Data/BT_Classes.rvdata") $data_skills = load_data("Data/BT_Skills.rvdata") $data_items = load_data("Data/BT_Items.rvdata") $data_weapons = load_data("Data/BT_Weapons.rvdata") $data_armors = load_data("Data/BT_Armors.rvdata") $data_enemies = load_data("Data/BT_Enemies.rvdata") $data_troops = load_data("Data/BT_Troops.rvdata") $data_states = load_data("Data/BT_States.rvdata") $data_animations = load_data("Data/BT_Animations.rvdata") $data_common_events = load_data("Data/BT_CommonEvents.rvdata") $data_system = load_data("Data/BT_System.rvdata") end #-------------------------------------------------------------------------- # * Create Game Objects #-------------------------------------------------------------------------- def create_game_objects $game_temp = Game_Temp.new $game_message = Game_Message.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new end #-------------------------------------------------------------------------- # * Determine if Continue is Enabled #-------------------------------------------------------------------------- def check_continue @continue_enabled = (Dir.glob('Save*.rvdata').size > 0) end #-------------------------------------------------------------------------- # * Create Title Graphic #-------------------------------------------------------------------------- def create_title_graphic @sprite = Sprite.new @sprite.bitmap = Cache.system("Title") end #-------------------------------------------------------------------------- # * Dispose of Title Graphic #-------------------------------------------------------------------------- def dispose_title_graphic @sprite.bitmap.dispose @sprite.dispose end #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_command_window s1 = Vocab::new_game s2 = Vocab::continue s3 = Vocab::shutdown @command_window = Window_Command.new(172, [s1, s2, s3]) @command_window.x = (544 - @command_window.width) / 2 @command_window.y = 288 if @continue_enabled # If continue is enabled @command_window.index = 1 # Move cursor over command else # If disabled @command_window.draw_item(1, false) # Make command semi-transparent end @command_window.openness = 0 @command_window.open end #-------------------------------------------------------------------------- # * Dispose of Command Window #-------------------------------------------------------------------------- def dispose_command_window @command_window.dispose end #-------------------------------------------------------------------------- # * Open Command Window #-------------------------------------------------------------------------- def open_command_window @command_window.open begin @command_window.update Graphics.update end until @command_window.openness == 255 end #-------------------------------------------------------------------------- # * Close Command Window #-------------------------------------------------------------------------- def close_command_window @command_window.close begin @command_window.update Graphics.update end until @command_window.openness == 0 end #-------------------------------------------------------------------------- # * Play Title Screen Music #-------------------------------------------------------------------------- def play_title_music $data_system.title_bgm.play RPG::BGS.stop RPG::ME.stop end #-------------------------------------------------------------------------- # * Check Player Start Location Existence #-------------------------------------------------------------------------- def confirm_player_location if $data_system.start_map_id == 0 print "Player start location not set." exit end end #-------------------------------------------------------------------------- # * Command: New Game #-------------------------------------------------------------------------- def command_new_game confirm_player_location Sound.play_decision $game_party.setup_starting_members # Initial party $game_map.setup($data_system.start_map_id) # Initial map position $game_player.moveto($data_system.start_x, $data_system.start_y) $game_player.refresh $scene = Scene_Map.new RPG::BGM.fade(1500) close_command_window Graphics.fadeout(60) Graphics.wait(40) Graphics.frame_count = 0 RPG::BGM.stop $game_map.autoplay end #-------------------------------------------------------------------------- # * Command: Continue #-------------------------------------------------------------------------- def command_continue if @continue_enabled Sound.play_decision $scene = Scene_File.new(false, true, false) else Sound.play_buzzer end end #-------------------------------------------------------------------------- # * Command: Shutdown #-------------------------------------------------------------------------- def command_shutdown Sound.play_decision RPG::BGM.fade(800) RPG::BGS.fade(800) RPG::ME.fade(800) $scene = nil end #-------------------------------------------------------------------------- # * Battle Test #-------------------------------------------------------------------------- def battle_test load_bt_database # Load battle test database create_game_objects # Create game objects Graphics.frame_count = 0 # Initialize play time $game_party.setup_battle_test_members $game_troop.setup($data_system.test_troop_id) $game_troop.can_escape = true $game_system.battle_bgm.play snapshot_for_background $scene = Scene_Battle.new end end
Utilisation : Placez le script au dessus de Main, puis Remplacer la ligne 14 de Main où il est censé être écrit ça: - Code:
-
$scene = Scene_Title.new Par cette ligne: - Code:
-
$scene = Scene_titre.new Rendez-vous à la ligne 18, entre les parenthèses, mettez le texte que vous voulez afficher. Lignes 20-21, coordonnées de la fenetre (x et y) Ligne 110, nom de la musique de fond (mettez le chemin où elle est depuis le dossier de votre projet). Note: Ne modifiez pas le nom de l'image de fond à la ligne 69, car cela va entrainer le même bug que dans la version1. Pour changer l'image de fond, mettez tout simplement l'image souhaitée dans le dossier system de votre projet et nomez-la "title.png" Tout est marqué dans le script! Bon making =) Re00be | |
|
Nano Admin
Aide à la vie du forum : Messages : 29 Age : 29 Distinction : Membre le plus actif Mapping : Base de donnée : Graphiste : Eventmaker : Scénariste : Scripteur : Date d'inscription : 11/05/2009
| Sujet: Re: Press Start v.02 Mer 24 Juin - 19:25 | |
| Bon script! Il est de toi? - Citation :
- il n'y a pas de rubrique pour les script sur la page d'accueil
Que veux-tu dire par là? | |
|
re00be Vagabond
Aide à la vie du forum : Messages : 8 Mapping : Base de donnée : Graphiste : Eventmaker : Scénariste : Scripteur : Date d'inscription : 19/06/2009
| Sujet: Re: Press Start v.02 Mer 24 Juin - 19:27 | |
| Oui ce script est de moi.
eh bien en fait je n'ai pas trouvé de rubrique où mettre mon script, donc je l'ai mis dans les "tutoriels" de script | |
|
Nano Admin
Aide à la vie du forum : Messages : 29 Age : 29 Distinction : Membre le plus actif Mapping : Base de donnée : Graphiste : Eventmaker : Scénariste : Scripteur : Date d'inscription : 11/05/2009
| Sujet: Re: Press Start v.02 Mer 24 Juin - 19:48 | |
| Ben oui, c'est là qu'il fallait le mettre. Pensais-tu à un rubrique que l'on peut voir SUR le menu? | |
|
re00be Vagabond
Aide à la vie du forum : Messages : 8 Mapping : Base de donnée : Graphiste : Eventmaker : Scénariste : Scripteur : Date d'inscription : 19/06/2009
| Sujet: Re: Press Start v.02 Mer 24 Juin - 20:15 | |
| Oui, je pensais à une rubrique visible comme "tutoriels" sur la page d'accueil, comme sur le forum rpg maker vx de fabY... | |
|
Contenu sponsorisé
| Sujet: Re: Press Start v.02 | |
| |
|