Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My First Script
#1
My First Script
by :)smiley_man:)
Dec 24 2005


This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


This CMS is pretty cool what it does is show the battler instead of the sprite and the name of the map you are on

Screen
[Image: Screenof1CMS.jpg]


To use this script go into Window_Base and find
Code:
def draw_actor_graphic(actor, x, y)
   bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
   cw = bitmap.width / 4
   ch = bitmap.height / 4
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end

Underneath that put
Code:
def draw_actor_graphicx(actor, x, y)
   bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
   cw = bitmap.width / 1.25
   ch = bitmap.height / 2
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end

def draw_actor_graphicx2(actor, x, y)
   bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
   cw = bitmap.width / 1
   ch = bitmap.height / 1
   src_rect = Rect.new(0, 0, cw, ch)
   self.contents.blt(x - cw / 2, y, bitmap, src_rect)
end


Now go into Window_MenuStatus

find
Code:
draw_actor_graphic(actor, x - 40, y + 80)
and replace it with
Code:
draw_actor_graphicx(actor, x - 40, y + 80)


Now make a new script above main and put this in it
Code:
#====================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#====================================================

class Scene_Menu
#--------------------------------------------------------------------------
# * Object Initialization
#     menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
   @menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
   # Make command window
   s1 = $data_system.words.item
   s2 = $data_system.words.skill
   s3 = $data_system.words.equip
   s4 = "Status"
   s5 = "Save"
   s6 = "End Game"
   @command_window = Window_Command.new(155, [s1, s2, s3, s4, s5, s6])
   @command_window.index = @menu_index
   # If number of party members is 0
   if $game_party.actors.size == 0
     # Disable items, skills, equipment, and status
     @command_window.disable_item(0)
     @command_window.disable_item(1)
     @command_window.disable_item(2)
     @command_window.disable_item(3)
   end
   # If save is forbidden
   if $game_system.save_disabled
     # Disable save
     @command_window.disable_item(4)
   end
  
   @window2 = Window2.new
   @window2.x =0
   @window2.y =223
   @window2.height = 153 #257
   @window2.width = 155
  #@window2.z = 200
  
   @window3 = Window3.new
   @window3.x =0
   @window3.y =375
   @window3.height = 105
   @window3.width = 155
  #@window3.z = 200
  
   @window5 = Window_MenuStatus.new
   @window5.x =155
   @window5.y =0
   @window5.height = 480
   @window5.width = 485
  #@window5.z = 200
   # Execute transition
   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
   @command_window.dispose
   @window2.dispose
   @window3.dispose
   @window5.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
   # Update windows
   @command_window.update
   @window2.update
   @window3.update
   @window5.update
   # If command window is active: call update_command
   if @command_window.active
     update_command
     return
   end
   # If status window is active: call update_status
   if @window5.active
     update_status
     return
   end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Switch to map screen
     $scene = Scene_Map.new
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # If command other than save or end game, and party members = 0
     if $game_party.actors.size == 0 and @command_window.index < 4
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Branch by command window cursor position
     case @command_window.index
     when 0  # item
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to item screen
       $scene = Scene_Item.new
     when 1  # skill
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @window5.active = true
       @window5.index = 0
     when 2  # equipment
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @window5.active = true
       @window5.index = 0
     when 3  # status
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Make status window active
       @command_window.active = false
       @window5.active = true
       @window5.index = 0
     when 4  # save
       # If saving is forbidden
       if $game_system.save_disabled
         # Play buzzer SE
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to save screen
       $scene = Scene_Save.new
     when 5  # end game
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to end game screen
       $scene = Scene_End.new
     end
     return
   end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Make command window active
     @command_window.active = true
     @window5.active = false
     @window5.index = -1
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Branch by command window cursor position
     case @command_window.index
     when 1  # skill
       # If this actor's action limit is 2 or more
       if $game_party.actors[@window5.index].restriction >= 2
         # Play buzzer SE
         $game_system.se_play($data_system.buzzer_se)
         return
       end
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to skill screen
       $scene = Scene_Skill.new(@window5.index)
     when 2  # equipment
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to equipment screen
       $scene = Scene_Equip.new(@window5.index)
     when 3  # status
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Switch to status screen
       $scene = Scene_Status.new(@window5.index)
     end
     return
   end
end
end

#===================================================
# - CLASS Window2 Begins
#===================================================

class Window2 < Window_Base

def initialize
   super(0, 0, 1, 1)
   self.contents = Bitmap.new (width - 32, height - 32)
#    self.contents.font.name = $fontface
#    self.contents.font.size = $fontsize
   refresh
end

def refresh
   self.contents.clear
   self.contents.font.color = system_color
   self.contents.font.color = normal_color
   $maps = load_data("Data/MapInfos.rxdata")
   @map_id = $game_map.map_id
   @currmap = $maps[@map_id].name
   self.contents.font.size = 24
   self.contents.draw_text(4, 0, 120, 32, @currmap)
   #In the parenthesis put what you want
   self.contents.font.size = 14
end
end
#===================================================
# - CLASS Window2 Ends
#===================================================


#===================================================
# - CLASS Window3 Begins
#===================================================

class Window3 < Window_Base

#---------------------------------------------------------------------------------    
def initialize
   super(0, 0, 1, 1)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.contents.font.name = "Tahoma"
   self.contents.font.size = 22
   self.contents.font.color = text_color(0)
   #self.contents.draw_text(0, 0, 33, 33, "4")
   self.contents.draw_text(0, 0, 70, 20, "Gold")
   self.contents.draw_text(0, 0, 70, 65, $game_party.gold.to_s)
   self.contents.draw_text(65, 0, 140, 20, "Steps")
   self.contents.draw_text(65, 0, 140, 65, $game_party.steps.to_s)
end
#---------------------------------------------------------------------------------  

end
#===================================================
# - CLASS Window3 Ends
#===================================================

#===================================================
# - CLASS Window5 Begins
#===================================================

class Window5 < Window_Base

#---------------------------------------------------------------------------------    
def initialize
   super(0, 0, 1, 1)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.contents.font.name = "Tahoma"
   self.contents.font.size = 22
   self.contents.font.color = text_color(0)
   #self.contents.draw_text(0, 0, 33, 33, "5")
end
#---------------------------------------------------------------------------------
end

DEMO

.zip   CMS.zip (Size: 390.15 KB / Downloads: 2)
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Golden sun intro script AZZY9 0 2,012 07-22-2006, 01:00 PM
Last Post: AZZY9



Users browsing this thread: