Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Actor Selection Tool v2.0, Let's you choose one of your party members and stores info.
ubergeek
post Aug 23 2008, 07:09 AM
Post #1


Level 2
Group Icon

Group: Member
Posts: 26
Type: Scripter
RM Skill: Skilled




Alright. Version 2 of the actor selection tool is up. It has a couple nifty new features which I'll have to explain.

Basically, this script let's you select one of your party members from a list and will then store valueble information about the character in a variable that can be accessed by events ($game_variables.) It is called like this:

CODE
$scene = Scene_MemberSelect.new(use, var)


I should probably explain what the 2 variables do.

use is a string that controls what part of the character's data will be stored. Currently, "name" will store the character's name in a variable, "id" stores the character's id, and "party" store the character's position in the party (remember that the top position is 0!)

The second variable, var, determines which of the $game_variables will store the data. For example, seting use to "name" and var to 3 will store the selected character's name in $game_variables[3].

I have included a demo and a script. Unfortunatly, I don't have a good place to upload the demo onto the internet. Any sugestions? The script is as follows:

CODE
#==============================================================================
# ** Scene_Memberselect
#------------------------------------------------------------------------------
#  This class allows you to select a party member from a menu.
#==============================================================================

class Scene_MemberSelect < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    use : what you want to store as a variable
  #         "name"        :  The character's name
  #         "id"          :  The character's id
  #         "party"       :  The character's party position
  #     var               :  The variable # to store it in
  #--------------------------------------------------------------------------
  def initialize(use, var)
    $event_select = true
    $use = use
    $var = var
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    @status_window = Window_MenuStatus.new(160, 0)
    #Now for the command selection
    s1 = "Status"
    s2 = "Skills"
    s3 = "Confirm"
    @command_window = Window_Command.new(160, [s1, s2, s3])
    hide_command_menu
    start_actor_selection
    
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @status_window.dispose
    @command_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @status_window.update
    @command_window.update
    if @command_window.active
      update_command_selection
    end
    if @status_window.active
      update_actor_selection
    end

  end
  #--------------------------------------------------------------------------
  # * Start Actor Selection
  #--------------------------------------------------------------------------
  def start_actor_selection
    @status_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # * End Actor Selection
  #--------------------------------------------------------------------------
  def end_actor_selection
    @status_window.active = false
    @status_window.index = -1
    $scene = Scene_Map.new
  end
  #--------------------------------------------------------------------------
  # * Update Actor Selection
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::C)
      #$game_party.last_actor_index = @status_window.index
      Sound.play_decision
      command_menu
    end
  end
    

    
  #--------------------------------------------------------------------------
  # * Hide Command Menu
  #--------------------------------------------------------------------------
  def hide_command_menu
    @status_window.active = true
    @command_window.active = false
    @command_window.visible = false
    @command_window.index = -1
  end

  
  
  #--------------------------------------------------------------------------
  # * Start Command Menu
  #--------------------------------------------------------------------------
  def command_menu
    @status_window.active = false
    @command_window.active = true
    @command_window.visible = true
    @command_window.index = 0
  end
  
  
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      hide_command_menu
      @status_window.active = true
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 0      # status
        $scene = Scene_Status.new(@status_window.index)
      when 1      # skills
        $scene = Scene_Skill.new(@status_window.index, -1)
      when 2      # confirm
        store_information
        end_actor_selection
      end
    end
  end
    
    
  #--------------------------------------------------------------------------
  # * Store Information
  #--------------------------------------------------------------------------
  def store_information
      case $use
        when "name" #name
          $game_variables[$var] = $game_party.members[@status_window.index].name
        when "id" #id
          $game_variables[$var] = $game_party.members[@status_window.index].id
        when "party" #party position
          $game_variables[$var] = @status_window.index
      end


  end

end

#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
#  This class performs the skill screen processing.
#==============================================================================

class Scene_Skill < Scene_Base

  #--------------------------------------------------------------------------
  # * Return to Original Screen
  #--------------------------------------------------------------------------
  def return_scene
    if $event_select                           #If called from Memberselect
      $scene = Scene_MemberSelect.new($use,$var)
    else                                       #If called from the menu
      $scene = Scene_Menu.new(1)
    end
  end
end

#==============================================================================
# ** Scene_Status
#------------------------------------------------------------------------------
#  This class performs the status screen processing.
#==============================================================================

class Scene_Status < Scene_Base

  #--------------------------------------------------------------------------
  # * Return to Original Screen
  #--------------------------------------------------------------------------
  def return_scene
    if $event_select                           #If called from Memberselect
      $scene = Scene_MemberSelect.new($use,$var)
    else                                       #If called from the menu
      $scene = Scene_Menu.new(3)
    end
  end
end

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs the menu screen processing.
#==============================================================================

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
    $event_select = false
  end
end


Compatibility:
I would assume this is combatible with most scripts, although it might not work with scripts that change the instructions passed to the menu, but this can easily be patched.
Put the script above main, like most other online scripts.

Version Updates:
Unless someone has something they really want to see, this will be the final version.

This script is free to use, just be used to use my name to give me credit for it.

Final Notes: This is the first script I have made. Furute plans include a script that improves class changing, and introduces multiclassing (being more than one class) See you then.

This post has been edited by PK8: Sep 15 2012, 04:08 PM
Go to the top of the page
 
+Quote Post
   
runerqp
post Mar 24 2009, 07:37 AM
Post #2


Level 1
Group Icon

Group: Member
Posts: 12
Type: None
RM Skill: Undisclosed




well good thing i always wanted this but it makes me sad because this is not the way to present a script. Jusst see other examples to correct it.
Anyway i recomend to upload your demo in mediafire.
Well i put your script in mky game but it doesn´t appears the window, how do i make it to appear and where i put this script(all this things add it to tyhe topic).
Go to the top of the page
 
+Quote Post
   
AmIMeYet
post Mar 24 2009, 08:16 AM
Post #3


new av & (dynamic) sig!
Group Icon

Group: Revolutionary
Posts: 149
Type: Scripter
RM Skill: Undisclosed




QUOTE (runerqp @ Mar 24 2009, 04:37 PM) *
well good thing i always wanted this but it makes me sad because this is not the way to present a script. Just see other examples to correct it.
Anyway i recomend to upload your demo in mediafire.
Well i put your script in mky game but it doesn´t appears the window, how do i make it to appear and where i put this script(all this things add it to tyhe topic).
Simply make your events do a 'call script' (event > page 3 > advanced (at the bottom) > Script... ) ( or put in another script ):

$scene = Scene_MemberSelect.new(use, var)

Use should be replaced with "name", "id" or "party".
Var should be a number, the same as the variable-number you want to store the information in. I don't know if you should start counting from 0 or from 1 though.. you'll have to experiment with that.


__________________________

>>Latest EventScripter news: Conditional Branches fully working! Currently working on a documentation site. Topic: EventScripter
>>Portals (yes, in RPG Maker VX!)
>>Working with Sojabird on his Scriptology; I also invented Scriptuzzle.. Try one; make one!
[Show/Hide] USEFULL script snippets:
[Show/Hide] Do require's in VX:
CODE
$LOAD_PATH << Dir.getwd #You only need to call this once
Kernel.require("includable.rb") #replace includable.rb with the name of the file you want to load
[Show/Hide] Invert Dash enabling:
CODE
#=============================================================================#
# # #                            ANTI DASH HACK                           # # #
# # #                              By AmIMeYet                            # # #
# # #                           please credit me                          # # #
#=============================================================================#
class Game_Player < Game_Character
  def dash?
    return false if @move_route_forcing
    return false if in_vehicle?
    return true if Input.press?(Input::A) and $game_map.disable_dash?
  end
end

This snippet basically inverts the dashing.. allowing you to dash only when 'disable dashing' is checked.
This way, normal maps disable dashing, but the ones you set to disable actually allow dashing..

It should be placed where you normally place the scripts ('above main', in the materials section of the scripts window)..
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 05:39 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker