Notice: fwrite(): Write of 2000 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
A brand new, shiny CMS [Update: Edit logo in-game]
Main Menu
  • Welcome to The RPG Maker Resource Kit.

A brand new, shiny CMS [Update: Edit logo in-game]

Started by Rune, February 23, 2008, 03:01:02 PM

0 Members and 5 Guests are viewing this topic.

Rune

I'm back, with a new CMS too.
Again, only simple, take a look at the features:

Location window.
Display name of your game at the top.
Inlcude a logo for your game (No more than 220 x 288 pixels). I have used FFXII as an example.
Unlimited commands, any number over 6 will make the command window scrolling.

[spoiler=Screeny]

[/spoiler]

[spoiler=Code]

#==============#
#=>  CMS #3  <=#
#=>   Rune   <=#
#=> Feb 2008 <=#
#==============#
$LOGO = RPG::Cache.picture("Logo")

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

class Window_Steps
  def initialize
    super(0, 0, 410, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
  contents.clear
  contents.font.color = system_color
  contents.draw_text(0, 0, 378, 32, 'Location', 1)
  contents.font.color = normal_color
  name = $data_mapinfos[$game_map.map_id].name 
  contents.draw_text(0, 32, 378, 32, name, 1)
  end
end

class Window_GName < Window_Base
  def initialize
    super(0, 0, 250, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 218, 32, "Insert Game Name Here", 1)
  end
end

class Window_GLogo < Window_Base
  def initialize
    super(0, 0, 250, 320)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.blt(0, 0, $LOGO, Rect.new(0, 0, 220, 288))
  end
end

class Window_MenuStatus < Window_Selectable
  def initialize
    super(0, 0, 230, 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 = 64
      y = i * 116
      actor = $game_party.actors[i]
      draw_actor_graphic(actor, x - 40, y + 75)
      draw_actor_name(actor, x - 60, y - 5)
      draw_actor_class(actor, x - 20, y + 19)
      draw_actor_level(actor, x + 30, y - 5)
      draw_actor_state(actor, x + 54, y + 19)
      draw_actor_hp(actor, x - 16, y + 43)
      draw_actor_sp(actor, x - 16, y + 67)
    end
  end
  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

class Scene_Menu
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  def main
    s1 = "Inventory"
    s2 = "Techniques"
    s3 = "Equipment"
    s4 = "Status"
    s5 = "Save Game"
    s6 = "Quit Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    @command_window.x = 480
    @command_window.height = 32 * 7 + 1
    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
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 480
    @playtime_window.y = 288
    @steps_window = Window_Steps.new
    @steps_window.x = 230
    @steps_window.y = 384
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 224
    @status_window = Window_MenuStatus.new
    @status_window.x = 0
    @status_window.y = 0
    @gnam_window = Window_GName.new
    @gnam_window.x = 230
    @gnam_window.y = 0
    @glog_window = Window_GLogo.new
    @glog_window.x = 230
    @glog_window.y = 64
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @gnam_window.dispose
    @glog_window.dispose
  end
  def update
    @command_window.update
    @playtime_window.update
    @steps_window.update
    @gold_window.update
    @status_window.update
    @gnam_window.update
    @glog_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
        @status_window.active = true
        @status_window.index = 0
      when 2
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @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
      @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]

Your logo must be no bigger than 220 x 288 pixels, and must go inside your 'pictures' folder.
When inserting it, look for the first line of actual code in the script:
$LOGO = RPG::Cache.picture("Logo")
Change "Logo" to whatever your logo is called. Case sensitive. DO NOT REMOVE THE QUOTATION MARKS.
To change the logo in-game, simply use a call script command:
$LOGO = RPG::Cache.picture("Logo")
Do as above, change the text inside the quotation marks to the name of the logo you would like to change to.

That should be all, an' have fun ;) Post, or PM me if you have any troubles or queries.
Sincerely,
Your conscience.

Revo

Nice. I think I'll use it. I've been looking for a simple yet different CMS. ;D

Rune

Wow, didn't expect a reply so soon :P
Sincerely,
Your conscience.

modern algebra

Looks pretty nice. I'll throw it in the database

Gando

[spoiler=Event systems i've created]
Event steal system
http://rmrk.net/index.php/topic,23659.0.html
[/spoiler]

[spoiler=Signature]
"To err is human, to ARRRRR is pirate." ♫♪火
[/spoiler]

[spoiler=Don't look here!!]

[/spoiler]

emidy

#5
Yeah, I like it too. Simple but neat.
BTW, are there anyways to change the sprites to facesets or battlers?

If no, then it's fine. =)

Rune

#6
Code (Faces in Menu) Select
class Window_Base 
  def draw_actor_graphic(actor, x, y)
    bitmap = RPG::Cache.picture(actor.name + "_face")
    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
end


Insert that scriptlet above main, or in the menu script, at the top. The images should be around 96x96 pixels, should go in your project's Pictures folder, and should include the character's name, followed by "_face". E.g, "Aluxes_face"
Sincerely,
Your conscience.

emidy


vath


Eh, Rune. What about my request a while ago?  :'(
*maybe i can use this. But can u remove "Save Game" selection from the menu screen?  ;)

Rune

I sent that to you :-\

Decide which one you want, and i'll send again ;)
Sincerely,
Your conscience.

vath

Quote from: Rune on March 07, 2008, 04:40:25 PM
I sent that to you :-\

Decide which one you want, and i'll send again ;)
hwaa.. ? but i havent receive any script yet  ;9
*umn, i prefer the old one. coz it fit with your savepoint script ^_^

Rune

Okies then, i'll resend :P Sorry about that.
Sincerely,
Your conscience.

vath

Quote from: Rune on March 09, 2008, 10:15:57 AM
Okies then, i'll resend :P Sorry about that.
Yay! It work perfectly!
*thanks, rune  :tpg:

Rune

Sincerely,
Your conscience.

Klarth F. Lester

#14
Sorry to bother you Rune-san but ummm... it doesn't work on mine.


I've put the pic iwanted for the logo following the pixel requirements and well I put it in my picture folder. and I wrote the name in the script all it says is "unable to find file Graphics/Pictures/Logo."

if you get some time.. can you help me out?


Thanks in advance ^^

EDIT: Nevermind sorry I got it now now Imma try to put faces instead of the ugly sprites...


Edit#2: Help same problem I did everything but it sez "Cannot find file Graphics/Pictures/AluxesAluxes_face, lol sorry I bother so much xD
xD

Rune

I don't think that's anything to do with the script :-\
Just make sure the files are named right. Did you mean to put 2 'Aluxes'? If that's what the error says then, check the name of that character to see if he hasn't got a duplicate name.

Other than that, I can't see what could be causing that :-\ Sorry...
Sincerely,
Your conscience.

Klarth F. Lester

I've tried everything... nothing works...

my image is 96x96 pixels, its in my projects picture folder. the actor name is Cless; I named the file Cless_face.bmp which is what you explained
Rune-san. I put the scriptlet inside the CMS on the top. and I put "Cless_face" just like you said... still says "Unable to find file Graphics/Pictures/ClessCless_face."

yes it says it twice... so does that mean i need to name my Actor "Cless_face"?

lol I dunno but it would be kinda weird eh?, umm if there is any way you can help me I would greatly appreciate it Rune-san ^^

Rune

Make sure the scriptlet says
    bitmap = RPG::Cache.picture(actor.name + "_face")
And doesn't repeat actor.name twice.
Sincerely,
Your conscience.

Klarth F. Lester

#==============#
#=>  CMS #3  <=#
#=>   Rune   <=#
#=> Feb 2008 <=#
#==============#
class Window_Base 
  def draw_actor_graphic(actor, x, y)
     bitmap = RPG::Cache.picture(actor.name + "Aluxes_face")
    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
end
$data_mapinfos = load_data('Data/MapInfos.rxdata')

class Window_Steps
  def initialize
    super(0, 0, 410, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
  contents.clear
  contents.font.color = system_color
  contents.draw_text(0, 0, 378, 32, 'Location', 1)
  contents.font.color = normal_color
  name = $data_mapinfos[$game_map.map_id].name 
  contents.draw_text(0, 32, 378, 32, name, 1)
  end
end

class Window_GName < Window_Base
  def initialize
    super(0, 0, 250, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 218, 32, "Nagi", 1)
  end
end

class Window_GLogo < Window_Base
  def initialize
    super(0, 0, 250, 320)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    bitmap = RPG::Cache.picture("Nagi")
    self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 220, 288))
  end
end

class Window_MenuStatus < Window_Selectable
  def initialize
    super(0, 0, 230, 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 = 64
      y = i * 116
      actor = $game_party.actors[i]
      draw_actor_graphic(actor, x - 40, y + 75)
      draw_actor_name(actor, x - 60, y - 5)
      draw_actor_class(actor, x - 20, y + 19)
      draw_actor_level(actor, x + 30, y - 5)
      draw_actor_state(actor, x + 54, y + 19)
      draw_actor_hp(actor, x - 16, y + 43)
      draw_actor_sp(actor, x - 16, y + 67)
    end
  end
  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

class Scene_Menu
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  def main
    s1 = "Items"
    s2 = "Skills"
    s3 = "Equipment"
    s4 = "Status"
    s5 = "Save Game"
    s6 = "Quit Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    @command_window.x = 480
    @command_window.height = 32 * 7 + 1
    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
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 480
    @playtime_window.y = 288
    @steps_window = Window_Steps.new
    @steps_window.x = 230
    @steps_window.y = 384
    @gold_window = Window_Gold.new
    @gold_window.x = 480
    @gold_window.y = 224
    @status_window = Window_MenuStatus.new
    @status_window.x = 0
    @status_window.y = 0
    @gnam_window = Window_GName.new
    @gnam_window.x = 230
    @gnam_window.y = 0
    @glog_window = Window_GLogo.new
    @glog_window.x = 230
    @glog_window.y = 64
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @gnam_window.dispose
    @glog_window.dispose
  end
  def update
    @command_window.update
    @playtime_window.update
    @steps_window.update
    @gold_window.update
    @status_window.update
    @gnam_window.update
    @glog_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
        @status_window.active = true
        @status_window.index = 0
      when 2
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @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
      @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


that's the jig of it... the file name is Aluxes_face.bmp and is on my picture folder. I have tried several other methods and same thing happens...

sorry for being a pain in the ass... ><;; , lol I feel embarrased that many that used this script didn't have any problems.. and I'm the only idiot that does... xD

modern algebra

Yeah, that line there:


     bitmap = RPG::Cache.picture(actor.name + "Aluxes_face")


should be


     bitmap = RPG::Cache.picture(actor.name + "_face")

Klarth F. Lester

YAY~!!

Thanks Rune-san... you shall be golrified ny me for many decades to come and even my concubines xDD

thank you~!!! /ok

A13x

Perfect. not overdone, or oversimple. ill use it!
I have:
GM7
RPGXP
RPGVX
FPS Creator
Cube 2
3D Gamemaker (SHITBOX!)

WIP stats:
RPGVX:
none, just experimenting with random events...

Rune

Thanks for the replies, and i'm glad your problem's sorted Klarth :D
Sincerely,
Your conscience.

Sx2

I have 2 issues installing the script (imma noob)
1. Do I delete the current "window_steps" "window_menustatus" and "scene_menu"
2. I always get an error about the line "super(0, 0, 410, 96)"

Please help
Super Smash Bros. Brawl - Kirby Player
Brawl Code - 1375-6864-5199
PM to Brawl me

Rune

1. You don't delete the current Window_Steps, but you do delete Window_MenuStatus. You replace the default Scene_Menu with the one I posted in the first post.
2. Did you delete the current Window_Steps already?
Sincerely,
Your conscience.