Poulet Lv.1
Inscrit le : 14/08/2011 Messages : 6
| Sujet: Fusion de script d'écran titre (carte+appuyez sur start+ecran titre animé) Ven 19 Aoû 2011 - 3:03 | |
| Bonjour, pour mon projet je voulait un écran titre qui fusionne: -l'envoi sur une carte au démarrage du jeux, -appuyez sur start -et l'écran titre animé de miria. comme j'ai eu beaucoup de mal à trouver la solution, je fait partager ma découverte à ceux qui cherche à avoir ces trois fonctions. /!\ attention le script de l'écran titre de mira utilisé est la version 2 la différence est que les images utilisé pour new game, ect... sons reunie en une seule image /!\Voici l'image : ou sinon la démo complète avec toute les ressources : http://www.atelier-rgss.com/RGSS/Menu/VX_Menu04.html Tout d'abord il faut remplacer main par : - Code:
-
#============================================================================== # ** Main #------------------------------------------------------------------------------ # After defining each class, actual processing begins here. #============================================================================== #----------------------------------------------------------------------------------------------------------------------------------------- # Backup de Main Original #----------------------------------------------------------------------------------------------------------------------------------------- #begin # Graphics.freeze # $scene = Scene_Title.new # $scene.main while $scene != nil # Graphics.transition(30) #rescue Errno::ENOENT # filename = $!.message.sub("No such file or directory - ", "") # print("Unable to find file #{filename}.") #end #----------------------------------------------------------------------------------------------------------------------------------------- unless Font.exist?("UmePlus Gothic") print "Le fichier Font 'UmePlus Gothic' n'a pas été trouvé" exit end
begin #Lancement du jeu Graphics.freeze $scene = (Game::ACTIVATE_SWITCH_TITLE) ? Switch_Title.new : Scene_Title.new $scene.main while $scene != nil Graphics.transition(30) rescue Errno::ENOENT filename = $!.message.sub("No such file or directory - ", "") print("Le ficher #{filename} n'a pas été trouvé.") end Ensuite installez ces 3 scripts dans " materials" 1) "switch ecran titre" qui renvoi sur une carte (merci a l'auteur de ce script : https://rpg-maker-vx.bbactif.com/t12619-skip_title) - Code:
-
module Game ACTIVATE_SWITCH_TITLE = true #Active le switch de l'écran titre TITLE_DATA = [2, 19, 14] #Constantes qui défini la map qui sers d'écran titre [MAP_ID, X, Y] def self.teleport(map_id, x, y, transition = true) $game_map.setup(map_id) $game_player.moveto(x, y) $scene = Scene_Map.new $game_map.autoplay $game_player.refresh if transition RPG::BGM.fade(1500) Graphics.fadeout(60) Graphics.wait(40) end end #Teleport vers la position de départ def self.goto_start(transition = true) Game::teleport($data_system.start_map_id,$data_system.start_x, $data_system.start_y, transition) end end
class Switch_Title < Scene_Base def start super map_title = Game::TITLE_DATA load_database create_game_objects #Condition de sortie si jamais la position n'est pas spécifiée if $data_system.start_map_id == 0 print "Player start location not set." exit end $game_party.setup_starting_members $game_map.setup(map_title[0]) $game_player.moveto(map_title[1], map_title[2]) $game_player.refresh $scene = Scene_Map.new $game_map.autoplay end 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 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 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 def battle_test load_bt_database create_game_objects Graphics.frame_count = 0 $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
maintenant le script "appuyez sur start" au dessus du premier (merci à Miget man12's pour le script, Guyver's Bane & Night5h4d3 pour les modifications) : - Code:
-
#------------------------------------------------------------------------------- # Start Screen VX V.2.5 # (Created from Miget man12's More-than-usually Graphical Title) # Last update : 2010/5/05 # Edited by Guyver's Bane # And support given by Night5h4d3 for Battle Test problem.(resolved now) # Credit goes to Miget man12 for the script this was made from. # I take credit only in editing his original work. #==============================================================================# # This script allows you to have a Start screen upon playing # #==============================================================================# #------------------------------------------------------------------------------# # Installation: Place above "Main". Basically it's pulg'n play. # #------------------------------------------------------------------------------# #==============================================================================# # Customization # #==============================================================================# module GB # The Number of COMMAND_ACTION, COMMAND_X and COMMAND_Y variables MUST be at # least as much as the number of COMMAND_TEXT variables!! (You can have more # than COMMAND_TEXT; it won't affect anything) # The text drawn on the title screen COMMAND_TEXT = [] # Leave alone! COMMAND_TEXT[0] = "Appuyez sur start" COMMAND_ACTION = [] # Leave alone! COMMAND_ACTION[0] = "$scene = Scene_Title.new" # ["Times New Roman", "Verdana", "Arial", "Courier New"] # **the name MUST be in quotes!** COMMAND_FONT = ["Brush Script Std", "Brush Script Std"] # Size of Command Text COMMAND_TEXT_SIZE = 37 COMMAND_SHADOW = false COMMAND_BOLD = false COMMAND_ITALIC = false # Colors go like so: # Color.new(red,green,blue[,transparency]) # Each color level ranges from 0 to 255 # All 255 is white # All 0 is black # Transparency can be left out! If it is, it will be automatically set to 255 # Color of Command Text when not selected COMMAND_COLOR_NOT = Color.new(255,255,255) # Color Command Text flashes when selected COMMAND_COLOR_YES = Color.new(74,89,112) COMMAND_X = [] # Leave alone! COMMAND_Y = [] # Leave alone! # X position of Start Text COMMAND_X[0] = 175 # Y position of Start Text COMMAND_Y[0] = 190 end #==============================================================================# # End Of Customization ^_^ # #==============================================================================# class Scene_PreTitle < Scene_Base #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main# If normal play if $BTEST $scene = Scene_Title.new else super # Usual main processing end end #-------------------------------------------------------------------------- # * Start processing #-------------------------------------------------------------------------- def start super @com_wait = 1 @sel_index = 0 create_title_graphics # Create title graphics create_command_graphics # Create command graphics # play_title_music # Play title screen music end #-------------------------------------------------------------------------- # * Execute Transition #-------------------------------------------------------------------------- def perform_transition Graphics.transition(20) end #-------------------------------------------------------------------------- # * Post-Start Processing #-------------------------------------------------------------------------- def post_start super end #-------------------------------------------------------------------------- # * Pre-termination Processing #-------------------------------------------------------------------------- def pre_terminate super end #-------------------------------------------------------------------------- # * Termination Processing #-------------------------------------------------------------------------- def terminate super dispose_command_graphics dispose_title_graphics end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super update_com_graphics if Input.trigger?(Input::DOWN) pre_mvmt if @sel_index == (GB::COMMAND_TEXT.size-1) @sel_index = 0 else @sel_index += 1 end post_mvmt elsif Input.trigger?(Input::UP) pre_mvmt if @sel_index == 0 @sel_index = (GB::COMMAND_TEXT.size-1) else @sel_index -= 1 end post_mvmt elsif Input.trigger?(Input::C) eval(GB::COMMAND_ACTION[@sel_index]) end end #-------------------------------------------------------------------------- # * Update Command Graphics #-------------------------------------------------------------------------- def update_com_graphics @com_wait -= 1 if @com_wait <= 0 @com_graphics[@sel_index].flash(GB::COMMAND_COLOR_YES,120) @com_wait = 120 end for sprt in @com_graphics sprt.update end end #-------------------------------------------------------------------------- # * Post Selection Movement Processing #-------------------------------------------------------------------------- def post_mvmt @com_graphics[@sel_index].flash(GB::COMMAND_COLOR_YES,120) @com_wait = 120 end #-------------------------------------------------------------------------- # * Pre-Selection Movement Processing #-------------------------------------------------------------------------- def pre_mvmt @com_graphics[@sel_index].flash(GB::COMMAND_COLOR_NOT,120) end #-------------------------------------------------------------------------- # * Create Title Graphic #-------------------------------------------------------------------------- def create_title_graphics @sprite = Sprite.new @sprite.bitmap = Cache.system("Title") end #------------------------------------------------------------------------- # * Dispose of Title Graphic #-------------------------------------------------------------------------- def dispose_title_graphics @sprite.bitmap.dispose @sprite.dispose end #-------------------------------------------------------------------------- # * Play Title Screen Music #-------------------------------------------------------------------------- #def play_title_music # Audio.bgm_play('AUDIO/BGM/battle1', 0, 0) # RPG::BGS.stop # RPG::ME.stop # end #-------------------------------------------------------------------------- # * Create Command Graphics #-------------------------------------------------------------------------- def create_command_graphics#window @command_window = Window_Base.new(250, 350, 44, 50) @command_window.opacity = 0 @command_window.back_opacity = 0 @command_window.contents_opacity = 0 @command_window.openness = 0 @com_graphics = [] for index in 0..(GB::COMMAND_TEXT.size-1) @com_graphics[index] = Sprite.new @com_graphics[index].bitmap = Bitmap.new(200,200) @com_graphics[index].bitmap.font.name = GB::COMMAND_FONT @com_graphics[index].bitmap.font.size = GB::COMMAND_TEXT_SIZE @com_graphics[index].bitmap.font.color = GB::COMMAND_COLOR_NOT @com_graphics[index].bitmap.font.shadow = GB::COMMAND_SHADOW @com_graphics[index].bitmap.font.bold = GB::COMMAND_BOLD @com_graphics[index].bitmap.font.italic = GB::COMMAND_ITALIC @com_graphics[index].ox = -(GB::COMMAND_X[index]) @com_graphics[index].oy = -(GB::COMMAND_Y[index]) rect = @com_graphics[index].bitmap.text_size(GB::COMMAND_TEXT[index]) @com_graphics[index].bitmap.draw_text(0,0,rect.width,rect.height,GB::COMMAND_TEXT[index]) end end #-------------------------------------------------------------------------- # * Dispose of Command Graphics #-------------------------------------------------------------------------- def dispose_command_graphics for com in @com_graphics com.dispose unless com.nil? end @command_window.dispose end def close_command_window return end
end Puis pour finir installez le script d'écran titre animé de mira au dessus du second script : - Code:
-
#------------------------------------------------------------------------------- # Start Screen VX V.2.5 # (Created from Miget man12's More-than-usually Graphical Title) # Last update : 2010/5/05 # Edited by Guyver's Bane # And support given by Night5h4d3 for Battle Test problem.(resolved now) # Credit goes to Miget man12 for the script this was made from. # I take credit only in editing his original work. #==============================================================================# # This script allows you to have a Start screen upon playing # #==============================================================================# #------------------------------------------------------------------------------# # Installation: Place above "Main". Basically it's pulg'n play. # #------------------------------------------------------------------------------# #==============================================================================# # Customization # #==============================================================================# module GB # The Number of COMMAND_ACTION, COMMAND_X and COMMAND_Y variables MUST be at # least as much as the number of COMMAND_TEXT variables!! (You can have more # than COMMAND_TEXT; it won't affect anything) # The text drawn on the title screen COMMAND_TEXT = [] # Leave alone! COMMAND_TEXT[0] = "Appuyez sur start" COMMAND_ACTION = [] # Leave alone! COMMAND_ACTION[0] = "$scene = Scene_Title.new" # ["Times New Roman", "Verdana", "Arial", "Courier New"] # **the name MUST be in quotes!** COMMAND_FONT = ["Brush Script Std", "Brush Script Std"] # Size of Command Text COMMAND_TEXT_SIZE = 37 COMMAND_SHADOW = false COMMAND_BOLD = false COMMAND_ITALIC = false # Colors go like so: # Color.new(red,green,blue[,transparency]) # Each color level ranges from 0 to 255 # All 255 is white # All 0 is black # Transparency can be left out! If it is, it will be automatically set to 255 # Color of Command Text when not selected COMMAND_COLOR_NOT = Color.new(255,255,255) # Color Command Text flashes when selected COMMAND_COLOR_YES = Color.new(74,89,112) COMMAND_X = [] # Leave alone! COMMAND_Y = [] # Leave alone! # X position of Start Text COMMAND_X[0] = 175 # Y position of Start Text COMMAND_Y[0] = 190 end #==============================================================================# # End Of Customization ^_^ # #==============================================================================# class Scene_PreTitle < Scene_Base #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main# If normal play if $BTEST $scene = Scene_Title.new else super # Usual main processing end end #-------------------------------------------------------------------------- # * Start processing #-------------------------------------------------------------------------- def start super @com_wait = 1 @sel_index = 0 create_title_graphics # Create title graphics create_command_graphics # Create command graphics # play_title_music # Play title screen music end #-------------------------------------------------------------------------- # * Execute Transition #-------------------------------------------------------------------------- def perform_transition Graphics.transition(20) end #-------------------------------------------------------------------------- # * Post-Start Processing #-------------------------------------------------------------------------- def post_start super end #-------------------------------------------------------------------------- # * Pre-termination Processing #-------------------------------------------------------------------------- def pre_terminate super end #-------------------------------------------------------------------------- # * Termination Processing #-------------------------------------------------------------------------- def terminate super dispose_command_graphics dispose_title_graphics end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super update_com_graphics if Input.trigger?(Input::DOWN) pre_mvmt if @sel_index == (GB::COMMAND_TEXT.size-1) @sel_index = 0 else @sel_index += 1 end post_mvmt elsif Input.trigger?(Input::UP) pre_mvmt if @sel_index == 0 @sel_index = (GB::COMMAND_TEXT.size-1) else @sel_index -= 1 end post_mvmt elsif Input.trigger?(Input::C) eval(GB::COMMAND_ACTION[@sel_index]) end end #-------------------------------------------------------------------------- # * Update Command Graphics #-------------------------------------------------------------------------- def update_com_graphics @com_wait -= 1 if @com_wait <= 0 @com_graphics[@sel_index].flash(GB::COMMAND_COLOR_YES,120) @com_wait = 120 end for sprt in @com_graphics sprt.update end end #-------------------------------------------------------------------------- # * Post Selection Movement Processing #-------------------------------------------------------------------------- def post_mvmt @com_graphics[@sel_index].flash(GB::COMMAND_COLOR_YES,120) @com_wait = 120 end #-------------------------------------------------------------------------- # * Pre-Selection Movement Processing #-------------------------------------------------------------------------- def pre_mvmt @com_graphics[@sel_index].flash(GB::COMMAND_COLOR_NOT,120) end #-------------------------------------------------------------------------- # * Create Title Graphic #-------------------------------------------------------------------------- def create_title_graphics @sprite = Sprite.new @sprite.bitmap = Cache.system("Title") end #------------------------------------------------------------------------- # * Dispose of Title Graphic #-------------------------------------------------------------------------- def dispose_title_graphics @sprite.bitmap.dispose @sprite.dispose end #-------------------------------------------------------------------------- # * Play Title Screen Music #-------------------------------------------------------------------------- #def play_title_music # Audio.bgm_play('AUDIO/BGM/battle1', 0, 0) # RPG::BGS.stop # RPG::ME.stop # end #-------------------------------------------------------------------------- # * Create Command Graphics #-------------------------------------------------------------------------- def create_command_graphics#window @command_window = Window_Base.new(250, 350, 44, 50) @command_window.opacity = 0 @command_window.back_opacity = 0 @command_window.contents_opacity = 0 @command_window.openness = 0 @com_graphics = [] for index in 0..(GB::COMMAND_TEXT.size-1) @com_graphics[index] = Sprite.new @com_graphics[index].bitmap = Bitmap.new(200,200) @com_graphics[index].bitmap.font.name = GB::COMMAND_FONT @com_graphics[index].bitmap.font.size = GB::COMMAND_TEXT_SIZE @com_graphics[index].bitmap.font.color = GB::COMMAND_COLOR_NOT @com_graphics[index].bitmap.font.shadow = GB::COMMAND_SHADOW @com_graphics[index].bitmap.font.bold = GB::COMMAND_BOLD @com_graphics[index].bitmap.font.italic = GB::COMMAND_ITALIC @com_graphics[index].ox = -(GB::COMMAND_X[index]) @com_graphics[index].oy = -(GB::COMMAND_Y[index]) rect = @com_graphics[index].bitmap.text_size(GB::COMMAND_TEXT[index]) @com_graphics[index].bitmap.draw_text(0,0,rect.width,rect.height,GB::COMMAND_TEXT[index]) end end #-------------------------------------------------------------------------- # * Dispose of Command Graphics #-------------------------------------------------------------------------- def dispose_command_graphics for com in @com_graphics com.dispose unless com.nil? end @command_window.dispose end def close_command_window return end
#============================================================================== # ** Main #------------------------------------------------------------------------------ # After defining each class, actual processing begins here. #==============================================================================
#begin #---------------------------------------------------------------------------------- #Plein écran = Alt+Entrée ou activer le script suivant : #$showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), '' #$showm.call(18,0,0,0) #$showm.call(13,0,0,0) #$showm.call(13,0,2,0) #$showm.call(18,0,2,0) #---------------------------------------------------------------------------------- # Graphics.freeze # $scene = Scene_PreTitle.new # $scene.main while $scene != nil # Graphics.transition(30) #rescue Errno::ENOENT # filename = $!.message.sub("No such file or directory - ", "") # print("Unable to find file #{filename}.") #end
end pour les configurations :- vous pouvez choisir la carte sur laquelle vous voulez que le jeux commence en modifiant cette partie dans le script " switch écran titre" : - Code:
-
TITLE_DATA = [2, 19, 14] #Constantes qui défini la map qui sers d'écran titre [MAP_ID, X, Y] - sur la carte que vous avez choisie pour que l'écran titre commence faite un appel de script à la fin de votre event et écrivez ceci : - Code:
-
$scene = Scene_PreTitle.new - j'ai désactivé l'ondulation du titre dans le script d' écran titre animé de mira pour la réactiver changez la ligne 26 : - Code:
-
TWAVE = false par : - Code:
-
TWAVE = true - modifier " appuyez sur start" : pour changer le texte qui s'affiche il sufit de modifier la ligne 24 : - Code:
-
COMMAND_TEXT[0] = "Appuyez sur start" pour changer la couleur (à la place du bleu) modifiiez les chiffres aux ligne 42 et 44 (255 partout pour le blanc, 0 partout pour le noir, pour les autres couleur vous pouvez regarder les trois chiffres en sélectionnant votre couleur dans Photoshop ce sont les même pour le script) : - Code:
-
COMMAND_COLOR_NOT = Color.new(255,255,255) COMMAND_COLOR_YES = Color.new(74,89,112) vous pouvez changer la police d'écriture ligne 29 : - Code:
-
COMMAND_FONT = ["Brush Script Std", "Brush Script Std"] pour réactiver la musique de fond quand "appuyez sur start s'affiche enlevez les # a la ligne 75 et de la ligne 172 a 176 : - Code:
-
# play_title_music - Code:
-
#def play_title_music # Audio.bgm_play('AUDIO/BGM/battle1', 0, 0) # RPG::BGS.stop # RPG::ME.stop # end et vous pouvez changer la musique en modifiant " AUDIO/BGM/battle1", le volume et le tempo de la musique en modifiant les deux 0 qui se trouve juste à la suite Voila en espérant que sa vous sera utile !
Dernière édition par suila le Ven 19 Aoû 2011 - 15:37, édité 1 fois |
|
Citadin Lv.7
Age : 35 Inscrit le : 17/05/2010 Messages : 212
| Sujet: Re: Fusion de script d'écran titre (carte+appuyez sur start+ecran titre animé) Ven 19 Aoû 2011 - 7:49 | |
| Autant utiliser le Skip_Title (de moi ) et simplement créer le reste en évenement ... |
|
Poulet Lv.1
Inscrit le : 14/08/2011 Messages : 6
| Sujet: Re: Fusion de script d'écran titre (carte+appuyez sur start+ecran titre animé) Dim 21 Aoû 2011 - 3:50 | |
| C'est vrai, c'est pas bête je n'y avait même pas pensé |
|
| Sujet: Re: Fusion de script d'écran titre (carte+appuyez sur start+ecran titre animé) | |
| |
|