Main Menu
  • Welcome to The RPG Maker Resource Kit.

Another CMS

Started by Rune, March 22, 2008, 11:40:23 AM

0 Members and 1 Guest are viewing this topic.

Rune

Obsession much?
I made another, and I'm pretty proud of this one ^_^

[spoiler=Screenies]
Command Menu Active


Status Window Active

[/spoiler]

Simply replace your current Scene_Menu with this:
[spoiler]#======================#
#     > CMS #5         #
#      > By Rune       #
#       > Ver. 1       #
#======================#

#---------------------Window_Base---------------------
#---------------------Battler display---------------------

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

#---------------------Name + Class display---------------------

  def draw_actor_name_menu(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 160, 32, actor.name, 1)
  end 
  def draw_actor_class(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 160, 32, actor.class_name, 1)
  end

#---------------------Level display---------------------

  def draw_actor_level(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, "Lv:")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 24, y, 24, 32, actor.level.to_s, 2)
  end

#---------------------EXP display---------------------

  def draw_actor_exp(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 608 / 4, 32, "EXP")
    self.contents.font.color = normal_color
    self.contents.draw_text(x - 16, y + 16, 84, 32, actor.exp_s, 2)
    self.contents.draw_text(x + 68, y + 16, 12, 32, "/", 1)
    self.contents.draw_text(x + 80, y + 16, 84, 32, actor.next_exp_s)
  end

#---------------------Equipment display---------------------

  def draw_item_name_menu(item, x, y)
    if item == nil
      return
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28, y, 608 / 4 - 28, 32, item.name)
  end
end


#---------------------Window_MenuStatus---------------------

class Window_MenuStatus < Window_Selectable
  def initialize
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = i * 608 / 4
      y = 0
      actor = $game_party.actors[i]
      draw_actor_graphic(actor, x + 12, y + 64)
      draw_actor_battler(actor, x + 75, y + 256, 160)
      self.contents.font.size = 28
      self.contents.font.name = "Monotype Corsiva"
      draw_actor_name_menu(actor, x - 10, y)
      self.contents.font.size = 24
      draw_actor_class(actor, x - 10, y + 32)
      draw_actor_level(actor, x + 2, y + 64)
      draw_actor_state(actor, x + 50, y + 64)
      draw_actor_hp(actor, x + 2, y + 208)
      draw_actor_sp(actor, x + 2, y + 224)
      draw_actor_exp(actor, x + 2, y + 240)
      self.contents.draw_text(0, 270, 608, 32, "=========================================================================================================================")
      draw_item_name_menu($data_weapons[actor.weapon_id], x + 2, y + 288)
      draw_item_name_menu($data_armors[actor.armor1_id], x + 2, y + 320)
      draw_item_name_menu($data_armors[actor.armor2_id], x + 2, y + 352)
      draw_item_name_menu($data_armors[actor.armor3_id], x + 2, y + 384)
      draw_item_name_menu($data_armors[actor.armor4_id], x + 2, y + 416)
    end
  end
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(@index * 608 / 4, 0, 608 / 4, self.height - 32)
    end
    if Input.repeat?(Input::RIGHT)
      if (@column_max == 1 and Input.trigger?(Input::RIGHT)) or
          @index < @item_max - @column_max
        $game_system.se_play($data_system.cursor_se)
        @index = (@index + @column_max) % @item_max
      end
    end
    if Input.repeat?(Input::LEFT)
      if (@column_max == 1 and Input.trigger?(Input::LEFT)) or
          @index >= @column_max
        $game_system.se_play($data_system.cursor_se)
        @index = (@index - @column_max + @item_max) % @item_max
      end
    end
  end
end


#---------------------Window_Gold---------------------

class Window_Gold < Window_Base
  def initialize
    super(0, 0, 160, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.name = "Monotype Corsiva"
    self.contents.font.size = 24
    self.contents.draw_text(0, 32, 128, 32, $game_party.gold.to_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 128, 32, $data_system.words.gold)
  end
end


#---------------------Window_PlayTime---------------------

class Window_PlayTime
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.font.name = "Monotype Corsiva"
    self.contents.font.size = 24
    self.contents.draw_text(4, 0, 120, 32, "Play Time")
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 32, 120, 32, text, 2)
  end
end


#---------------------Window_Command---------------------

class Window_Command
  def refresh
    self.contents.clear
    for i in 0...@item_max
      self.contents.font.name = "Monotype Corsiva"
      self.contents.font.size = 24
      draw_item(i, normal_color)
    end
  end
end


#---------------------Window_Location---------------------

$data_mapinfos = load_data('Data/MapInfos.rxdata')

class Window_Location < Window_Base
  def initialize
    super(0, 0, 320, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.name = "Monotype Corsiva"
    self.contents.font.size = 24
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 80, 32, "Location:")
    self.contents.font.color = normal_color
    name = $data_mapinfos[$game_map.map_id].name 
    self.contents.draw_text(96, 0, 192, 32, name)
  end
end

#---------------------Window_GameName---------------------

class Window_GameName < Window_Base
  def initialize
    super(0, 0, 320, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.name = "Monotype Corsiva"
    self.contents.font.size = 24
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 288, 32, "Insert Name Of Game", 1)
  end
end


#---------------------Scene_Menu---------------------

class Scene_Menu
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  def main
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Save Game"
    s6 = "End Game"
    @status_window = Window_MenuStatus.new
    @status_window.x = 0
    @status_window.y = 0
    @status_window.contents_opacity = 44
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 160
    @playtime_window.y = 320
    @playtime_window.visible = true
    @gold_window = Window_Gold.new
    @gold_window.x = 320
    @gold_window.y = 320
    @gold_window.visible = true
    @loc_window = Window_Location.new
    @loc_window.x = 0
    @loc_window.y = 416
    @loc_window.visible = true
    @gn_window = Window_GameName.new
    @gn_window.x = 320
    @gn_window.y = 416
    @gn_window.visible = true
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    @command_window.x = 240
    @command_window.y = 128
    @command_window.height = 32 * 6 + 1
    @command_window.visible = true
    if $game_party.actors.size == 0
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    if $game_system.save_disabled
      @command_window.disable_item(4)
    end
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
    @loc_window.dispose
    @gn_window.dispose
    @playtime_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  def update
    @command_window.update
    @loc_window.update
    @gn_window.update
    @playtime_window.update
    @gold_window.update
    @status_window.update
    if @command_window.active
      update_command
      return
    end
    if @status_window.active
      update_status
      return
    end
  end
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      if $game_party.actors.size == 0 and @command_window.index < 4
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @command_window.index
      when 0
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Item.new
      when 1
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @command_window.visible = false
        @gold_window.visible = false
        @playtime_window.visible = false
        @loc_window.visible = false
        @gn_window.visible = false
        @status_window.contents_opacity = 256
        @status_window.active = true
        @status_window.index = 0
      when 2
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @command_window.visible = false
        @gold_window.visible = false
        @playtime_window.visible = false
        @loc_window.visible = false
        @gn_window.visible = false
        @status_window.contents_opacity = 256
        @status_window.active = true
        @status_window.index = 0
      when 3
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @command_window.visible = false
        @gold_window.visible = false
        @playtime_window.visible = false
        @loc_window.visible = false
        @gn_window.visible = false
        @status_window.contents_opacity = 256
        @status_window.active = true
        @status_window.index = 0
      when 4
        if $game_system.save_disabled
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Save.new
      when 5
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_End.new
      end
      return
    end
  end
  def update_status
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = true
      @command_window.visible = true
      @gold_window.visible = true
      @playtime_window.visible = true
      @loc_window.visible = true
      @gn_window.visible = true
      @status_window.contents_opacity = 64
      @status_window.active = false
      @status_window.index = -1
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
      when 1
        if $game_party.actors[@status_window.index].restriction >= 2
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Skill.new(@status_window.index)
      when 2
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Equip.new(@status_window.index)
      when 3
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Status.new(@status_window.index)
      end
      return
    end
  end
end
[/spoiler]

It should be plug-n-play, so enjoy!

NOTE: If you can't see the font, download it, and put it in your computer's 'Fonts' folder.
Linky >> http://www.newfonts.net/index.php?pa=show_font&id=130

Any problems, or queries, reply here, or contact me. ;)
Sincerely,
Your conscience.

modern algebra

That does look pretty cool. Hard to read some of the words at points, but otherwise very nice CMS Rune.

Rune

Thanks ;8
Whereabouts are you finding it hard to read?
Sincerely,
Your conscience.

modern algebra

HP of Basil, Location Window, etc... It's not a big deal, just text over text or picture can be hard to read.

Rune

Ah, fair enough, I tried fading the battler pictures, to make the text more readable, but couldn't  because of the way I've faded everything else in that window. I'd make another window in the background that matches itself to the index of Window_MenuStatus and put them in there, if I knew how. :-\
As for the other things, I might decrease the opacity of those items in the status window further, maybe to 32, rather than 48, to make the text in the windows on top more readable. Whaddya think?
Sincerely,
Your conscience.

Demonic Blade

I like it, but it looks "wrong" to me that the main screen is faded when that other mini-menu comes up... And there's far too much text. I'd either cut away some less important details and have those in a Status Screen, or rather make bars for HP, SP and exp.
Still, I like it, like the others. Please make more CMS', they're real cool :D
I wonder how many of my-reps are there for a reason, and not just because some jackass wanted to show off in front of some other jackasses...?
Probably a lot of them - and those people sure as hell don't deserve my pity, let alone my disgust.
That's right, let's see some more -Rep'ing! BOOYEAH!!

Rune

Thanks ;8 But the Equipment is one of the main reasons I'm proud of this one, and everything else seems necessary.
Thanks for the comments guys! ;8 Much appreciated.
Sincerely,
Your conscience.

Demonic Blade

I wasn't talking about the equipment (I like that too). I meant maybe some of the Health and SP (whatever that stands for...) and EXP could be changed to bars, and maybe the lvl could be changed to another color (or sth to make it more visible...). And the status of the characters could be changed to icons (You're the one who made the icons in the menu script, right...?). Just suggestions. I just do NOT want you change something you'd rather not 'cuz you like it that way!
I wonder how many of my-reps are there for a reason, and not just because some jackass wanted to show off in front of some other jackasses...?
Probably a lot of them - and those people sure as hell don't deserve my pity, let alone my disgust.
That's right, let's see some more -Rep'ing! BOOYEAH!!

Rune

How do you mean, the 'status of the characters'? Do you mean HP, SP and EXP Icons? That would be possible, but it would get cluttered because of the spacing in between them. Correct me if I'm wrong though. ;)
Sincerely,
Your conscience.

Demonic Blade

I meant the [Normal] part. Their status. Changing that to non-transparent and colourful icons would be good. But that's just my suggestion :)
I wonder how many of my-reps are there for a reason, and not just because some jackass wanted to show off in front of some other jackasses...?
Probably a lot of them - and those people sure as hell don't deserve my pity, let alone my disgust.
That's right, let's see some more -Rep'ing! BOOYEAH!!

Rune

Maybe, it's a possibility :P
Sincerely,
Your conscience.

Sx2

wow this looks sweet!

Rune rocks :)
Super Smash Bros. Brawl - Kirby Player
Brawl Code - 1375-6864-5199
PM to Brawl me

Demonic Blade

I wonder how many of my-reps are there for a reason, and not just because some jackass wanted to show off in front of some other jackasses...?
Probably a lot of them - and those people sure as hell don't deserve my pity, let alone my disgust.
That's right, let's see some more -Rep'ing! BOOYEAH!!

Sx2

to fix some problems you could take out the character sprites then move the Lv next to the Class name then move the status to the right where there seems to be more room then you could even move the name, status, class, and level up a bit to get it out of he way.
Super Smash Bros. Brawl - Kirby Player
Brawl Code - 1375-6864-5199
PM to Brawl me

Rune

I might do, The status is what I have most trouble seeing tbh :P I don't see the point in moving anything up, other than the Lv.
Sincerely,
Your conscience.

Bernkastel

#15
Uh-oh!

I found a booboo!

How do I make MY status screen look like YOUR'S?

(Not the windowskins obviously :P but the way your characters have your equipment and their battle pictures)

Please help >.<

here's what mine looks like:


Rune

I'm not sure I understand exactly what you want, but I have an idea.
You're saying you want the same status window as I've got, with the characters placed horizontally next to each other and their equipment displayed underneath, right?
Sincerely,
Your conscience.

Bernkastel

Yes!

That's exactly what I want.

Can you manage?

Rune

That's included in the script. Maybe you didn't copy the whole of it.

Paste it in again and see if it works.
Sincerely,
Your conscience.

Bernkastel

#19
:[

I tried, and still nada.

EDIT: Ah, well I found the problem.

It was canceled out from my party switcher.. with my Party switching menu thingy..

Any way this could be fixed? :[

Rune

It would most likely need an edit of the party switcher. I'm afraid to say I haven't worked with party switchers at all yet, so I won't be able to help you any time soon, maybe someone else could?
Sincerely,
Your conscience.

Hanku2691

Umm when i try to open the menu i get an error message.



This is the line it has a problem with and i don't know why?

      draw_actor_battler(actor, x + 75, y + 256, 160)

Please help.

antionATTACK


Rune

@Hanku - Sorry for the slow reply, haven't been on here in what would seem like months. I haven't touched a script in a long while, so I might be a little while working this one out, though I have a vague idea of what's wrong. I'll get back to you.
Sincerely,
Your conscience.

Rune

Okay, I'm not sure how, but you may have not copied the whole script. Try re-inserting it.

On another theory, what other scripts are you using? Can you link me to each of them so I can have a look please?
Sincerely,
Your conscience.