RPGVX.net

  RPG-Maker VX => VX Skripte [Fertiger Code] => Thema gestartet von: woratana am April 06, 2008, 05:26:17

Titel: +[Custom Title Screen Menu]+
Beitrag von: woratana am April 06, 2008, 05:26:17
Custom Title Screen Menu
Version 1.0
by Woratana
Release Date: 04/04/2008


Introduction
This script will help you add, arrange, and edit menu in title screen easier.

You can easily move, change its size, change skin, and  change opacity.


Features
Version 1.0
- Easy to Edit window's appearance (size, position, skin, opacity)
- Easy to Add/Arrange commands
- Included built-in method to help you make new command easier


Script
Place it above main

#===============================================================
# ? [VX] ? Custom Title Screen Menu ? ?
#--------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Version: 1.0
# ? Released on: 04/04/2008
#--------------------------------------------------------------

#-----------------------------------------
# [+ FEATURES +]
#---------------------------------------
# - Easy to Edit window's appearance (size, position, skin, opacity)
# - Easy to Add/Arrange commands
# - Included built-in method to help you make new command easier
#------------------------------------------

class Scene_Title < Scene_Base
  #====================================================================
  # +[START SETUP SCRIPT HERE]+
  #--------------------------------------------------------------
  #--------------------------------------------------------------------------
  # ** Command Window Appearance Setup
  #----------------------------------------------------------------------
  # * Type the integer number to use that value,
  # e.g. COMMAND_WINDOW_X = 200
  # * or type script in '...' to use number calculate by script.
  # e.g. COMMAND_WINDOW_X = '(544 - @command_window.width) / 2'
  # Note: You can use script in COMMAND_WINDOW_X and COMMAND_WINDOW_Y
  #--------------------------------------------------------------------------
  COMMAND_WINDOW_X = '(544 - @command_window.width) / 2'
  COMMAND_WINDOW_Y = 288
  COMMAND_WINDOW_WIDTH = 172
  COMMAND_WINDOW_HEIGHT = nil # Type integer, or 'nil' for autosize.
  
  COMMAND_WINDOW_COLUMN_MAX = 1 # Type integer, minimum is 1
  COMMAND_WINDOW_ROW_MAX = 0 # Type integer, or 0 for auto row count.
  COMMAND_WINDOW_SPACING = 32
  
  COMMAND_WINDOW_SKIN = 'Window' # Windowskin file must be in folder 'System'
  COMMAND_WINDOW_BACK_OPACITY = 200 # Window Background Opacity (0 - 255)
  COMMAND_WINDOW_OPACITY = 255 # Window Opacity (0 - 255)
  #--------------------------------------------------------------------------
  # ** Commands List Setup
  #----------------------------------------------------------------------
  # ** Template **
  # COMMAND[Command Index] = ['Text', 'Script']
  # e.g. COMMAND[1] = ['Test Command', 'scene("Scene_Test.new")]
  
  # ** Description **
  # Command Index
  # << Command Index start from 0. The lower index will show above higher index
  # 'Text'
  # << Text you want to show for that command, type text in '...'
  # 'Script'
  # << Script to run when player choose that command, type script in '...'
  
  #-------------------------------------------------------------------------
  # ** Built-in Method
  # * List of built-in method, you can put this in 'Script' in Template
  #-------------------------------------------------------------------------
  # 'command_new_game' : New Game
  # 'command_continue' : Continue Game
  # 'command_shutdown' : Shut down Game
  
  # 'scene("Scene_Name.new")' : Change Scene to 'Scene_Name.new'
  # e.g. 'scene("Scene_End.new")'
  # e.g.2 'scene("Scene_Menu.new(2)")'
  
  # 'new(Map ID, X, Y, Members)' : New Game in specific location and members
  # e.g. 'new(1, 10, 8, [1,2,3])'
  # << New Game in Map ID 1 at coordinate (10,8) with Actor ID 1,2,3 in party
  # Note: You may use this method for Game Tutorial
  #--------------------------------------------------------------------------
  COMMAND = Array.new
  #--------------------------------------------------------------------------
  COMMAND[0] = ['New Game', 'command_new_game']
  COMMAND[1] = ['Load Game', 'command_continue']
  COMMAND[2] = ['End Game', 'command_shutdown']
  
  LOAD_GAME_COMMAND_INDEX = 1 # COMMAND index that use to Load Game.
  # (This command will unable to use if there's no save file available)
  #-------------------------------------------------------------------------
  # +[END SETUP SCRIPT HERE]+
  #-------------------------------------------------------------------------
  
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    command_list = []
    COMMAND.each {|i| command_list.push (i[0]) }
    @command_window = Window_Command.new(COMMAND_WINDOW_WIDTH, command_list, COMMAND_WINDOW_COLUMN_MAX, COMMAND_WINDOW_ROW_MAX, COMMAND_WINDOW_SPACING)
    @command_window.x = COMMAND_WINDOW_X.is_a?(String) ? eval(COMMAND_WINDOW_X) : COMMAND_WINDOW_X
    @command_window.y = COMMAND_WINDOW_Y.is_a?(String) ? eval(COMMAND_WINDOW_Y) : COMMAND_WINDOW_Y
    @command_window.height = COMMAND_WINDOW_HEIGHT if !COMMAND_WINDOW_HEIGHT.nil?
    @command_window.windowskin = Cache.system(COMMAND_WINDOW_SKIN)
    @command_window.back_opacity = COMMAND_WINDOW_BACK_OPACITY
    @command_window.opacity = COMMAND_WINDOW_OPACITY
    
    if @continue_enabled   # If continue is enabled
      @command_window.index = LOAD_COMMAND_INDEX  # Move cursor over command
    else  # If disabled
      @command_window.draw_item(LOAD_GAME_COMMAND_INDEX, false) # Make command semi-transparent
    end
    @command_window.openness = 0
    @command_window.open
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    @command_window.update
    if Input.trigger?(Input::C)
      eval(COMMAND[@command_window.index][1])
    end
  end
  #--------------------------------------------------------------------------
  # * Call Scene
  #--------------------------------------------------------------------------
  def scene(scene_name)
    Sound.play_decision
    $scene = eval(scene_name)
  end
  #--------------------------------------------------------------------------
  # * New Game in Other Location
  #--------------------------------------------------------------------------
  def new(map_id, x, y, member_ary)
    Sound.play_decision
    $game_party.custom_starting_members(member_ary)
    $game_map.setup(map_id)
    $game_player.moveto(x, 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
end

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Custom Party Setup
  #--------------------------------------------------------------------------
  def custom_starting_members(member_ary)
    @actors = []
    member_ary.each {|i| @actors.push(i) }
  end
end

Instruction
- Setup script between this line...
  #====================================================================
  # +[START SETUP SCRIPT HERE]+
  #--------------------------------------------------------------
and this line...
  #-------------------------------------------------------------------------
  # +[END SETUP SCRIPT HERE]+
  #-------------------------------------------------------------------------

Here are the setup guides from script:
  #--------------------------------------------------------------------------
  # ** Command Window Appearance Setup
  #----------------------------------------------------------------------
  # * Type the integer number to use that value,
  # e.g. COMMAND_WINDOW_X = 200
  # * or type script in '...' to use number calculate by script.
  # e.g. COMMAND_WINDOW_X = '(544 - @command_window.width) / 2'
  # Note: You can use script in COMMAND_WINDOW_X and COMMAND_WINDOW_Y
  #--------------------------------------------------------------------------

  #--------------------------------------------------------------------------
  # ** Commands List Setup
  #----------------------------------------------------------------------
  # ** Template **
  # COMMAND[Command Index] = ['Text', 'Script']
  # e.g. COMMAND[1] = ['Test Command', 'scene("Scene_Test.new")]
  
  # ** Description **
  # Command Index
  # << Command Index start from 0. The lower index will show above higher index
  # 'Text'
  # << Text you want to show for that command, type text in '...'
  # 'Script'
  # << Script to run when player choose that command, type script in '...'
 
  #-------------------------------------------------------------------------
  # ** Built-in Method
  # * List of built-in method, you can put this in 'Script' in Template
  #-------------------------------------------------------------------------
  # 'command_new_game' : New Game
  # 'command_continue' : Continue Game
  # 'command_shutdown' : Shut down Game
  
  # 'scene("Scene_Name.new")' : Change Scene to 'Scene_Name.new'
  # e.g. 'scene("Scene_End.new")'
  # e.g.2 'scene("Scene_Menu.new(2)")'
  
  # 'new(Map ID, X, Y, Members)' : New Game in specific location and members
  # e.g. 'new(1, 10, 8, [1,2,3])'
  # << New Game in Map ID 1 at coordinate (10,8) with Actor ID 1,2,3 in party
  # Note: You may use this method for Game Tutorial


Compatibility
This script rewrite methods update and create_command_window

so it may not work with scripts that need to edit those methods.


Author's Notes
Free for use in your non-commercial work if credit included. If your project is commercial, please contact me.

Please do not redistribute this script without permission. If you want to post it on any forum, please link to this topic.
Titel: +[Custom Title Screen Menu]+
Beitrag von: Dainreth am April 06, 2008, 17:42:04
Nice script for those who want to change their title in this way! Sounds really easy, I didn't try it yet..but seems really nice as I said..thanks wora for a great script again!
Titel: +[Custom Title Screen Menu]+
Beitrag von: eugene222 am April 06, 2008, 19:35:58
hallo, eigentlich verstehe ich englisch ganz gut, nur hier kann ich nicht so ganz verstehen was das Skript macht. Es wäre nett, wenn irgentwer mal in kurzen Worten erklären kann, was das bringt.

mfg. eugene

*edit*
naja, geht irgentwie net bei mir Fehler Zeile 102 irgentetwas mit der GAME_LOAD variable oder so.
Titel: +[Custom Title Screen Menu]+
Beitrag von: ERZENGEL am April 06, 2008, 19:41:41
Damit kann man vom Titelmenü die Transparenz, Windowskin, X und Y usw. ändern. Auch wohin man kommt, wenn man die einzelnen Punkte anklickt, die man auch verschieben oder entfernen kann u.v.m.

Das Skript ansich find ich eigentlich sehr unnötig, da mit sehr wenig Wissen und ein Blick in die RGSS-Referenz (Stichwort: Window) reichen sollte, das hinzubekommen :)Trotzdem schön, dass wir hier mit Skripten von dir überhäuft werden, woratana ^^
Titel: +[Custom Title Screen Menu]+
Beitrag von: Talyana Meriweather Rahl am April 06, 2008, 19:41:47
Edit:

ERZENGEL war schneller xD
Titel: +[Custom Title Screen Menu]+
Beitrag von: woratana am April 06, 2008, 22:40:02
I pretty much scripted this to make it easier to add/remove command on title screen.

Feature to change window's appearance is just bonus feature. :)

p.s. I feels like I need to learn German now >_>
Titel: +[Custom Title Screen Menu]+
Beitrag von: Dainreth am April 07, 2008, 09:09:08
@EE
Für diejenigen, die sich sonst nicht mit RGSS auskennen ist's dennoch etwas einfacher :)

@wora
Yeah, a german speaking wora..that sound's great, doesn't it? :P
Titel: +[Custom Title Screen Menu]+
Beitrag von: ERZENGEL am April 07, 2008, 13:32:05
Hm.. stimmt Dainreth, aber ich fände ein Tutorial wäre besser für sowas. Und wie gesagt ich freu mich eigentlich immer über woratanas Skripte, aber das.. außerdem und Gott sei Dank hat ja auch jeder seine eigene Meinung :)

in english for non-german-speaking wora :P: I think a tutorial how to alternate the titlescreen menu will be better instead of the script. But it's my opinion and everybody got it's own so everybody should decide how useful this is. And I said too that I'm very happy about every released script coded by you :)
Titel: fehler im title script von woratana
Beitrag von: Johny-Kk am Februar 11, 2011, 20:19:46
was zur hölle?
hab die anweisungen im skript eigentlich richtig befolgt, und nun sowas???
weiß einer wie ich das hinbekomme, das es richtig funzt?

~Bitte Fragen zu Skripten immer im Original Thread posten. Danke.

MfG, Colo


@colo:
da stand das die letzte antwort länger als 31 tage her wäre und es besser wäre, wenn ich einen neuen thread mache...
aber, ok meinetwegen kann auch hier geantwortet werden^^

~Wir haben eine Edit funktion. Bitte keine Doppelposts. Ließ bitte die Regeln!

MfG, Colo
SimplePortal 2.3.3 © 2008-2010, SimplePortal