RPG Maker universe
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Le Deal du moment : -20%
Ecran PC GIGABYTE 28″ LED M28U 4K ( IPS, 1 ms, ...
Voir le deal
399 €

Menu +2 options

Aller en bas

Menu +2 options Empty Menu +2 options

Message par Nicolas Lun 21 Fév - 23:27

Ce script de Resource Dragon permet d'ajouter deux options, une qui permet d'afficher une image et une autre qui téléporte sur une map.
Dans ma démo, je l'ai utiliser pour un système de mini-jeu (pas du tout développer tongue ) et les touches qui entre en jeux ... mais libre à vous ...

démo : http://www.megaupload.com/?d=9UV7B9GL

Pour ceux qui n'aiment pas télécharger :
Une image "Contrôle" doit être mise dans system (graphique)
Le script :
Code:
#==============================================================================
# �?? Title ReDux ??� v1.0
# Created By Resource Dragon, Help from Kread-EX
# http://resourcedragon.weebly.com/
#------------------------------------------------------------------------------
# This is a ReDux of the title screen, making it easier to configure it.
#
#==============================================================================
module RDVOCAB

 RDVOCAB::NEW_GAME    = "Nouveau jeu"    # Name for New Game.
 RDVOCAB::CONTINUE    = "Continuer"    # Name for Continue.
 RDVOCAB::ARENA      = "Mini-jeux"      # Name for Arena.
 RDVOCAB::CONTROLS    = "Contrôle"    # Name for Controls.
 RDVOCAB::SHUTDOWN    = "Quitter"    # Name for Shutdown.

end
#==============================================================================
# Arena Configurations
#==============================================================================
module ARENA
 
 MAP          = (2)    # Map ID.
 X            = (2)    # Start location, Map X.
 Y            = (2)    # Start Location, Map Y.
 BGMFADE      = (1500)  # How much the BGM Fades. Normal is 1500.
 GRAPHICSFADE = (60)    # How much the Graphics Fade. Normal is 60.
 GRAPHICSWAIT = (40)    # How long the Graphics wait. Normal is 40.

end
#==============================================================================
# Core Configurations
#==============================================================================
module RDCONFIG

 TRANSITION    = (20)      #Transition.
 
 TITLEGRAPHIC  = ("Title")  # Name of the title graphic in the Graphics/System
                            # Folder.
 TITLEGRAPHIC2 = ("Title") # Name of the title graphic2 in the Graphics/System
                            # Folder.                         
 CMDWINDOWX    =  (200)    # Command windows vertical placing on title screen.
 
 CMDWINDOWY    =  (150)    # Command windows horizontal placing on title screen.

 CONTROLS      = "Contrôle" # Name for the controls graphic in Graphics/System
                            # Folder. 
 SWITCHTITLE  = (10)      # Turn on this Switch ID to change title graphic.
 # ^ Currently not working. Doesn't do anything. Will fix this.
 
end
#==============================================================================
# End Configuration
#==============================================================================

class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # * Main Process
  #--------------------------------------------------------------------------
  def main
    if $BTEST                        # If battle test
      battle_test                    # Start battle test
    else                              # If normal play
      super                          # Usual main processing
    end
  end
  #--------------------------------------------------------------------------
  # * Start process
  #--------------------------------------------------------------------------
  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(RDCONFIG::TRANSITION)
  end
  #--------------------------------------------------------------------------
  # * Post-Start Process
  #--------------------------------------------------------------------------
  def post_start
    super
    open_command_window
  end
  #--------------------------------------------------------------------------
  # * Pre-termination Process
  #--------------------------------------------------------------------------
  def pre_terminate
    super
    close_command_window
  end
  #--------------------------------------------------------------------------
  # * Termination Process
  #--------------------------------------------------------------------------
  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    # Arena
        command_arena
      when 3    # Controls
        command_controls
      when 4    # Exit
        command_exit
      end
    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
    if !$game_switches[RDCONFIG::SWITCHTITLE]
    then create_title_graphic2
    else
    @sprite = Sprite.new
    @sprite.bitmap = Cache.system(RDCONFIG::TITLEGRAPHIC)
  end
end
  def create_title_graphic2
    @sprite = Sprite.new
    @sprite.bitmap = Cache.system(RDCONFIG::TITLEGRAPHIC2)
  end
  #--------------------------------------------------------------------------
  # * Dispose of Title Graphic
  #--------------------------------------------------------------------------
  def dispose_title_graphic
    @sprite.bitmap.dispose
    @sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = RDVOCAB::NEW_GAME
    s2 = RDVOCAB::CONTINUE
    s3 = RDVOCAB::ARENA
    s4 = RDVOCAB::CONTROLS
    s5 = RDVOCAB::SHUTDOWN
    @command_window = Window_Command.new(172, [s1, s2, s3, s4, s5])
    @command_window.x = RDCONFIG::CMDWINDOWX
    @command_window.y = RDCONFIG::CMDWINDOWY
    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 
  #--------------------------------------------------------------------------
  # * Command: Arena
  #--------------------------------------------------------------------------
  def command_arena
    confirm_player_location
    Sound.play_decision
    $game_party.setup_starting_members
    $game_map.setup(ARENA::MAP)
    $game_player.moveto(ARENA::X,ARENA::Y)
    $game_player.refresh
    $scene = Scene_Map.new
    RPG::BGM.fade(ARENA::BGMFADE)
    close_command_window
    Graphics.fadeout(ARENA::GRAPHICSFADE)
    Graphics.wait(ARENA::GRAPHICSWAIT)
    Graphics.frame_count = 0
    RPG::BGM.stop
    $game_map.autoplay 
  end
  #--------------------------------------------------------------------------
  # * Command: Controls
  #--------------------------------------------------------------------------
  def command_controls
    close_command_window
    dispose_title_graphic
    @controls = Sprite.new
    @controls.bitmap = Cache.system(RDCONFIG::CONTROLS)
    loop do
      Graphics.update
      Input.update
      break if Input.trigger?(Input::B)
    end
    @controls.bitmap.dispose
    @controls.dispose
    create_title_graphic
    open_command_window
  end
  #--------------------------------------------------------------------------
  # * Command: Exit
  #--------------------------------------------------------------------------
  def command_exit
    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

Nicolas
Admin
Admin

Messages : 113
Date d'inscription : 20/02/2011

https://rpguniverse.forumsactifs.com

Revenir en haut Aller en bas

Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum