[XP] cstb's 3 Actor CMS

Started by cstb, November 27, 2008, 06:41:52 am

Previous topic - Next topic

cstb

November 27, 2008, 06:41:52 am Last Edit: February 21, 2009, 06:04:52 am by shdwlink1993
cstb's 3 Actor CMS
Authors: cstb
Version: 1.0
Type: CMS with add ons
Key Term: Custom Menu System



Introduction

This CMS features showing the map name and notes in the menu.


Features


  • Can take notes
  • Shows map name
  • Unique Style



Screenshots

I am kinda lazy to go make a photobucket account to show some screenes and I don't have alot of time now anyways


Demo

None Needed.


Script

Spoiler: ShowHide
#=============================================================================#
# ** cstb's 3 Actor Menu System                                               #
#-----------------------------------------------------------------------------#
# This is my first script and wont work with any other CMS out there.         #
#I changed the places of some windows and added a map name box.to use the map #
#name box put an event into the map and have it type in the name of actor 10. #
#                                                                             #
#=============================================================================#
#==============================================================================
# ** Window_Notes
#------------------------------------------------------------------------------
#  This window can be used to take notes.
#==============================================================================
class Window_Notes < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 643, 60)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, "Notes:")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 250, 32, $game_actors[11].name, 2)
    self.contents.draw_text(4, 0, 450, 32, $game_actors[12].name, 2)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end
#==============================================================================
# ** Window_OtherStatus
#------------------------------------------------------------------------------
#  This window displays Other Stats in your game.
#==============================================================================
class Window_OtherStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 170, 150)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, "Map")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 32, 120, 32, $game_actors[10].name, 2)
    self.contents.font.color = system_color
    self.contents.font.color = system_color
    self.contents.draw_text(4, 64, 120, 32, "Step Count")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 96, 120, 32, $game_party.steps.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end
#==============================================================================
# ** 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 = "Notes"
    s6 = "Save"
    s7 = "Quit Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    @command_window.x = 475
    @command_window.y = 150
    # 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
    # Make Playtime window
    @time_window = Window_PlayTime.new
    @time_window.x = 150
    @time_window.y = 335
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 300
    @gold_window.y = 365
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 0
    @status_window.y = 0
    # Make Stat window
    @stat_window = Window_OtherStatus.new
    @stat_window.x = 475
    # Make Note window
    @notes_window = Window_Notes.new
    @notes_window.y = 425
    # 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
    @gold_window.dispose
    @status_window.dispose
    @stat_window.dispose
    @notes_window.dispose
    @time_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @gold_window.update
    @status_window.update
    @stat_window.update
    @notes_window.update
    @time_window.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 @status_window.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
        @status_window.active = true
        @status_window.index = 0
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4  # Notes Line 1
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $game_temp.name_actor_id = 11 # The actor id the database
        $game_temp.name_max_char = max_character_in_length = 15#this cannot exceed 16
        $scene = Scene_Name.new
      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 6  # 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
      @status_window.active = false
      @status_window.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[@status_window.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(@status_window.index)
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(400, 0, 475, 360)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 116
      actor = $game_party.actors[i]
      draw_actor_graphic(actor, x + 0, y + 50)
      draw_actor_name(actor, x - 50, y)
      draw_actor_class(actor, x + 200, y)
      draw_actor_level(actor, x + 100, y)
      draw_actor_state(actor, x + 90, y + 32)
      draw_actor_exp(actor, x + 100, y + 64)
      draw_actor_hp(actor, x + 200, y + 32)
      draw_actor_sp(actor, x + 236, y + 42)
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
    end
  end
end



Instructions
Showing Map:
Step 1:To show the map name you need slot 10 in your actors slot free.
Step 2:Make a event in every map to change the name of actor 10 to the name of the map.
Making Notes:
Step 1:Make Actors 11 & 12 available.
Now for every important event/side quest change actor 12's name to a note for that quest.
Actor 11 is there for you to make manual notes.Select Notes from the menu to make some notes!


Compatibility

I have tried with alot of scripts and it will work with any script out there other than something that interferes with the CMS other than tons.


Credits and Thanks


  • Me for creating the system
  • Juan for helping with the notes system



Author's Notes

Im sorry for making all these requests so i decided to contribute!
Chronos: Failed project due to loss of data.
Maybe I could try again...


Which Final Fantasy Character Are You?
Final Fantasy 7

G_G

I am going to say what Juan told me
instead of using actor slots like this
$data_actors[11].name
do this
$notes = "Note here"
and make an event that says this so it will change
Event:
Use Script Command
$notes = "Remember to deliver mail."
Slef Switch A On or something

cstb

Quote from: game_guy on November 28, 2008, 01:37:40 am
I am going to say what Juan told me
instead of using actor slots like this
$data_actors[11].name
do this
$notes = "Note here"
and make an event that says this so it will change
Event:
Use Script Command
$notes = "Remember to deliver mail."
Slef Switch A On or something

Yea I know about that but the notes command thats included is what you use.You manually put in the notes by yourself.
Chronos: Failed project due to loss of data.
Maybe I could try again...


Which Final Fantasy Character Are You?
Final Fantasy 7

Hellfire Dragon

November 30, 2008, 09:37:27 am #3 Last Edit: November 30, 2008, 09:38:31 am by Hellfire Dragon
Got an error when I tried to open the menu;
Spoiler: ShowHide


Oh and,
QuoteI am kinda lazy to go make a photobucket account to show some screenes

Just use Imageshack you don't need an account to host pics there.

cstb

November 30, 2008, 10:27:35 am #4 Last Edit: November 30, 2008, 10:29:28 am by cstb
Quote from: Hellfire Dragon on November 30, 2008, 09:37:27 am
Got an error when I tried to open the menu;
Spoiler: ShowHide


Oh and,
QuoteI am kinda lazy to go make a photobucket account to show some screenes

Just use Imageshack you don't need an account to host pics there.
Oh yea that was the version i was using with my game and Tons.Let me fix that...
EDIT: Fixed!
Chronos: Failed project due to loss of data.
Maybe I could try again...


Which Final Fantasy Character Are You?
Final Fantasy 7

Hellfire Dragon

November 30, 2008, 12:31:39 pm #5 Last Edit: November 30, 2008, 12:32:56 pm by Hellfire Dragon
Okay... well, it works but,
Spoiler: ShowHide

I'm not liking the look of the menu right now :P

cstb

Quote from: Hellfire Dragon on November 30, 2008, 12:31:39 pm
Okay... well, it works but,
Spoiler: ShowHide

I'm not liking the look of the menu right now :P
Well it looks good with my game probably because of the faces and HP bars :P.Its just a different layout and has some notes with it.That's all pretty much.Fix it up with tons then tell me if it sucks then :ninja:
Chronos: Failed project due to loss of data.
Maybe I could try again...


Which Final Fantasy Character Are You?
Final Fantasy 7