Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - need help streamlining this script

Save-Point

Full Version: need help streamlining this script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
#==============================================================================

# Character biography screens    Ver. 1.2    by Claimh

# Translated by TruthfulTiger

#------------------------------------------------------------------------------

# This will display character properties in a new status screen.

#   To access it, go into your existing status screen in the usual way,

#   then press the decision key. You will then be greeted with a short

#   biography of your selected character.

#   The default stats are: Name, Age, From, Height and Weight, but you can change

#   them to anything you want. You can also change the colour of the heading text.

#==============================================================================



#----------------------------------------------------------------------------

#   ƒJƒXƒ^ƒ}ƒCƒYSTART

#----------------------------------------------------------------------------

#--------------------------------------------------------------------------

# This is where you determine the characters' ages. There's spaces for eight,

# although you can add more. Each "??" is where you set the age, in order of

# where your characters are in the database. I.e, the first "??" is for character one,

# the "??" after that is for character two, etc.

#--------------------------------------------------------------------------

CHARA_AGE = ["Eh","Eh","Eh","??","??","??","??","??"]

#--------------------------------------------------------------------------

# This is where you set where each of your characters comes from. Same applies

# as for age, i.e in order of characters in the database.

#--------------------------------------------------------------------------

CHARA_FROM = ["Farton Orphanage","Some Other Place","Solumon's Maze","??","??","??","??","??"]

#--------------------------------------------------------------------------

# This is character height by default. I changed this to "Lives in".

#--------------------------------------------------------------------------

CHARA_H = ["28","??","??","??","??","??","??","??"]

#--------------------------------------------------------------------------

# This is character weight by default. I changed mine to "Race". Again, same as for

# age, and you can set this to whatever you want.

#--------------------------------------------------------------------------

CHARA_W = ["5'6","5'8","5'0 x 5'0 x 5'0","??","??","??","??","??"]

#--------------------------------------------------------------------------

# This is character weight by default. I changed mine to "Race". Again, same as for

# age, and you can set this to whatever you want.

#--------------------------------------------------------------------------

CHARA_AFF = ["140","180","300","??","??","??","??","??"]

#--------------------------------------------------------------------------

# This is where you add a few lines to briefly describe your character.

# Again, it follows character position in database.

# L1, L2 and L3 display text on lines 1, 2 and 3 respectively.

#--------------------------------------------------------------------------

# Hero 1 description

L1 = ""               # Line 1 of description

L2 = ""               # Line 2 of description

L3 = " # Line 3 of description

L4 = "anymore. Now that she found it was hidden nearby she is off."

L5 = "Her name is a Latin word meaning 'A guardian of the sacred fire.'"

L6 = ""

L_SET1 = [L1, L2, L3, L4, L5, L6]  # This groups together the lines and displays them - you can # add more

L1 = ""               # Line 1 of description

L2 = ""               # Line 2 of description

L3 = ""

L4 = ""

L5 = ""

L6 = ""

# Hero 2 description

L_SET2 = [L1, L2, L3, L4, L5, L6]  # This groups together the lines and displays them

# Hero 3 description

L1 = ""               # Line 1 of description

L2 = " "               # Line 2 of description

L3 = ""

L4 = ""

L5 = "fears with food."

L6 = " His name is an English wrod meaning 'To chew or bite on noisily'"

L_SET3 = [L1, L2, L3, L4, L5, L6]  # This groups together the lines and displays them

# Hero 4 description

L1 = ""               # Line 1 of description

L2 = ""               # Line 2 of description

L3 = ""               # Line 3 of description

L_SET4 = [L1, L2, L3]  # This groups together the lines and displays them

# Hero 5 description

L1 = ""               # Line 1 of description

L2 = ""               # Line 2 of description

L3 = ""               # Line 3 of description

L_SET5 = [L1, L2, L3]  # This groups together the lines and displays them

# Hero 6 description

L1 = ""               # Line 1 of description

L2 = ""               # Line 2 of description

L3 = ""               # Line 3 of description

L_SET6 = [L1, L2, L3]  # This groups together the lines and displays them

# Hero 7 description

L1 = "—BˆêA‰ñ•œ–‚–@‚ªŽg‚¦‚é‚̂ŁAd•ó‚³‚ê‚élB"               # Line 1 of description

L2 = ""               # Line 2 of description

L3 = ""               # Line 3 of description

L_SET7 = [L1, L2, L3]  # This groups together the lines and displays them

# Hero 8 description

L1 = "Insert the first line of your description here"               # Line 1 of description

L2 = "Insert the second line of your description here"            #Line 2 of description

L3 = ""               # Line 3 of description

L_SET8 = [L1, L2, L3]  # This groups together the lines and displays them



# This sets the variable CHARA_INFO to the different sets for each character

CHARA_INFO = [L_SET1,L_SET2,L_SET3,L_SET4,L_SET5,L_SET6,L_SET7,L_SET8]



#----------------------------------------------------------------------------

#   ƒJƒXƒ^ƒ}ƒCƒYEND

#----------------------------------------------------------------------------



#==============================================================================

# ¡ Window_Charactor

#------------------------------------------------------------------------------

# @ƒLƒƒƒ‰Ð‰î‰æ–Ê

#==============================================================================



class Window_Charactor < Window_Base

#--------------------------------------------------------------------------

# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»

#     actor : ƒAƒNƒ^[

#--------------------------------------------------------------------------

def initialize(actor)

   super(0, 0, 640, 480)

   self.contents = Bitmap.new(width - 32, height - 32)

   @actor = actor

   refresh

end

#--------------------------------------------------------------------------

# œ ƒŠƒtƒŒƒbƒVƒ…

#--------------------------------------------------------------------------

def refresh

   self.contents.clear

   draw_battler_graphics(@actor, 100, 200) # Draws the battler on screen

   self.contents.font.color.set( 200, 0, 255) # Changes the heading colours

   self.contents.draw_text(250, 10, 40, 32, "Name") # Change these to suit

   self.contents.draw_text(250, 50, 40, 32, "Language: Meaning")

   self.contents.draw_text(250, 90, 40, 32, "Home")

   self.contents.draw_text(250, 130, 40, 32, "Age")

   self.contents.draw_text(250, 170, 40, 32, "Height")

   self.contents.draw_text(250, 200, 40, 32, "Weight")

   self.contents.font.color = normal_color # Sets text to normal colour

   draw_actor_name(@actor, 350, 10) # Writes the variables you set earlier

   draw_actor_age(@actor, 350, 50)

   draw_actor_from(@actor, 350, 90)

   draw_actor_height(@actor, 350, 130)    

   draw_actor_weight(@actor, 350, 170)

   draw_actor_affinity(@actor, 350, 200)

   draw_actor_other(@actor, 50, 250)

end

end



class Window_Base < Window

#--------------------------------------------------------------------------

# Draws the character picture

#--------------------------------------------------------------------------

def draw_battler_graphics(actor, x, y)

   battler=RPG::Cache.battler(actor.battler_name, actor.battler_hue) # Sets the  battler graphic to be drawn

   w = battler.width

   h = battler.height

   self.contents.blt(x-w/2, y-h, battler, Rect.new(0, 0, w,h))

end



#--------------------------------------------------------------------------

# Draws the character's age

#--------------------------------------------------------------------------

def draw_actor_age(actor, x, y)

   self.contents.draw_text(x, y, 80, 32, CHARA_AGE[actor.id-1])

end



#--------------------------------------------------------------------------

# Draws the character's "From" attribute

#--------------------------------------------------------------------------

def draw_actor_from(actor, x, y)

   self.contents.draw_text(x, y, 180, 32, CHARA_FROM[actor.id-1])

end



#--------------------------------------------------------------------------

# Draws the character's "Height"

#--------------------------------------------------------------------------

def draw_actor_height(actor, x, y)

   self.contents.draw_text(x, y , 200, 32, CHARA_H[actor.id-1])

end



#--------------------------------------------------------------------------

# Draws the character's weight

#--------------------------------------------------------------------------

def draw_actor_weight(actor, x, y)

   self.contents.draw_text(x, y, 250, 32, CHARA_W[actor.id-1])

end

#--------------------------------------------------------------------------

# Draws the character's affinity

#--------------------------------------------------------------------------

def draw_actor_affinity(actor, x, y)

   self.contents.draw_text(x, y, 300, 32, CHARA_AFF[actor.id-1])

end

#--------------------------------------------------------------------------

# Draws the character's description - line numbers start from 0

#--------------------------------------------------------------------------

def draw_actor_other(actor, x, y)

   info = CHARA_INFO[actor.id-1]

   self.contents.draw_text(x, y, 600, 32, info[0])

   self.contents.draw_text(x, y+20, 600, 32, info[1])

   self.contents.draw_text(x, y+40, 600, 32, info[2])

   self.contents.draw_text(x, y+60, 600, 32, info[3])

   self.contents.draw_text(x, y+80, 600, 32, info[4])

   self.contents.draw_text(x, y+80, 600, 32, info[5])

end

end





#==============================================================================

# ¡ Scene_Charactor

#------------------------------------------------------------------------------

# @ƒLƒƒƒ‰Ð‰î‰æ–ʂ̏ˆ—‚ðs‚¤ƒNƒ‰ƒX‚Å‚·B

#==============================================================================



class Scene_Charactor

#--------------------------------------------------------------------------

# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»

#     actor_index : ƒAƒNƒ^[ƒCƒ“ƒfƒbƒNƒX

#--------------------------------------------------------------------------

def initialize(actor_index = 0, equip_index = 0)

   @actor_index = actor_index

end

#--------------------------------------------------------------------------

# œ ƒƒCƒ“ˆ—

#--------------------------------------------------------------------------

def main

   # ƒAƒNƒ^[‚ðŽæ“¾

   @actor = $game_party.actors[@actor_index]

   # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðì¬

   @status_window = Window_Charactor.new(@actor)

   # ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŽÀs

   Graphics.transition

   # ƒƒCƒ“ƒ‹[ƒv

   loop do

     # ƒQ[ƒ€‰æ–Ê‚ðXV

     Graphics.update

     # “ü—͏î•ñ‚ðXV

     Input.update

     # ƒtƒŒ[ƒ€XV

     update

     # ‰æ–Ê‚ªØ‚è‘Ö‚í‚Á‚½‚烋[ƒv‚ð’†’f

     if $scene != self

       break

     end

   end

   # ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“€”õ

   Graphics.freeze

   # ƒEƒBƒ“ƒhƒE‚ð‰ð•ú

   @status_window.dispose

end

#--------------------------------------------------------------------------

# Checks for buttons pressed; if "R" is pressed it goes onto the next character

#--------------------------------------------------------------------------

def update

   # B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡

   if Input.trigger?(Input::B)

     # ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t

     $game_system.se_play($data_system.cancel_se)

     # ƒƒjƒ…[‰æ–ʂɐ؂è‘Ö‚¦

     $scene = Scene_Menu.new(3)

     return

   end

   # R ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡

   if Input.trigger?(Input::R)

     # ƒJ[ƒ\ƒ‹ SE ‚ð‰‰‘t

     $game_system.se_play($data_system.cursor_se)

     # ŽŸ‚̃AƒNƒ^[‚Ö

     @actor_index += 1

     @actor_index %= $game_party.actors.size

     # •Ê‚̃Lƒƒƒ‰Ð‰î‰æ–ʂɐ؂è‘Ö‚¦

     $scene = Scene_Charactor.new(@actor_index)

     return

   end

   # L ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡

   if Input.trigger?(Input::L)

     # ƒJ[ƒ\ƒ‹ SE ‚ð‰‰‘t

     $game_system.se_play($data_system.cursor_se)

     # ‘O‚̃AƒNƒ^[‚Ö

     @actor_index += $game_party.actors.size - 1

     @actor_index %= $game_party.actors.size

     # •Ê‚̃Lƒƒƒ‰Ð‰î‰æ–ʂɐ؂è‘Ö‚¦

     $scene = Scene_Charactor.new(@actor_index)

     return

   end

end

end





#==============================================================================

# ¡ Scene_Status

#------------------------------------------------------------------------------

# @Œˆ’èƒ{ƒ^ƒ“‚ŃLƒƒƒ‰Ð‰î‰æ–Ê‚Ö

#==============================================================================



class Scene_Menu

#--------------------------------------------------------------------------

# This applies to the existing status window, and opens the bios if the decision key's pressed

#--------------------------------------------------------------------------

alias update_chara update

def update

   # C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡

   if Input.trigger? (Input::B)

      $scene = Scene_Menu.new(4)

       return

     end

   update_chara

end

end