Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
CMS dla jednej osoby
Autor Wiadomość
Loki 




Preferowany:
RPG Maker VX

Pomógł: 12 razy
Dołączył: 25 Kwi 2012
Posty: 162
Wysłany: Sob 19 Maj, 2012 22:30
CMS dla jednej osoby
~ One-Man CMS ~


Autor:
Rune

Kompatybilność:
RPG Maker XP

Skrypt:
Spoiler:

Kod:
#==============================================================================
# ** One-Man CMS
#  * by Rune
#------------------------------------------------------------------------------
#  Little configuration required:
#
#  Must have three images in the pictures folder of your project named "HP_bar",
#  "SP_bar" (both of these must be from 100 x 4 to 100 x 10 pixels) and one
#  named "bar_border", this one must be 102 pixels in width and the height of
#  your bars + 2 pixels, and must consist of a one pixel thick border for your
#  HP/SP bars, and may include a darker colour in the centre.
#------------------------------------------------------------------------------
# * Credit:
#   Rune
#   Modern Algebra for the HP/SP bars coding and for the Window_Command edit
#                  (I'm 99.7% sure that was him).
#==============================================================================

#==============================================================================
# * HP/SP bar configuration
#==============================================================================

HP_BAR = RPG::Cache.picture("HP_bar") # Name of your HP bar
SP_BAR = RPG::Cache.picture("SP_bar") # Name of your SP bar
BAR_BORDER = RPG::Cache.picture("bar_border") # Name of your HP/SP bar border
DECREASE_STYLE = 0 # 0 = squash, 1 = crop

#==============================================================================
# * End of HP/SP bar configuration
#==============================================================================

#==============================================================================
# * MenuStatus bar configuration
#==============================================================================

$activecharid = 1 # Change this to match the current active character
                  # The number is the character's ID in the database
                  # I.e. Arshes = 1, Basil = 2, Cyrus = 3, etc...
                  # To change ingame, use a call script command and type:
                  # $activecharid = number

#==============================================================================
# * End of MenuStatus configuration
#==============================================================================

#==============================================================================
# * Window_Base (Edit)
#==============================================================================

class Window_Base
  #--------------------------------------------------------------------------
  # * Draw Battler
  #     actor   : actor
  #     x       : draw spot x-coordinate
  #     y       : draw spot y-coordinate
  #     opacity : opacity
  #--------------------------------------------------------------------------
  def draw_actor_battler(actor, x, y, opacity)
    char = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    self.contents.blt(x, y, char, char.rect, opacity)
  end
end

#==============================================================================
# * End of Window_Base (Edit)
#==============================================================================

#==============================================================================
# * Window_Command (Rewrite)
#==============================================================================

class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(width, commands, column_max = 1, style = 0, inf_scroll = 1)
    super(0, 0, width, (commands.size * 1.0 / column_max).ceil * 32 + 32)
    @inf_scroll = inf_scroll
    @item_max = commands.size
    @commands = commands
    @column_max = column_max
    @style = style
    self.contents = Bitmap.new(width - 32, (@item_max * 1.0 / @column_max).ceil * 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw_Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(index%@column_max * (self.width / @column_max) + 4, 32 * (index/@column_max), self.width / @column_max - 40, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], @style)
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
  #--------------------------------------------------------------------------
  # * Update Help
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_actor($game_party.actors[$scene.actor_index])
  end
end

#==============================================================================
# * End of Window_Command (Rewrite)
#==============================================================================

#==============================================================================
# * Window_PlayTime (Edit)
#==============================================================================

class Window_PlayTime
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, "Play Time", 2)
    @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

#==============================================================================
# * End of Window_PlayTime (Edit)
#==============================================================================

#==============================================================================
# * Window_MenuStatus (Rewrite)
#==============================================================================

class Window_MenuStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(240, 32, 320, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    actor = $game_actors[$activecharid]
    draw_actor_battler(actor, 128, 160, 160)
    self.contents.font.size = 32
    self.contents.font.color = Color.new(0, 0, 0, 255)
    self.contents.draw_text(4, 4, 288, 32, actor.name, 1)
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, 288, 32, actor.name, 1)
    self.contents.font.size = 22
    draw_actor_class(actor, 16, 160)
    draw_actor_level(actor, 16, 128)
    draw_actor_state(actor, 16, 192)
    draw_actor_exp(actor, 0, 96)
    border = BAR_BORDER
    src_rect = Rect.new(0, 0, 102, 12)
    self.contents.blt(39, 71, border, src_rect)
    self.contents.blt(183, 71, border, src_rect)
    hp = HP_BAR
    sp = SP_BAR
    case DECREASE_STYLE
    when 0
      hp_percent = ((actor.hp.to_f / actor.maxhp.to_f) * 100).to_i
      dest_rect = Rect.new (40, 72, hp_percent, 10)
      self.contents.stretch_blt (dest_rect, hp, hp.rect)
      sp_percent = ((actor.sp.to_f / actor.maxsp.to_f) * 100).to_i
      dest_rect = Rect.new (184, 72, sp_percent, 10)
      self.contents.stretch_blt (dest_rect, sp, sp.rect)
    when 1
      hp_percent = ((actor.hp.to_f / actor.maxhp.to_f) * 100).to_i
      src_rect = Rect.new (0, 0, hp_percent, 10)
      self.contents.blt (40, 72, hp, src_rect)
      sp_percent = ((actor.sp.to_f / actor.maxsp.to_f) * 100).to_i
      src_rect = Rect.new (0, 0, sp_percent, 10)
      self.contents.blt (184, 72, sp, src_rect)
    end
    draw_actor_hp(actor, 0, 48)
    draw_actor_sp(actor, 144, 48)
    draw_item_name($data_weapons[actor.weapon_id], 0, 224)
    draw_item_name($data_armors[actor.armor1_id], 0, 256)
    draw_item_name($data_armors[actor.armor2_id], 0, 288)
    draw_item_name($data_armors[actor.armor3_id], 0, 320)
    draw_item_name($data_armors[actor.armor4_id], 0, 352)
  end
  #--------------------------------------------------------------------------
  # * Dummy
  #--------------------------------------------------------------------------
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(0, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(0, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(0, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(0, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(0, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[actor.weapon_id], 0, 144)
    draw_item_name($data_armors[actor.armor1_id], 0, 208)
    draw_item_name($data_armors[actor.armor2_id], 0, 272)
    draw_item_name($data_armors[actor.armor3_id], 0, 336)
    draw_item_name($data_armors[actor.armor4_id], 0, 400)
  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

#==============================================================================
# * End of Window_MenuStatus (Rewrite)
#==============================================================================

#==============================================================================
# * Scene_Menu
#==============================================================================

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
    # Makes the Map appear in the background
    @spriteset = Spriteset_Map.new
    # Make command window
    s1 = "Inventory"
    s2 = "Abilities"
    s3 = "Equipment"
    s4 = "Status"
    s5 = "Save Game"
    s6 = "Quit Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6], 1, 2)
    @command_window.index = @menu_index
    @command_window.y = 240 - @command_window.height / 2
    @command_window.x = 80
    # 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 status window
    @status_window = Window_MenuStatus.new
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 400
    @playtime_window.y = 160
    @playtime_window.opacity = 0
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 400
    @gold_window.y = 224
    @gold_window.opacity = 0
    # 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
    @playtime_window.dispose
    @spriteset.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @playtime_window.update
    @spriteset.update
    @gold_window.update
    @status_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)
        # Switch to skill screen
        $scene = Scene_Skill.new
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equip screen
        $scene = Scene_Equip.new
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.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 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
end

#==============================================================================
# * End of Scene_Menu
#==============================================================================


Screeny:
Spoiler:


 
 
aragorn7015 




Preferowany:
RPG Maker VXAce

Pomógł: 15 razy
Dołączył: 20 Kwi 2012
Posty: 186
Skąd: się biorą dzieci?
Wysłany: Sob 02 Cze, 2012 16:52
Eee, a grafiki? no i co to za E?
________________________
Jeśli pomogłem, daj
Spoiler:

POMÓGŁ



Uwielbiam się bawić na zdarzeniach w VX-ie... Więc jeśli masz jakieś pytanie jak coś zrobić na zdarzeniach to napisz. Jeśli będę wiedział to odpowiem
 
 
 
leszekp321 




Preferowany:
RPG Maker XP

Pomógł: 1 raz
Dołączył: 16 Mar 2012
Posty: 49
Skąd: jesteś?
Wysłany: Sob 02 Cze, 2012 18:38
Zadana dodatkowa grafika nie jest potrzebna to raz a dwa to tam miało być pewnie EXP
 
 
aragorn7015 




Preferowany:
RPG Maker VXAce

Pomógł: 15 razy
Dołączył: 20 Kwi 2012
Posty: 186
Skąd: się biorą dzieci?
Wysłany: Nie 03 Cze, 2012 20:57
Grafiki były potrzebne i jakoś je wyciąłem ze screena... No wiem co tam miało być ale jak to zmienić???
________________________
Jeśli pomogłem, daj
Spoiler:

POMÓGŁ



Uwielbiam się bawić na zdarzeniach w VX-ie... Więc jeśli masz jakieś pytanie jak coś zrobić na zdarzeniach to napisz. Jeśli będę wiedział to odpowiem
 
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene