Sign in to follow this  
Followers 0
KillerG

Character Select

9 posts in this topic

Te deja elegir que jugador quieres usar al empezar el juego o cuando quieras

Screenies:
[SPOILER]
user posted image
user posted image
[/SPOILER]

Script:
[SPOILER]
CODE

#==============================================================================
# ** Character Select
#==============================================================================
# Raziel
# Version 1.1
# 2006-10-24
#------------------------------------------------------------------------------
# Instructions:
#   Actor 1 - 7 are the actors in your database, so Actor1 = 1 means
#   that the first character shown is the first actor in your database.
#   Just exchange the numbers to change the actors
#
#   Actor1_Text is the displayed text for the actor.
#   You can write up to four lines.
#   Only edit the lines within the module.
#
#   To call it use $scene = Scene_CharacterSelect.new in a call script command
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Character Select', 'Raziel', 1.1, '2006-11-01')

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Character Select')
 #==============================================================================
 # ** Actor_Select module
 #==============================================================================
 # Changes can be done here
 #------------------------------------------------------------------------------
 module Actor_Select
   # loading actor and classes
   $data_actors = load_data("Data/Actors.rxdata")
   $data_classes = load_data("Data/Classes.rxdata")
   #----BEGIN EDIT-----
   # select actors from your database
   Actor1 = 1
   Actor2 = 2
   Actor3 = 3
   Actor4 = 4
   Actor5 = 5
   Actor6 = 6
   Actor7 = 7
   # select your text to be shown when you select an actor
   Selection_Text = "Do you want to choose this player?"
   # text that will show your characters name, class and info
   Actor1_Text = ["Name: " + $data_actors[Actor1].name,
                  "Class: " + $data_classes[$data_actors[Actor1].class_id].name,
                  "Info: ",
                  ""]
   Actor2_Text = ["Name: " + $data_actors[Actor2].name,
                  "Class: " + $data_classes[$data_actors[Actor2].class_id].name,
                  "Info: ",
                  ""]
   Actor3_Text = ["Name: " + $data_actors[Actor3].name,
                  "Class: " + $data_classes[$data_actors[Actor3].class_id].name,
                  "Info: ",
                  ""]
   Actor4_Text = ["Name: " + $data_actors[Actor4].name,
                  "Class: " + $data_classes[$data_actors[Actor4].class_id].name,
                  "Info: ",
                  ""]
   Actor5_Text = ["Name: " + $data_actors[Actor5].name,
                  "Class: " + $data_classes[$data_actors[Actor5].class_id].name,
                  "Info: ",
                  ""]
   Actor6_Text = ["Name: " + $data_actors[Actor6].name,
                  "Class: " + $data_classes[$data_actors[Actor6].class_id].name,
                  "Info: ",
                  ""]
   Actor7_Text = ["Name: " + $data_actors[Actor7].name,
                  "Class: " + $data_classes[$data_actors[Actor7].class_id].name,
                  "Info: ",
                  ""]
   # choose the actor's reating from 1 to 5
   Actor1_Rating = 1
   Actor2_Rating = 2
   Actor3_Rating = 3
   Actor4_Rating = 4
   Actor5_Rating = 5
   Actor6_Rating = 5
   Actor7_Rating = 5
   #se plays when you made your actor decision
   SE = "056-Right02"
   #background bgm plays during these scene
   BGM = "013-Theme02"
   #scene's background picture
   Background = "" #background picture must be in the pictures folder
   #change it to battler to show the battler
   Graphic = "character"  #change it to character to show the character
 end
 #----STOP EDIT-----
 #==============================================================================
 # ** Window_CharacterChoose
 #==============================================================================

 class Window_CharacterChoose < Window_Selectable
   attr_accessor :sprite
   #--------------------------------------------------------------------------
   # * Object Initialization
   #--------------------------------------------------------------------------
   def initialize
     super(0, 0, 640, 480)
     self.contents = Bitmap.new(width - 32, height - 32)
     self.index = 0
     self.opacity = 0
     @column_max = 7
     @item_max = 7
     @sprite = 1
     refresh
   end
   #--------------------------------------------------------------------------
   # * Refresh
   #--------------------------------------------------------------------------
   def refresh
     self.contents.clear
     for i in 1..7
       x2 = Actor_Select::Graphic == "character" ? i * 80 - 40 : i * 80 - 80
       y2 = Actor_Select::Graphic == "character" ? 180 : 50
       @back_sprite = eval("$data_actors[Actor_Select::Actor#{i}]")
       bitmap2 = eval("RPG::Cache.#{Actor_Select::Graphic}(@back_sprite.#{Actor_Select::Graphic}_name, @back_sprite.#{Actor_Select::Graphic}_hue)")
       bw2 = Actor_Select::Graphic == "character" ? bitmap2.width / 4 : bitmap2.width
       bh2 = Actor_Select::Graphic == "character" ? bitmap2.height / 4 : bitmap2.height
       self.contents.blt(x2, y2, bitmap2, Rect.new(0,0,bw2, bh2), 100)
     end
     x = Actor_Select::Graphic == "character" ? @sprite * 80 - 40 : @sprite * 80 - 80
     @actor_sprite = eval("$data_actors[Actor_Select::Actor#{@sprite}]")
     bitmap = eval("RPG::Cache.#{Actor_Select::Graphic}(@actor_sprite.#{Actor_Select::Graphic}_name, @actor_sprite.#{Actor_Select::Graphic}_hue)")
     bw = Actor_Select::Graphic == "character" ? bitmap.width / 4 : bitmap.width
     bh = Actor_Select::Graphic == "character" ? bitmap.height / 4 : bitmap.height
     self.contents.blt(x, y2, bitmap, Rect.new(0,0,bw, bh))
   end
   #--------------------------------------------------------------------------
   # * Cursor Rectangle Update
   #--------------------------------------------------------------------------
   def update_cursor_rect
     self.cursor_rect.empty
   end
 end
 #==============================================================================
 # ** Window_ShowText
 #==============================================================================

 class Window_ShowText < Window_Base
   attr_accessor :actor_rating
   #--------------------------------------------------------------------------
   # * Object Initialization
   #--------------------------------------------------------------------------
   def initialize
     super(0, 0, 640, 160)
     self.contents = Bitmap.new(width - 32, height - 32)
     @actor_rating = 0
   end
   #--------------------------------------------------------------------------
   # * Set Text
   #  text  : text string displayed in window
   #  align : alignment (0..flush left, 1..center, 2..flush right)
   #--------------------------------------------------------------------------
   def set_text(text, align = 0)
     @text = text
     @align = align
     refresh
   end
   #--------------------------------------------------------------------------
   # * Refresh
   #--------------------------------------------------------------------------
   def refresh
     self.contents.clear
     for text in @text
       self.contents.font.color = normal_color
       self.contents.draw_text(4, @text.index(text)*32, 640, 32, text, @align)
       for y in 1..5
         x = y * 32 + 420
         bitmap = RPG::Cache.icon("rating_star")
         self.contents.blt(x, 0, bitmap, Rect.new(0, 0,bitmap.width, bitmap.height), 25)
       end
       for i in 1..@actor_rating
         x2 = i * 32 + 420
         bitmap2 = RPG::Cache.icon("rating_star")
         self.contents.blt(x2, 0, bitmap2, Rect.new(0, 0,bitmap2.width, bitmap2.height))
       end
     end
   end
 end
 #==============================================================================
 # ** Scene_CharacterSelect
 #==============================================================================

 class Scene_CharacterSelect
   #--------------------------------------------------------------------------
   # * Main Processing
   #--------------------------------------------------------------------------
   def main
     $game_temp.map_bgm = $game_system.playing_bgm
     Audio.bgm_play("Audio/BGM/" + Actor_Select::BGM, 100, 100)
     @background = Sprite.new
     @background.bitmap = RPG::Cache.picture(Actor_Select::Background)
     @text_window = Window_Base.new(145,0,350,64)
     @text_window.contents = Bitmap.new(318, 32)
     @text_window.contents.draw_text(4, 0, 350, 32, Actor_Select::Selection_Text)
     @choice_window = Window_Command.new(160,["Yes", "No"])
     @choice_window.x = 240
     @choice_window.y = 64
     @choice_window.z = 9998
     @character_window = Window_CharacterChoose.new
     @help_window = Window_ShowText.new
     @help_window.y = 320
     @help_window.height = 160
     @text_window.visible = false
     @choice_window.visible = false
     @choice_window.active = false
     Graphics.transition
     # Main loop
     loop do
       # Update game screen
       Graphics.update
       # Update input information
       Input.update
       # Frame update
       update
       # Abort loop if screen is changed
       if $scene != self
         break
       end
     end
     # Prepare for transition
     Graphics.freeze
     # Dispose of windows
     @character_window.dispose
     @help_window.dispose
     @choice_window.dispose
     @text_window.dispose
     @background.dispose
   end
   #--------------------------------------------------------------------------
   # * Frame Update
   #--------------------------------------------------------------------------
   def update
     @character_window.update
     @help_window.update
     @choice_window.update
     @help_window.actor_rating = eval("Actor_Select::Actor#{@character_window.index + 1}_Rating")
     if @character_window.active
       update_character
       return
     elsif @choice_window.active
       update_choice
       return
     end
   end
   #--------------------------------------------------------------------------
   # * Frame Update (when character window is active)
   #--------------------------------------------------------------------------
   def update_character
     eval("@help_window.set_text(Actor_Select::Actor#{@character_window.index + 1}_Text)")
     if Input.trigger?(Input::B)
       $game_system.se_play($data_system.cancel_se)
       $scene = Scene_Map.new
       Audio.bgm_stop
       $game_system.bgm_play($game_temp.map_bgm)
       return
     end
     if Input.trigger?(Input::C)
       $game_system.se_play($data_system.decision_se)
       @choice_window.visible = true
       @choice_window.active = true
       @text_window.visible = true
       @character_window.active = false
     end
     if Input.repeat?(Input::RIGHT)
       unless @character_window.sprite == 7
         @character_window.sprite += 1
       end
       @character_window.refresh
     end
     if Input.repeat?(Input::LEFT)
       unless @character_window.sprite == 1
         @character_window.sprite -= 1
       end
       @character_window.refresh
     end
   end
   #--------------------------------------------------------------------------
   # * Frame Update (when choice window is active)
   #--------------------------------------------------------------------------
   def update_choice
     if Input.trigger?(Input::B)
       $game_system.se_play($data_system.cancel_se)
       @choice_window.active = false
       @choice_window.visible = false
       @choice_window.index = 0
       @text_window.visible = false
       @character_window.active = true
       return
     end
     if Input.trigger?(Input::C)
       case @choice_window.index
       when 0
         eval("$game_party.actors[0] = $game_actors[Actor_Select::Actor#{@character_window.index + 1}]")
         Audio.se_play("Audio/SE/" + Actor_Select::SE)
         $game_player.refresh
         $scene = Scene_Map.new
         Audio.bgm_stop
         $game_system.bgm_play($game_temp.map_bgm)
       when 1
         $game_system.se_play($data_system.cancel_se)
         @choice_window.active = false
         @choice_window.visible = false
         @choice_window.index = 0
         @text_window.visible = false
         @character_window.active = true
       end
     end
   end
 end
 
 #--------------------------------------------------------------------------
 # * End SDK Enable Test
 #--------------------------------------------------------------------------
end
[/SPOILER]

Instrucciones:
+Pegalo arriba de Main y debajo del SDK
+Para llamarlo debes poner este comando:
QUOTE
$scene = Scene_CharacterSelect.new

+Pon este icono en la carpeta Iconos, llamalo rating_star user posted image
+Lean los comentarios del script, es facil de usar
+Cualquier duda comentenla

By:

Raziel
0

Share this post


Link to post
Share on other sites
supongo que a algunos les vendrá bien pero yo estoy en contra de script como este, que se pueden realizar mediente eventos (y mu sencillos) porque esto hace que los newbies ni se propongan intentarlo porque hoy día se hacen script para todo y luego pues claro pasa lo que pasa, aun así gracias por aportar no te lo tomes como una critica
0

Share this post


Link to post
Share on other sites
Esto se puede hacer sencillamente por el engine, y un ejemplo es el engine de la gran Naire. happy.gif Lo que sea, buen aporte.
0

Share this post


Link to post
Share on other sites
buen aporte para vagos yo prefiero hacerlo
con engine tongue.gif
PD-ESTO NO ES AROGANCIA SI NO DESTINO!!!!
0

Share this post


Link to post
Share on other sites
Yo estoy completamente de acurdo con Sliver, los novatos nunk van a hacer nada. Un día de estos van a sacar scripts con los juegos completos en los q se tengan q elegir solo los charas y el juego este hecho
0

Share this post


Link to post
Share on other sites
hola me one un erroor es este

error de script character select en la linea 27 de tipo NAME EROOR undefiened local variavle or method nbsp for : nilclass
0

Share this post


Link to post
Share on other sites
Veamos... Me parece infundado ese "temor" o "repulsa" a los scripts que facilitan las cosas. Sabemos que practicamente el 90% de los scripts se pueden hacer mediante engines. Pero no es mayor problema.

A mi no me preocupa para nada (pero absoluuuutamente para nada) que los "newbies" usen dichos scripts. Soy de los que opinan que al final el tiempo pone a cada uno en su sitio y si te curras tu juego se notará a la hora de jugarlo, independientemente de usar scripts en vez de engines... Os lo dice alguien que tiene añadidas unas 60 paginas (no las he contado ni tengo ganas de ello xD.png) al editor de scripts y no me considero vago en absoluto...

El script está bien, estilo Diablo II... Tiene su punto...

En cuanto al error de orioltron... ¿tienes el SDK en tu proyecto? Este script lo requiere (por desgracia... me pregunto si dormiran tranquilos los creadores del SDK...)




saludos del paranoyas
0

Share this post


Link to post
Share on other sites
El verdadero problema con estos scripts para vagos, no es solo que usen scripts para todo. El verdadero problema, es que los novatos no se molestan en aprender por sí mismos, ya que los scripts lo hacen todo para sus juegos, y el resultado final es un juego en el que su supuesto creador, es quien menos ha aportado. Sin embargo, si se pusieran en serio a aprender minimamente algo de scripting, seguramente podrian hacer cosas similares por si mismos, aunque de todas formas no me puedo quejar, sin novatos que usen scripts ajenos, los scripters perderiamos nuestro trabajo xD.png

Para los novatos, suelo aconsejar que usen el rmk3(rpgmaker2003) en vez del rmxp, ya que al no tener la sección de scripts, se molestan mas en aprender, y esto lo se por experiencia propia, porque cuando yo empecé a makear, no existia el rmxp, y gracias a eso aprendí a hacer las cosas por mi solita xD.png

Saludoss..
0

Share this post


Link to post
Share on other sites
Si yo sé a lo que os referís, pero el buen maker, por newbie que sea, intentará aprender por sí mismo lo que tenga que aprender...
"Newbies" que lo quieren todo hecho los ha habido siempre, desde los RM2k. Ahora se hace más patente pero siempre los ha habido. Y siempre los habrá, desgraciadamente.
Pero no se puede culpar al script si no al que los usa.

"Las pistolas y las balas no matan. Matan los que aprietan el gatillo".



saludos del paranoyas
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0