Character Select Script
#1
Character Select Script
by Selwyn


INTRODUCTION
Selwyn @ HBGames.Org Mon Jun 19, 2006 Wrote:~~requested by Hitomi Kamimura~~

this allows you to make a party by selecting the characters that will be in it.

paste the script in a new section above main


SCREENSHOTS
[Image: chselect.PNG]


SCRIPT
The Script


HOW TO USE
first, you need to decide what characters you will display on the select screen, go in the database and write down the id of the characters you want.
(example : 1 arshes, 7 gloria, etc...)

once you have those number, use the call script command in an event, and write them in that way : (I took some other to have 6 characters)

Code:
ids = [1, 7, 5, 6, 4, 2]
then, you have to decide how many characters the player will be able to add to the party, let's say 4
so add this after the 'ids = ' thing :
Code:
$scene = Scene_CharSelect.new(ids, 4)
which should look like this :
Code:
ids = [1, 7, 5, 6, 4, 2]
$scene = Scene_CharSelect.new(ids, 4)
and that's done.


TERMS AND CONDITIONS
Enjoy, Give Credit.
Reply }
#2
I sorta love this script, but big problem I see...

when you want to choose from more than 6 IDs, the main window that "SHOULD" scroll down to show all the characters, does not. I also can't see why it can't Any reason why?
[Image: yy7iKKb.png]

ITCH: jayray.itch.io
Currently working on Goblin Gulch (MV)
Currently working on JayVinci Resurrection
Currently working on Bakin ABS (BAKIN)
Reply }
#3
Because Selwyn did not include redesigned versions of the 'top_row', the 'top_row=' and 'page_row_max' methods within Window_CharSelect. Couple that with a incorrectly designed 'update_cursor_rect' because he DID neglect to include reference to the redesiged methods.

So.... add the following methods to Window_CharSelect:
Code:
#--------------------------------------------------------------------------
  # * Get Top Row
  #--------------------------------------------------------------------------
  def top_row
    # Divide y-coordinate of window contents transfer origin by 1 row
    # height of 192
    return self.oy / 192
  end  
  #--------------------------------------------------------------------------
  # * Set Top Row
  #     row : row shown on top
  #--------------------------------------------------------------------------
  def top_row=(row)
    # If row is less than 0, change it to 0
    if row < 0
      row = 0
    end
    # If row exceeds row_max - 1, change it to row_max - 1
    if row > row_max - 1
      row = row_max - 1
    end
    # Multiply 1 row height by 32 for y-coordinate of window contents
    # transfer origin
    self.oy = row * 192
  end
  #--------------------------------------------------------------------------
  # * Get Number of Rows Displayable on 1 Page
  #--------------------------------------------------------------------------
  def page_row_max
    # Subtract a frame height of 32 from the window height, and divide it by
    # 1 row height of 32
    return (self.height - 32) / 192
  end

And replace the 'update_cursor_rect' in the class with THIS one:
Code:
#--------------------------------------------------------------------------
  # (>^_^)>   update_cursor_rect
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = @index / @column_max
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end    
    # Calculate cursor width
    cursor_width = self.width / @column_max - 32
    # Calculate cursor coordinates
    x = @index % @column_max * (148 + 1)
    y = @index / @column_max * 192 - self.oy
    # Update cursor rectangle
    self.cursor_rect.set(x, y, 149, 192)
  end

5 minutes bay bee.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#4
You..... are awesome, you know that?
[Image: yy7iKKb.png]

ITCH: jayray.itch.io
Currently working on Goblin Gulch (MV)
Currently working on JayVinci Resurrection
Currently working on Bakin ABS (BAKIN)
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Text Scroll Script - Enhanced DerVVulfman 23 34,180 02-18-2021, 04:16 AM
Last Post: DerVVulfman
   Cursor Script Selwyn 7 15,278 09-28-2019, 02:13 PM
Last Post: DerVVulfman
   ACBS FIX SCRIPT #2: Advanced Cry Correction DerVVulfman 1 4,755 08-09-2019, 03:42 PM
Last Post: aeliath
   ACBS FIX SCRIPT #1: Victory Cries Patch DerVVulfman 1 4,697 08-08-2019, 02:53 PM
Last Post: aeliath
   Spritesheet Generator Conversion Script DerVVulfman 0 4,230 11-21-2018, 04:48 AM
Last Post: DerVVulfman
   Neo Mode 7 Script by MGCaladtogel MGC 59 125,024 09-29-2017, 03:48 AM
Last Post: DerVVulfman
   Longer Script Calls LiTTleDRAgo 0 4,945 05-17-2017, 12:36 AM
Last Post: LiTTleDRAgo
   SLOLS: Snake Look-alike on Load Script Zeriab 3 11,241 05-14-2017, 06:25 PM
Last Post: LiTTleDRAgo
   ELSA (Event Layering Script Advance) JayRay 0 5,984 02-25-2015, 04:15 AM
Last Post: JayRay
   Random Map Generator Script Tonbi 30 54,704 02-13-2014, 06:47 PM
Last Post: ShadowIce



Users browsing this thread: 2 Guest(s)