RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
HEARTS for health meter...?

0 Members and 2 Guests are viewing this topic.

***
Rep:
Level 83
X-PLAT!
EDIT:[scroll down for the latest edits on this working script!]

In the beginning ...

I was straightening out all the data in my laptop ... and I ran into this script...
I remember I had downloaded it off some french site that doesn't exist anymore.

on the site this script was separate with instructions to add in these three lines.

* I had marked these 3 sentences with "location?"

I'm unfamiliar with the script's flow, so I'm trying to guess each lines' position
in order to make it work: here's the script:
Spoiler for:
Code: [Select]
   #==========================================
    # Pommes de vie
    #
    # Script téléchargé sur www.rpg-creation.com
    #
    # Window_Corazones
    # Par DarkRog
    #-----------------------------------------
    #==========================================

    class Window_Corazones < Window_Base
    def initialize
    super(-8, -8, 640, 96)
        #=== Options ===
    corazones = 10
    opacidad = 255
    opcion = 2 #1-5?
    #=== Options fin ==
#    @corazones Window_Corazones.new############################location?
        self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.opacity = 0
    
    @hearts = corazones
    @opacity = opacidad
    @option = opcion
    @hr = 0
    refresh
  end
    #----------------------------------------
    # - Actualisation
    #----------------------------------------
    def refresh
    self.contents.clear
    @n = $game_party.actors[0].hp
    @mn = $game_party.actors[0].maxhp
    #n is the value, and mn the maxvalue:
    @hr = 0
    @lh = 0
    for i in 0..@hearts-1
    self.contents.fill_rect(i*14, 4, 1, 2, Color.new(0, 0, 0, @opacity))
    self.contents.fill_rect(i*14+1, 3, 1, 4, Color.new(0, 0, 0, @opacity))
    self.contents.fill_rect(i*14+2, 2, 1, 6, Color.new(0, 0, 0, @opacity))
    self.contents.fill_rect(i*14+3, 1, 1, 8, Color.new(0, 0, 0, @opacity))
    self.contents.fill_rect(i*14+4, 0, 1, 10, Color.new(0, 0, 0, @opacity))
    self.contents.fill_rect(i*14+5, 1, 1, 10, Color.new(0, 0, 0, @opacity))
    self.contents.fill_rect(i*14+6, 2, 1, 10, Color.new(0, 0, 0, @opacity))
    self.contents.fill_rect(i*14+7, 1, 1, 10, Color.new(0, 0, 0, @opacity))
    self.contents.fill_rect(i*14+8, 0, 1, 10, Color.new(0, 0, 0, @opacity))
    self.contents.fill_rect(i*14+9, 1, 1, 8, Color.new(0, 0, 0, @opacity))
    self.contents.fill_rect(i*14+10, 2, 1, 6, Color.new(0, 0, 0, @opacity))
    self.contents.fill_rect(i*14+11, 3, 1, 4, Color.new(0, 0, 0, @opacity))
    self.contents.fill_rect(i*14+12, 4, 1, 2, Color.new(0, 0, 0, @opacity))
    #
    self.contents.fill_rect(i*14+1, 4, 1, 2, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+2, 3, 1, 4, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+3, 2, 1, 6, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+4, 1, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+5, 2, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+6, 3, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+7, 2, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+8, 1, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+9, 2, 1, 6, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+10, 3, 1, 4, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+11, 4, 1, 2, Color.new(255, 255, 255, @opacity))
    #
    #@c = 255
    @l = @n*100/@mn
    @ho = @l*@hearts
    #
    c_color(1)
    self.contents.fill_rect(i*14+2, 4, 1, 2, Color.new(@c, 0, 0, @opacity))
    c_color(2)
    self.contents.fill_rect(i*14+3, 3, 1, 4, Color.new(@c, 0, 0, @opacity))
    c_color(3)
    self.contents.fill_rect(i*14+4, 2, 1, 6, Color.new(@c, 0, 0, @opacity))
    c_color(4)
    self.contents.fill_rect(i*14+5, 3, 1, 6, Color.new(@c, 0, 0, @opacity))
    c_color(5)
    self.contents.fill_rect(i*14+6, 4, 1, 6, Color.new(@c, 0, 0, @opacity))
    c_color(6)
    self.contents.fill_rect(i*14+7, 3, 1, 6, Color.new(@c, 0, 0, @opacity))
    c_color(7)
    self.contents.fill_rect(i*14+8, 2, 1, 6, Color.new(@c, 0, 0, @opacity))
    c_color(8)
    self.contents.fill_rect(i*14+9, 3, 1, 4, Color.new(@c, 0, 0, @opacity))
    c_color(9)
    self.contents.fill_rect(i*14+10, 4, 1, 2, Color.new(@c, 0, 0, @opacity))
#    @corazones.refresh #####################################location?
    @hr += 1
    end
    if @option == 1
    self.contents.font.color.set(0, 0, 0)
    self.contents.draw_text(0 - 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
    self.contents.draw_text(0 - 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
    self.contents.draw_text(0 + 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
    self.contents.draw_text(0 + 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 7, 160, 32, $game_party.actors[0].name, 0)
    elsif @option == 2
    self.contents.font.color.set(0, 0, 0)
    self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@n}/#{@mn}", 0)
    self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@n}/#{@mn}", 0)
    self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@n}/#{@mn}", 0)
    self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@n}/#{@mn}", 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 7, 160, 32, "#{@n}/#{@mn}", 0)
    elsif @option == 3
    self.contents.font.color.set(0, 0, 0)
    self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
    self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
    self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
    self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 7, 160, 32, "#{@ho/100}/#{@hearts}", 0)
    elsif @option == 4
    self.contents.font.color.set(0, 0, 0)
    self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@l}%", 0)
    self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@l}%", 0)
    self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@l}%", 0)
    self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@l}%", 0)
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 7, 160, 32, "#{@l}%", 0)
    end
  end
  
 #   @corazones.refresh #####################################location?

    def c_color(a)
    if @hr <= (@ho/100)-1
    @c = 255
    else
    if @ho/10-@hr*10 >= a and @ho/10-@hr*10 <= 9

    @c = 255
    else
    @c = 0
    end
    end
    end

    def corazones(corazones)
    @hearts = corazones
    end
    end

this would be tits! in any game!
I'd really like to get this thing working...anyone? please advise.
 ~((G//A\\//\/\\||E|F//A\\((C||E
« Last Edit: September 26, 2009, 06:49:08 AM by gameface101 »

***
Rep:
Level 83
X-PLAT!
I'm starting to understand how this script works....

so far here is my progress:
Spoiler for:
Code: [Select]
#==============================================================================
# Window_Corazones
# Par DarkRog
#------------------------------------------------------------------------------
#==============================================================================

class Window_Corazones < Window_Base

   def initialize
      super(-8, -8, 640, 96)
      #=== Options ===
      corazones = 10
      opacidad = 255
      opcion = 2
      #=== Options fin ==
      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.font.name = "Arial"#$fontface
      self.contents.font.size = 16#$fontsize
      self.opacity = 0
      @hearts = corazones
      @opacity = opacidad
      @option = opcion
      @hr = 0
      refresh
   end
  
   #-----------------------------------------------------------------------
   # - Actualisation
   #-----------------------------------------------------------------------
   def refresh
      self.contents.clear
      @n = $game_party.actors[0].hp
      @mn = $game_party.actors[0].maxhp
      #n is the value, and mn the maxvalue:
      @hr = 0
      @lh = 0
      
      for i in 0..@hearts-1
         self.contents.fill_rect(i*14, 4, 1, 2, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+1, 3, 1, 4, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+2, 2, 1, 6, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+3, 1, 1, 8, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+4, 0, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+5, 1, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+6, 2, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+7, 1, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+8, 0, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+9, 1, 1, 8, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+10, 2, 1, 6, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+11, 3, 1, 4, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+12, 4, 1, 2, Color.new(0, 0, 0, @opacity))
         #
         self.contents.fill_rect(i*14+1, 4, 1, 2, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+2, 3, 1, 4, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+3, 2, 1, 6, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+4, 1, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+5, 2, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+6, 3, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+7, 2, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+8, 1, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+9, 2, 1, 6, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+10, 3, 1, 4, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+11, 4, 1, 2, Color.new(255, 255, 255, @opacity))
         #
         @c = 255
         @l = @n*100/@mn
         @ho = @l*@hearts
#         c_color(1)
         self.contents.fill_rect(i*14+2, 4, 1, 2, Color.new(@c, 0, 0, @opacity))
#         c_color(2)
         self.contents.fill_rect(i*14+3, 3, 1, 4, Color.new(@c, 0, 0, @opacity))
#         c_color(3)
         self.contents.fill_rect(i*14+4, 2, 1, 6, Color.new(@c, 0, 0, @opacity))
#         c_color(4)
         self.contents.fill_rect(i*14+5, 3, 1, 6, Color.new(@c, 0, 0, @opacity))
#         c_color(5)
         self.contents.fill_rect(i*14+6, 4, 1, 6, Color.new(@c, 0, 0, @opacity))
#         c_color(6)
         self.contents.fill_rect(i*14+7, 3, 1, 6, Color.new(@c, 0, 0, @opacity))
#         c_color(7)
         self.contents.fill_rect(i*14+8, 2, 1, 6, Color.new(@c, 0, 0, @opacity))
#         c_color(8)
         self.contents.fill_rect(i*14+9, 3, 1, 4, Color.new(@c, 0, 0, @opacity))
#         c_color(9)
         self.contents.fill_rect(i*14+10, 4, 1, 2, Color.new(@c, 0, 0, @opacity))

         @hr += 1
      end
      
      if @option == 1
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, $game_party.actors[0].name, 0)
      elsif @option == 2
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@n}/#{@mn}", 0)
      elsif @option == 3
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@ho/100}/#{@hearts}", 0)
      elsif @option == 4
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@l}%", 0)
      end
   end
  
end

not certain but do I call this with: $scene = Scene_Windows_Corazones.new  

"?"

« Last Edit: September 07, 2009, 11:05:34 AM by gameface101 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
No, seeing as this is just a window intended as a HUD, the scripter probably wants you to go into Scene_Map, create the window in the main method before the loop and dispose it in the main method below the loop, and probably also update the window in the update method.

***
Rep:
Level 83
X-PLAT!
@modern algebra - alright! thank you for your response! now we're getting somewhere~

Here's my edits to the Scene_Map script:
Spoiler for:
Code: [Select]
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make sprite set
    @spriteset = Spriteset_Map.new
    # Make message window
    @message_window = Window_Message.new
    # make heart meter
    @corazones = Window_Corazones.new###############################[insert]
    # Transition run
    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 sprite set
    @spriteset.dispose
    # Dispose of message window
    @message_window.dispose
    #dispose of heart meter
    @corazones.dispose##############################################[insert]
    # If switching to title screen
    if $scene.is_a?(Scene_Title)
      # Fade out screen
      Graphics.transition
      Graphics.freeze
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Loop
    loop do
      # Update map, interpreter, and player order
      # (this update order is important for when conditions are fulfilled
      # to run any event, and the player isn't provided the opportunity to
      # move in an instant)
      $game_map.update
      $game_system.map_interpreter.update
      $game_player.update
      # Update system (timer), screen
      $game_system.update
      $game_screen.update
      # Abort loop if player isn't place moving
      unless $game_temp.player_transferring
        break
      end
      # Run place move
      transfer_player
      # Abort loop if transition processing
      if $game_temp.transition_processing
        break
      end
    end
    # Update sprite set
    @spriteset.update
    # Update message window
    @message_window.update
    #update heart meter
    @corazones.update################################################[insert]
    # If game over
    if $game_temp.gameover
      # Switch to game over screen
      $scene = Scene_Gameover.new
      return
    end
    # If returning to title screen
    if $game_temp.to_title
      # Change to title screen
      $scene = Scene_Title.new
      return
    end
    # If transition processing
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    # If showing message window
    if $game_temp.message_window_showing
      return
    end
    # If encounter list isn't empty, and encounter count is 0
    if $game_player.encounter_count == 0 and $game_map.encounter_list != []
      # If event is running or encounter is not forbidden
      unless $game_system.map_interpreter.running? or
             $game_system.encounter_disabled
        # Confirm troop
        n = rand($game_map.encounter_list.size)
        troop_id = $game_map.encounter_list[n]
        # If troop is valid
        if $data_troops[troop_id] != nil
          # Set battle calling flag
          $game_temp.battle_calling = true
          $game_temp.battle_troop_id = troop_id
          $game_temp.battle_can_escape = true
          $game_temp.battle_can_lose = false
          $game_temp.battle_proc = nil
        end
      end
    end
    # If B button was pressed
    if Input.trigger?(Input::B)
      # If event is running, or menu is not forbidden
      unless $game_system.map_interpreter.running? or
             $game_system.menu_disabled
        # Set menu calling flag or beep flag
        $game_temp.menu_calling = true
        $game_temp.menu_beep = true
      end
    end
    # If debug mode is ON and F9 key was pressed
    if $DEBUG and Input.press?(Input::F9)
      # Set debug calling flag
      $game_temp.debug_calling = true
    end
    # If player is not moving
    unless $game_player.moving?
      # Run calling of each screen
      if $game_temp.battle_calling
        call_battle
      elsif $game_temp.shop_calling
        call_shop
      elsif $game_temp.name_calling
        call_name
      elsif $game_temp.menu_calling
        call_menu
      elsif $game_temp.save_calling
        call_save
      elsif $game_temp.debug_calling
        call_debug
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Battle Call
  #--------------------------------------------------------------------------
  def call_battle
    # Clear battle calling flag
    $game_temp.battle_calling = false
    # Clear menu calling flag
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    # Make encounter count
    $game_player.make_encounter_count
    # Memorize map BGM and stop BGM
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    # Play battle start SE
    $game_system.se_play($data_system.battle_start_se)
    # Play battle BGM
    $game_system.bgm_play($game_system.battle_bgm)
    # Straighten player position
    $game_player.straighten
    # Switch to battle screen
    $scene = Scene_Battle.new
  end
  #--------------------------------------------------------------------------
  # * Shop Call
  #--------------------------------------------------------------------------
  def call_shop
    # Clear shop call flag
    $game_temp.shop_calling = false
    # Straighten player position
    $game_player.straighten
    # Switch to shop screen
    $scene = Scene_Shop.new
  end
  #--------------------------------------------------------------------------
  # * Name Input Call
  #--------------------------------------------------------------------------
  def call_name
    # Clear name input call flag
    $game_temp.name_calling = false
    # Straighten player position
    $game_player.straighten
    # Switch to name input screen
    $scene = Scene_Name.new
  end
  #--------------------------------------------------------------------------
  # * Menu Call
  #--------------------------------------------------------------------------
  def call_menu
    # Clear menu call flag
    $game_temp.menu_calling = false
    # If menu beep flag is set
    if $game_temp.menu_beep
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Clear menu beep flag
      $game_temp.menu_beep = false
    end
    # Straighten player position
    $game_player.straighten
    # Switch to menu screen
    $scene = Scene_Menu.new
  end
  #--------------------------------------------------------------------------
  # * Save Call
  #--------------------------------------------------------------------------
  def call_save
    # Straighten player position
    $game_player.straighten
    # Switch to save screen
    $scene = Scene_Save.new
  end
  #--------------------------------------------------------------------------
  # * Debug Call
  #--------------------------------------------------------------------------
  def call_debug
    # Clear debug call flag
    $game_temp.debug_calling = false
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Straighten player position
    $game_player.straighten
    # Switch to debug screen
    $scene = Scene_Debug.new
  end
  #--------------------------------------------------------------------------
  # * Player Place Move
  #--------------------------------------------------------------------------
  def transfer_player
    # Clear player place move call flag
    $game_temp.player_transferring = false
    # If move destination is different than current map
    if $game_map.map_id != $game_temp.player_new_map_id
      # Set up a new map
      $game_map.setup($game_temp.player_new_map_id)
    end
    # Set up player position
    $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
    # Set player direction
    case $game_temp.player_new_direction
    when 2  # down
      $game_player.turn_down
    when 4  # left
      $game_player.turn_left
    when 6  # right
      $game_player.turn_right
    when 8  # up
      $game_player.turn_up
    end
    # Straighten player position
    $game_player.straighten
    # Update map (run parallel process event)
    $game_map.update
    #heart meter
    @corazones.dispose##############################################[insert]
    @corazones = Window_Corazones.new###############################[insert]
    # Remake sprite set
    @spriteset.dispose
    @spriteset = Spriteset_Map.new
    # If processing transition
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      Graphics.transition(20)
    end
    # Run automatic change for BGM and BGS set on the map
    $game_map.autoplay
    # Frame reset
    Graphics.frame_reset
    # Update input information
    Input.update
  end
end

the heart meter loads up fine BUT, heart containers don't disappear when you lose HP and the fraction "10/10 hearts"
doesn't update unless you call menu then exit menu...

would it still be possible to enable and disable this through a switch or call script? (instead of having it always on)

(oh so close) can't wait to share this if/when we can get this to work
here's a sceenshot as to what it looks like,

this was the only "Heart Container / Heart Display System / Hearts for Health Meter 'script' I could find. ~g
« Last Edit: September 06, 2009, 06:35:04 PM by gameface101 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, it looks like there's no update method for the window, which I think is kind of silly since it would be bad to refresh that every frame and it should really only be refreshed when hp is changed.

In any case, at the start of the update method, try putting:

Code: [Select]
old_hp = $game_party.members[0].hp

and then scroll down to where you have:


    @corazones.update################################################[insert]

and replace it with:

   
Code: [Select]
@corazones.refresh if old_hp != $game_party.members[0].hp

See if that works.


***
Rep:
Level 83
X-PLAT!
@modern algebra - I really appreciate your efforts in helping me out with this...

so here's the latest edit to Scene_Map:

Spoiler for:
Code: [Select]
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make sprite set
    @spriteset = Spriteset_Map.new
    # Make message window
    @message_window = Window_Message.new
    # make heart meter
    @corazones = Window_Corazones.new###############################[insert]
    # Transition run
    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 sprite set
    @spriteset.dispose
    # Dispose of message window
    @message_window.dispose
    #dispose of heart meter
    @corazones.dispose##################################################[insert]
    # If switching to title screen
    if $scene.is_a?(Scene_Title)
      # Fade out screen
      Graphics.transition
      Graphics.freeze
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    old_hp = $game_party.actors[0].hp###################################[insert]
    # Loop
    loop do
      # Update map, interpreter, and player order
      # (this update order is important for when conditions are fulfilled
      # to run any event, and the player isn't provided the opportunity to
      # move in an instant)
      $game_map.update
      $game_system.map_interpreter.update
      $game_player.update
      # Update system (timer), screen
      $game_system.update
      $game_screen.update
      # Abort loop if player isn't place moving
      unless $game_temp.player_transferring
        break
      end
      # Run place move
      transfer_player
      # Abort loop if transition processing
      if $game_temp.transition_processing
        break
      end
    end
    # Update sprite set
    @spriteset.update
    # Update message window
    @message_window.update
    #update heart meter
    @corazones.refresh if old_hp != $game_party.actors[0].hp############[insert]
    # If game over
    if $game_temp.gameover
      # Switch to game over screen
      $scene = Scene_Gameover.new
      return
    end
    # If returning to title screen
    if $game_temp.to_title
      # Change to title screen
      $scene = Scene_Title.new
      return
    end
    # If transition processing
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    # If showing message window
    if $game_temp.message_window_showing
      return
    end
    # If encounter list isn't empty, and encounter count is 0
    if $game_player.encounter_count == 0 and $game_map.encounter_list != []
      # If event is running or encounter is not forbidden
      unless $game_system.map_interpreter.running? or
             $game_system.encounter_disabled
        # Confirm troop
        n = rand($game_map.encounter_list.size)
        troop_id = $game_map.encounter_list[n]
        # If troop is valid
        if $data_troops[troop_id] != nil
          # Set battle calling flag
          $game_temp.battle_calling = true
          $game_temp.battle_troop_id = troop_id
          $game_temp.battle_can_escape = true
          $game_temp.battle_can_lose = false
          $game_temp.battle_proc = nil
        end
      end
    end
    # If B button was pressed
    if Input.trigger?(Input::B)
      # If event is running, or menu is not forbidden
      unless $game_system.map_interpreter.running? or
             $game_system.menu_disabled
        # Set menu calling flag or beep flag
        $game_temp.menu_calling = true
        $game_temp.menu_beep = true
      end
    end
    # If debug mode is ON and F9 key was pressed
    if $DEBUG and Input.press?(Input::F9)
      # Set debug calling flag
      $game_temp.debug_calling = true
    end
    # If player is not moving
    unless $game_player.moving?
      # Run calling of each screen
      if $game_temp.battle_calling
        call_battle
      elsif $game_temp.shop_calling
        call_shop
      elsif $game_temp.name_calling
        call_name
      elsif $game_temp.menu_calling
        call_menu
      elsif $game_temp.save_calling
        call_save
      elsif $game_temp.debug_calling
        call_debug
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Battle Call
  #--------------------------------------------------------------------------
  def call_battle
    # Clear battle calling flag
    $game_temp.battle_calling = false
    # Clear menu calling flag
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    # Make encounter count
    $game_player.make_encounter_count
    # Memorize map BGM and stop BGM
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    # Play battle start SE
    $game_system.se_play($data_system.battle_start_se)
    # Play battle BGM
    $game_system.bgm_play($game_system.battle_bgm)
    # Straighten player position
    $game_player.straighten
    # Switch to battle screen
    $scene = Scene_Battle.new
  end
  #--------------------------------------------------------------------------
  # * Shop Call
  #--------------------------------------------------------------------------
  def call_shop
    # Clear shop call flag
    $game_temp.shop_calling = false
    # Straighten player position
    $game_player.straighten
    # Switch to shop screen
    $scene = Scene_Shop.new
  end
  #--------------------------------------------------------------------------
  # * Name Input Call
  #--------------------------------------------------------------------------
  def call_name
    # Clear name input call flag
    $game_temp.name_calling = false
    # Straighten player position
    $game_player.straighten
    # Switch to name input screen
    $scene = Scene_Name.new
  end
  #--------------------------------------------------------------------------
  # * Menu Call
  #--------------------------------------------------------------------------
  def call_menu
    # Clear menu call flag
    $game_temp.menu_calling = false
    # If menu beep flag is set
    if $game_temp.menu_beep
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Clear menu beep flag
      $game_temp.menu_beep = false
    end
    # Straighten player position
    $game_player.straighten
    # Switch to menu screen
    $scene = Scene_Menu.new
  end
  #--------------------------------------------------------------------------
  # * Save Call
  #--------------------------------------------------------------------------
  def call_save
    # Straighten player position
    $game_player.straighten
    # Switch to save screen
    $scene = Scene_Save.new
  end
  #--------------------------------------------------------------------------
  # * Debug Call
  #--------------------------------------------------------------------------
  def call_debug
    # Clear debug call flag
    $game_temp.debug_calling = false
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Straighten player position
    $game_player.straighten
    # Switch to debug screen
    $scene = Scene_Debug.new
  end
  #--------------------------------------------------------------------------
  # * Player Place Move
  #--------------------------------------------------------------------------
  def transfer_player
    # Clear player place move call flag
    $game_temp.player_transferring = false
    # If move destination is different than current map
    if $game_map.map_id != $game_temp.player_new_map_id
      # Set up a new map
      $game_map.setup($game_temp.player_new_map_id)
    end
    # Set up player position
    $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
    # Set player direction
    case $game_temp.player_new_direction
    when 2  # down
      $game_player.turn_down
    when 4  # left
      $game_player.turn_left
    when 6  # right
      $game_player.turn_right
    when 8  # up
      $game_player.turn_up
    end
    # Straighten player position
    $game_player.straighten
    # Update map (run parallel process event)
    $game_map.update
    #heart meter
    @corazones.dispose##################################################[insert]
    @corazones = Window_Corazones.new###################################[insert]
        # Remake sprite set
    @spriteset.dispose
    @spriteset = Spriteset_Map.new
    # If processing transition
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      Graphics.transition(20)
    end
    # Run automatic change for BGM and BGS set on the map
    $game_map.autoplay
    # Frame reset
    Graphics.frame_reset
    # Update input information
    Input.update
    #
   
  end
end

at the beginning of the update method I used:
Code: [Select]
old_hp = $game_party.actors[0].hp

and then replaced the other line with:
Code: [Select]
@corazones.refresh if old_hp != $game_party.actors[0].hp

the fraction updates n/p!

now the last remaining issue is to make the heart containers disappear according to the fraction...
currently all 10 heart containers remain present after damage has been recieved...
(almost there! ^,^) ~g


*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Why do you want them to disappear? It's a good way to show Max HP.

***
Rep:
Level 83
X-PLAT!
@modern algebra - if not disappear, for the fill to empty...
just like any Zelda knock off...

for me, it just doesn't make sense to show an array of ten filled hearts
when you're down to your last hit.




*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
It doesn't make them unfill?

I really don't like this script.

***
Rep:
Level 83
X-PLAT!
well I've continued my search for support on this script, instead of the French, ...
the Spanish had a site with the same script by DarkRog...
this time with a little extra piece of code at the bottom for the "C_Color" method...
here's the latest edit on this script:
Spoiler for:
Code: [Select]
#==============================================================================
# Window_Corazones by DarkRog 2006
# currently being Translated and Modified
# by GameFace101 2009
#
# Options:
# 0: Nothing. 1: Hero name. 2: Value/MaxValue. 3: x hearts/Maxhearts. 4: %.
#------------------------------------------------------------------------------
#==============================================================================

class Window_Corazones < Window_Base

   def initialize
     super(-8, -8, 640, 96)
      #=== Options ===
      corazones = 10
      opacidad = 255
      opcion = 3#1-4
      #=== Options fin ==
      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.font.name = "Impact"#$fontface
      self.contents.font.size = 24#$fontsize
      self.opacity = 0
      @hearts = corazones
      @opacity = opacidad
      @option = opcion
      @hr = 0
      refresh
   end
  
   #-----------------------------------------------------------------------
   # - Actualisation
   #-----------------------------------------------------------------------
   def refresh
      self.contents.clear
      @n = $game_party.actors[0].hp
      @mn = $game_party.actors[0].maxhp
      #n is the value, and mn the maxvalue:
      @hr = 0
      @lh = 0
      
      for i in 0..@hearts-1
         self.contents.fill_rect(i*14, 4, 1, 2, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+1, 3, 1, 4, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+2, 2, 1, 6, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+3, 1, 1, 8, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+4, 0, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+5, 1, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+6, 2, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+7, 1, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+8, 0, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+9, 1, 1, 8, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+10, 2, 1, 6, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+11, 3, 1, 4, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+12, 4, 1, 2, Color.new(0, 0, 0, @opacity))
         #
         self.contents.fill_rect(i*14+1, 4, 1, 2, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+2, 3, 1, 4, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+3, 2, 1, 6, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+4, 1, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+5, 2, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+6, 3, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+7, 2, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+8, 1, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+9, 2, 1, 6, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+10, 3, 1, 4, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*14+11, 4, 1, 2, Color.new(255, 255, 255, @opacity))
         #
         @c = 255
         @l = @n*100/@mn
         @ho = @l*@hearts
         c_color(1)
         self.contents.fill_rect(i*14+2, 4, 1, 2, Color.new(@c, 0, 0, @opacity))
         c_color(2)
         self.contents.fill_rect(i*14+3, 3, 1, 4, Color.new(@c, 0, 0, @opacity))
         c_color(3)
         self.contents.fill_rect(i*14+4, 2, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(4)
         self.contents.fill_rect(i*14+5, 3, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(5)
         self.contents.fill_rect(i*14+6, 4, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(6)
         self.contents.fill_rect(i*14+7, 3, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(7)
         self.contents.fill_rect(i*14+8, 2, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(8)
         self.contents.fill_rect(i*14+9, 3, 1, 4, Color.new(@c, 0, 0, @opacity))
         c_color(9)
         self.contents.fill_rect(i*14+10, 4, 1, 2, Color.new(@c, 0, 0, @opacity))

         @hr += 1
      end
###########################################################[options]      
      if @option == 1
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, $game_party.actors[0].name, 0)
      elsif @option == 2
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@n}/#{@mn}", 0)
      elsif @option == 3
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@ho/100}/#{@hearts}", 0)
      elsif @option == 4
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@l}%", 0)
      end
   end
  
 end
############################################[color method]
 def c_color(a)
if @hr <= (@ho/100)-1
@c = 255 #
else
if @ho/10-@hr*10 >= a and @ho/10-@hr*10 <= 9

@c = 255 #
else
@c = 0 #
end
end
end
##############################################[need?]
#def corazones(corazones)
#@hearts = corazones
#end

and here's the latest edit to Scene_Map thanks to Modern Algebra!
Spoiler for:
Code: [Select]
#==============================================================================
# ** Scene_Map (edited for Heart Meter Script by GameFace101)
# a special thanks goes out to Modern Algebra rmrk.net!
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================

class Scene_Map
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make sprite set
    @spriteset = Spriteset_Map.new
    # Make message window
    @message_window = Window_Message.new
    # make heart meter
    @corazones = Window_Corazones.new###################################[insert]
    # Transition run
    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 sprite set
    @spriteset.dispose
    # Dispose of message window
    @message_window.dispose
    #dispose of heart meter
    @corazones.dispose##################################################[insert]
    # If switching to title screen
    if $scene.is_a?(Scene_Title)
      # Fade out screen
      Graphics.transition
      Graphics.freeze
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    old_hp = $game_party.actors[0].hp###################################[insert]
    # Loop
    loop do
      # Update map, interpreter, and player order
      # (this update order is important for when conditions are fulfilled
      # to run any event, and the player isn't provided the opportunity to
      # move in an instant)
      $game_map.update
      $game_system.map_interpreter.update
      $game_player.update
      # Update system (timer), screen
      $game_system.update
      $game_screen.update
      # Abort loop if player isn't place moving
      unless $game_temp.player_transferring
        break
      end
      # Run place move
      transfer_player
      # Abort loop if transition processing
      if $game_temp.transition_processing
        break
      end
    end
    # Update sprite set
    @spriteset.update
    # Update message window
    @message_window.update
    #update heart meter
    @corazones.update###################################################[insert]
    @corazones.refresh if old_hp != $game_party.actors[0].hp############[insert]
    # If game over
    if $game_temp.gameover
      # Switch to game over screen
      $scene = Scene_Gameover.new
      return
    end
    # If returning to title screen
    if $game_temp.to_title
      # Change to title screen
      $scene = Scene_Title.new
      return
    end
    # If transition processing
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    # If showing message window
    if $game_temp.message_window_showing
      return
    end
    # If encounter list isn't empty, and encounter count is 0
    if $game_player.encounter_count == 0 and $game_map.encounter_list != []
      # If event is running or encounter is not forbidden
      unless $game_system.map_interpreter.running? or
             $game_system.encounter_disabled
        # Confirm troop
        n = rand($game_map.encounter_list.size)
        troop_id = $game_map.encounter_list[n]
        # If troop is valid
        if $data_troops[troop_id] != nil
          # Set battle calling flag
          $game_temp.battle_calling = true
          $game_temp.battle_troop_id = troop_id
          $game_temp.battle_can_escape = true
          $game_temp.battle_can_lose = false
          $game_temp.battle_proc = nil
        end
      end
    end
    # If B button was pressed
    if Input.trigger?(Input::B)
      # If event is running, or menu is not forbidden
      unless $game_system.map_interpreter.running? or
             $game_system.menu_disabled
        # Set menu calling flag or beep flag
        $game_temp.menu_calling = true
        $game_temp.menu_beep = true
      end
    end
    # If debug mode is ON and F9 key was pressed
    if $DEBUG and Input.press?(Input::F9)
      # Set debug calling flag
      $game_temp.debug_calling = true
    end
    # If player is not moving
    unless $game_player.moving?
      # Run calling of each screen
      if $game_temp.battle_calling
        call_battle
      elsif $game_temp.shop_calling
        call_shop
      elsif $game_temp.name_calling
        call_name
      elsif $game_temp.menu_calling
        call_menu
      elsif $game_temp.save_calling
        call_save
      elsif $game_temp.debug_calling
        call_debug
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Battle Call
  #--------------------------------------------------------------------------
  def call_battle
    # Clear battle calling flag
    $game_temp.battle_calling = false
    # Clear menu calling flag
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    # Make encounter count
    $game_player.make_encounter_count
    # Memorize map BGM and stop BGM
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    # Play battle start SE
    $game_system.se_play($data_system.battle_start_se)
    # Play battle BGM
    $game_system.bgm_play($game_system.battle_bgm)
    # Straighten player position
    $game_player.straighten
    # Switch to battle screen
    $scene = Scene_Battle.new
  end
  #--------------------------------------------------------------------------
  # * Shop Call
  #--------------------------------------------------------------------------
  def call_shop
    # Clear shop call flag
    $game_temp.shop_calling = false
    # Straighten player position
    $game_player.straighten
    # Switch to shop screen
    $scene = Scene_Shop.new
  end
  #--------------------------------------------------------------------------
  # * Name Input Call
  #--------------------------------------------------------------------------
  def call_name
    # Clear name input call flag
    $game_temp.name_calling = false
    # Straighten player position
    $game_player.straighten
    # Switch to name input screen
    $scene = Scene_Name.new
  end
  #--------------------------------------------------------------------------
  # * Menu Call
  #--------------------------------------------------------------------------
  def call_menu
    # Clear menu call flag
    $game_temp.menu_calling = false
    # If menu beep flag is set
    if $game_temp.menu_beep
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Clear menu beep flag
      $game_temp.menu_beep = false
    end
    # Straighten player position
    $game_player.straighten
    # Switch to menu screen
    $scene = Scene_Menu.new
  end
  #--------------------------------------------------------------------------
  # * Save Call
  #--------------------------------------------------------------------------
  def call_save
    # Straighten player position
    $game_player.straighten
    # Switch to save screen
    $scene = Scene_Save.new
  end
  #--------------------------------------------------------------------------
  # * Debug Call
  #--------------------------------------------------------------------------
  def call_debug
    # Clear debug call flag
    $game_temp.debug_calling = false
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Straighten player position
    $game_player.straighten
    # Switch to debug screen
    $scene = Scene_Debug.new
  end
  #--------------------------------------------------------------------------
  # * Player Place Move
  #--------------------------------------------------------------------------
  def transfer_player
    # Clear player place move call flag
    $game_temp.player_transferring = false
    # If move destination is different than current map
    if $game_map.map_id != $game_temp.player_new_map_id
      # Set up a new map
      $game_map.setup($game_temp.player_new_map_id)
    end
    # Set up player position
    $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
    # Set player direction
    case $game_temp.player_new_direction
    when 2  # down
      $game_player.turn_down
    when 4  # left
      $game_player.turn_left
    when 6  # right
      $game_player.turn_right
    when 8  # up
      $game_player.turn_up
    end
    # Straighten player position
    $game_player.straighten
    # Update map (run parallel process event)
    $game_map.update
    # remake heart meter?
    #@corazones.dispose#################################################[insert]
    #@corazones = Window_Corazones.new##################################[insert]
    #@corazones.refresh#################################################[insert]
        # Remake sprite set
    @spriteset.dispose
    @spriteset = Spriteset_Map.new
    # If processing transition
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      Graphics.transition(20)
    end
    # Run automatic change for BGM and BGS set on the map
    $game_map.autoplay
    # Frame reset
    Graphics.frame_reset
    # Update input information
    Input.update
    #
    
  end
end

now here's my remaining challenges:
1.) use a switch or call script to turn off/on
2.) add more hearts as the game progresses
  

@modern algebra - thank you for your efforts, if there's anything you're looking for such as resources, etc...
allow me to return the favor... I really do appreciate you for helping me out on this...
(oh so close to resurrecting this crappy script for being such a cool idea ~g)

 
« Last Edit: September 07, 2009, 10:49:32 AM by gameface101 »

***
Rep:
Level 83
X-PLAT!
a few more things I would like to mention is that
this script doesn't require any graphics
the script itself draws the hearts!
another cool thing about this is that
you got options!
0 = nothing
1 = displays actor's name
2 = show value/max
3 = show hearts/max
4 = HP percentage
 
oh! and here's the latest screenshot!


now only if this had a switch to set on/off
and a way to add more hearts when you progress... ~g

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
For adding a switch, just go to where you put in the refresh method and put this line below it:

Code: [Select]
@corazones.visible = $game_switches[x]

Where x is the ID of the switch you want it to work with.


Adding hearts isn't very hard either; all you need to do is change the @hearts variable of the corazones window. To make it dynamic, all you will need to do is add to the script to make it so that that is not fixed at 10, but is instead based off of a variable that can be changed in Game_Actor.

***
Rep:
Level 83
X-PLAT!
@modern algebra - man you rock!  we're like 99% there...

the switch works like a charm ^,^

now for dynamically adding more hearts!
I have no idea where to begin with editing the Game_Actor script....

so what I've done was replace
Code: [Select]
corazones = 3
with
Code: [Select]
corazones = @value=$game_variables[2]
to control the amount of heart containers
based off the value of a variable...
 
Now the last and final challenge is....
to get this setting to update or refresh
as the variable's value changes in game.

*though I've really learned a lot,
I know I have a lot more to learn when it comes to scripting...
thanks again for sharing your wisdom!

~g

 

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
At the start of the refresh method of the window, include this code:

Code: [Select]
@hearts = $game_variables[2]

***
Rep:
Level 83
X-PLAT!
@modern algebra - I tried including the code above to the refresh method in Scene_Map
along with a few other attempts... no luck.

just wondering... should I try a similar method to the one used for refreshing HP?
Code: [Select]
old_hp = $game_party.actors[0].hp
and then below
Code: [Select]
@corazones.refresh if old_hp != $game_party.actors[0].hp


along with an "else"???
and then something like...

Code: [Select]
heart = $game_variables[2]
and then below
Code: [Select]
@corazones.refresh if heart !=$game_variables[2]

"?"

giving my best effort towards the final solution. ~g

« Last Edit: September 08, 2009, 12:56:49 AM by gameface101 »

*
Rep:
Level 102
2014 Biggest Narcissist Award2014 Biggest Forum Potato2014 Best Non-RM Creator2013 Best Game Creator (Non-RM)2013 Best IRC ChatterboxParticipant - GIAW 112012 Most Successful Troll2012 Funniest Member2012 Best Use Of Avatar and Signature space2012 Best IRC ChatterboxSecret Santa 2012 ParticipantProject of the Month winner for November 2009For being a noted contributor to the RMRK Wiki2010 Most Successful Troll2010 Biggest Forum Couch Potato2010 Best IRC Chatterbox
I think it may be easier to make this with events, if you're having trouble with scripting.

***
Rep:
Level 83
X-PLAT!
@Irock - well it's just down to figuring out one more thing...

the refresh/update method for when more hearts are added by changing the variable.
right now I'm able to do so by calling the menu/ exiting menu...

modern algebra has been so kind to get me this far...
it's just a matter of time as to what line of code and where it goes. ~g



*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
@modern algebra - I tried including the code above to the refresh method in Scene_Map
along with a few other attempts... no luck.


Not in Scene_Map, in Window_Corazones

***
Rep:
Level 83
X-PLAT!

Quote
Not in Scene_Map, in Window_Corazones

@modern algebra - yeah I tried that in my "other attempts"

right now I'm currently working on an alias method with Scene_Map so that it's just one script to mess with...
once that's done it maybe a little easier to figure out how to update/refresh both HP and amount of Hearts.

I know anythings possible through events,
but who wouldn't appreciate a plug in play script
that displays Hearts for HP
with lots of options to customize
and doesn't require any graphics???

you are definitely getting a special thanks for hanging in there with me...~g
 

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Are you sure you tried that in one of your other attempts?

If so, where did you put it?

Because I'm certain it will work.

***
Rep:
Level 83
X-PLAT!
@modern algebra - I had placed
Code: [Select]
@hearts = $game_variables[2]
below
Code: [Select]
def refresh
in the Heart script.... still had the same issue (call menu/exit menu to update/refresh)

right now I have the script working through an alias method with Scene_Map
(leaving Scene_Map "untouched")
here my latest edits:
Spoiler for:
Code: [Select]
class Window_Corazones < Window_Base

   def initialize
     super(-8, 410, 640, 96)############################[window position & size]

#[SETTINGS]     

#corazones = 10 #use this setting for a fixed number of hearts. or...
corazones = @value=$game_variables[2]#to control amount of hearts by variable.
opacidad = 255 #opacity: 0= invisible to 255= solid
opcion = 1 #info text, review the options below:

#[OPTIONS]

# Corazones = (number of hearts you wish to display)
# Opacidad  = (how clear or soild in appearance)   
# Options   = (settings for information text)
# 0=Blank 1=Hero name 2=Value/MaxValue 3=Hearts/Maxhearts 4=HP%

      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.font.name = "Impact"#---------------------------=[FONT TYPE]
      self.contents.font.size = 24#---------------------------------=[FONT SIZE]
      self.z = 3000#-------------------------------------------------=[BLENDING]
      self.opacity = 0 #------------------------------------------=[WINDOW SKIN]
      @hearts = corazones
      @opacity = opacidad
      @option = opcion
      @hr = 0
      refresh
      end
      def refresh
      @hearts = $game_variables[2] 
      self.contents.clear
      @corazones = $game_variables[2]##################################[insert]
      @n = $game_party.actors[0].hp
      @mn = $game_party.actors[0].maxhp
      #n is the value, and mn the maxvalue:
      @hr = 0
      @lh = 0
###############################################################[black for empty]           
      for i in 0..@hearts-1
         self.contents.fill_rect(i*24, 4, 1, 2, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+1, 3, 1, 4, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+2, 2, 1, 6, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+3, 1, 1, 8, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+4, 0, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+5, 1, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+6, 2, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+7, 1, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+8, 0, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+9, 1, 1, 8, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+10, 2, 1, 6, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+11, 3, 1, 4, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+12, 4, 1, 2, Color.new(0, 0, 0, @opacity))
#############################################################[white for outline]     
         self.contents.fill_rect(i*24+1, 4, 1, 2, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+2, 3, 1, 4, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+3, 2, 1, 6, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+4, 1, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+5, 2, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+6, 3, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+7, 2, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+8, 1, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+9, 2, 1, 6, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+10, 3, 1, 4, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+11, 4, 1, 2, Color.new(255, 255, 255, @opacity))
#######################################################################[fill in]
         @c = 255
         @l = @n*100/@mn
         @ho = @l*@hearts
         c_color(1)
         self.contents.fill_rect(i*24+2, 4, 1, 2, Color.new(@c, 0, 0, @opacity))
         c_color(2)
         self.contents.fill_rect(i*24+3, 3, 1, 4, Color.new(@c, 0, 0, @opacity))
         c_color(3)
         self.contents.fill_rect(i*24+4, 2, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(4)
         self.contents.fill_rect(i*24+5, 3, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(5)
         self.contents.fill_rect(i*24+6, 4, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(6)
         self.contents.fill_rect(i*24+7, 3, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(7)
         self.contents.fill_rect(i*24+8, 2, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(8)
         self.contents.fill_rect(i*24+9, 3, 1, 4, Color.new(@c, 0, 0, @opacity))
         c_color(9)
         self.contents.fill_rect(i*24+10, 4, 1, 2, Color.new(@c, 0, 0, @opacity))

         @hr += 1
       end
       
##############################################[need update]
def update
#super
@corazones.visible = $game_switches[2]##################################[insert]
refresh
end
       
#######################################################################[options]     
      if @option == 1
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, $game_party.actors[0].name, 0)
      elsif @option == 2
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@n}/#{@mn}", 0)
      elsif @option == 3
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@ho/100}/#{@hearts}", 0)
      elsif @option == 4
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@l}%", 0)
      end
   end
 
end
##################################################################[color method]
def c_color(a)
if @hr <= (@ho/100)-1
@c = 255 #
else
if @ho/10-@hr*10 >= a and @ho/10-@hr*10 <= 9

@c = 255 #
else
@c = 0 #
end
end
end
################################################################################



########################################################################[insert]
# Scene_Map #
#############
class Scene_Map
alias gface1_main main
def main #MAIN
@Corazones = Window_Corazones.new#######################################[insert]
gface1_main
@Corazones.dispose######################################################[insert]
end
alias gface1_update update
def update #UPDATE
gface1_update
old_hp = $game_party.actors[0].hp#######################################[insert]
      $corazones.refresh if old_hp != $game_party.actors[0].hp##########[insert]
      end
   end

try not to laugh ^,^ - it works!
this time it has the same issues with updating/refreshing
(having to call menu/exit menu to update/refresh)
but not only is it the amount of hearts it's HP as well
oh and the switch won't work  X(

at least it's down to editing one script
which should make it a little easier to code. ~g
« Last Edit: September 08, 2009, 09:28:34 PM by gameface101 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Code: [Select]
def main #MAIN
@Corazones = Window_Corazones.new#######################################[insert]
gface1_main
@Corazones.dispose######################################################[insert]
end
alias gface1_update update
def update #UPDATE
gface1_update
old_hp = $game_party.actors[0].hp#######################################[insert]
      $corazones.refresh if old_hp != $game_party.actors[0].hp##########[insert]
        break
      end
   end

You have corazones as a global variable when you refresh it (it should be @, not $)

Also, you shouldn't capitalize the names of variables, so @corazones, not @Corazones.

That's just a convention though.

***
Rep:
Level 83
X-PLAT!
@modern algebra - Ok, I cleaned it up and got the switch working again...
                          now I'm trying to get the HP working as it did when
                          the Scene_Map was edited... so close~ and now it's just one script ^,^
                          muchas gracias amigo! this wouldn't of been possible if it weren't for you ~g

here's the latest screen shot:

and here's the latest edit to the script:
Spoiler for:
Code: [Select]
class Window_Corazones < Window_Base

   def initialize
     super(-8, 410, 640, 96)############################[window position & size]

#[SETTINGS]    

#corazones = 10 #use this setting for a fixed number of hearts. or...
corazones = $game_variables[2]#to control amount of hearts by variable.
opacidad = 255 #opacity: 0= invisible to 255= solid
opcion = 1 #info text, review the options below:

#[OPTIONS]

# Corazones = (number of hearts you wish to display)
# Opacidad  = (how clear or soild in appearance)    
# Options   = (settings for information text)
# 0=Blank 1=Hero name 2=Value/MaxValue 3=Hearts/Maxhearts 4=HP%

      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.font.name = "Impact"#---------------------------=[FONT TYPE]
      self.contents.font.size = 24#---------------------------------=[FONT SIZE]
      self.z = 3000#-------------------------------------------------=[BLENDING]
      self.opacity = 0 #------------------------------------------=[WINDOW SKIN]
      @hearts = corazones
      @opacity = opacidad
      @option = opcion
      @hr = 0
      refresh
      end
      def refresh
      @hearts = $game_variables[2]######################################[insert]  
      self.contents.clear
      @n = $game_party.actors[0].hp
      @mn = $game_party.actors[0].maxhp
      #n is the value, and mn the maxvalue:
      @hr = 0
      @lh = 0
###############################################################[black for empty]            
      for i in 0..@hearts-1
         self.contents.fill_rect(i*24, 4, 1, 2, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+1, 3, 1, 4, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+2, 2, 1, 6, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+3, 1, 1, 8, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+4, 0, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+5, 1, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+6, 2, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+7, 1, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+8, 0, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+9, 1, 1, 8, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+10, 2, 1, 6, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+11, 3, 1, 4, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*24+12, 4, 1, 2, Color.new(0, 0, 0, @opacity))
#############################################################[white for outline]      
         self.contents.fill_rect(i*24+1, 4, 1, 2, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+2, 3, 1, 4, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+3, 2, 1, 6, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+4, 1, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+5, 2, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+6, 3, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+7, 2, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+8, 1, 1, 8, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+9, 2, 1, 6, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+10, 3, 1, 4, Color.new(255, 255, 255, @opacity))
         self.contents.fill_rect(i*24+11, 4, 1, 2, Color.new(255, 255, 255, @opacity))
#######################################################################[fill in]
         @c = 255
         @l = @n*100/@mn
         @ho = @l*@hearts
         c_color(1)
         self.contents.fill_rect(i*24+2, 4, 1, 2, Color.new(@c, 0, 0, @opacity))
         c_color(2)
         self.contents.fill_rect(i*24+3, 3, 1, 4, Color.new(@c, 0, 0, @opacity))
         c_color(3)
         self.contents.fill_rect(i*24+4, 2, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(4)
         self.contents.fill_rect(i*24+5, 3, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(5)
         self.contents.fill_rect(i*24+6, 4, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(6)
         self.contents.fill_rect(i*24+7, 3, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(7)
         self.contents.fill_rect(i*24+8, 2, 1, 6, Color.new(@c, 0, 0, @opacity))
         c_color(8)
         self.contents.fill_rect(i*24+9, 3, 1, 4, Color.new(@c, 0, 0, @opacity))
         c_color(9)
         self.contents.fill_rect(i*24+10, 4, 1, 2, Color.new(@c, 0, 0, @opacity))

         @hr += 1
       end
      
########################################################################[update]
#def update ?
#######################################################################[options]      
      if @option == 1
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, $game_party.actors[0].name, 0)
      elsif @option == 2
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@n}/#{@mn}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@n}/#{@mn}", 0)
      elsif @option == 3
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@ho/100}/#{@hearts}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@ho/100}/#{@hearts}", 0)
      elsif @option == 4
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@l}%", 0)
      end
   end
 
end
##################################################################[color method]
def c_color(a)
if @hr <= (@ho/100)-1
@c = 255 #
else
if @ho/10-@hr*10 >= a and @ho/10-@hr*10 <= 9

@c = 255 #
else
@c = 0 #
end
end
end
################################################################################



########################################################################[insert]
# Scene_Map #
#############
class Scene_Map
alias gface1_main main
def main #MAIN
@corazones = Window_Corazones.new#######################################[insert]
gface1_main
@corazones.dispose######################################################[insert]
end
alias gface1_update update
def update #UPDATE
gface1_update
old_hp = $game_party.actors[0].hp#######################################[insert]
      @corazones.refresh if old_hp != $game_party.actors[0].hp##########[insert]
      @corazones.visible = $game_switches[2]############################[insert]
      end
   end
« Last Edit: September 08, 2009, 11:22:54 PM by gameface101 »

***
Rep:
Level 83
X-PLAT!
ALRIGHT! - DarkRog, if you're still out there... I just want to say
I hope you like what I've done to your script!
with the help from Modern Algebra, this new version has

+ an alias method with Scene_Map, just copy and paste one script!
+ 1 switch for display, enable or disable display!
+ 1 variable for amount of hearts, instead of a fixed number
 

I'm posting a new thread with the current working script
for the world to enjoy to gather feedback and offer user support.
http://rmrk.net/index.php/topic,34731.0.html

and I would like to continue this thread for continuous improvement...

more customizations to this script:

- vertical alignment option
- animations transitions
- custom graphics
- and better coding


 ~g/A\/\/\|E|F/A\(C|=l
« Last Edit: September 11, 2009, 06:40:02 AM by gameface101 »

***
Rep:
Level 83
X-PLAT!
would anyone possibly know how to make a "star shape" instead of a heart???

I would like to use this for MP as well...? that's right "Star Containers for SP!"

still working on vertical alignment... ~g

« Last Edit: September 20, 2009, 10:04:17 AM by gameface101 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, this script creates the hearts in the script itself, (rather inefficiently), so if you wanted to do it the same way you would essentially have to simply find an algorithm that makes the star. It would be simpler if you used pictures.

***
Rep:
Level 83
X-PLAT!
here's a screen shot of my latest edit...



now I'm trying to make these "blue hearts" into "yellow stars"

I'm just using a copy of the heart script
(now the STAR script: by changing keywords,alias, HP to SP, etc...)
Spoiler for:
Code: [Select]
################################################################################
# THE "NEW" and "IMPROVED" STAR CONTAINER, STARS FOR MP, STAR SYSTEM SCRIPT!
# revised by ~g/A\/\/\|E|F/A\(C|= 101
# V 1.1(2009) 
#
# original script by DarkRog (2006)
# a BIG special thanks to modern algebra on helping me out on this.
#
# http://rmrk.net/index.php/topic,34542.0.html
#
################################################################################
# Instructions:
#
# Ok Kids! Simply copy and paste above Main like any plug'n'play script!
# Doesn't require any graphics!
# Easy to adjust your very own custom settings!
#
#(optional)
# - 1 switch (default is 2)
# - 1 variable (default is 2)
# you only need to assign a switch to enable/disable display
# and assign a variable to dynamically add/remove stars
################################################################################

class Window_Estrellas < Window_Base

   def initialize
     #super(-8, 410, 640, 96)#-----------=[x,y window position & x,y window size]
     #[bottom left] or
    super(-1, 2, 640, 96)#------------=[x,y window position & x,y window size]
     #[top left]


#[Star Containers] (number of stars you wish to display)
#--------------------------------------------------
#estrellas = 10 #[use this setting for a fixed number of stars] or...
estrellas = $game_variables[1]#to control amount of stars by variable.

#[Opacity] (how clear or solid in appearance)
#--------------------------------------------------
opacidad = 255 #opacity: 0= invisible to 255= solid

#[Options] 0 =Blank 1 =Hero's name 2 =Value/MaxValue 3 =Stars/Maxstars 4 =HP%
#--------------------------------------------------
opcion = 0#info text, review the options above:

      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.font.name = "Impact"#---------------------------=[FONT TYPE]
      self.contents.font.size = 24#---------------------------------=[FONT SIZE]
      self.z = 3000#-------------------------------------------------=[BLENDING]
      self.opacity = 0 #------------------------------------------=[WINDOW SKIN]
      @stars = estrellas
      @opacity = opacidad
      @option = opcion
      @hr = 0
      refresh
      end
      def refresh
      @stars = $game_variables[1]#-------------------------------=[Variable_ID] 
      self.contents.clear
      @e = $game_party.actors[0].sp
      @me = $game_party.actors[0].maxsp
      #n is the value, and mn the maxvalue:
      @hr = 0
      @lh = 0
#[containers]     #coordinates = i*14,= left point
                  #second number    4,
                  #third number     4,
                  #fourth number    4,                 
      for i in 0..@stars-1
         #self.contents.fill_rect(i*14, 4, 1, 2, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14, 4, 1, 2, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+1, 3, 1, 4, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+2, 2, 1, 6, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+3, 1, 1, 8, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+4, 0, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+5, 1, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+6, 2, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+7, 1, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+8, 0, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+9, 1, 1, 8, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+10, 2, 1, 6, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+11, 3, 1, 4, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+12, 4, 1, 2, Color.new(0, 0, 0, @opacity))
#[outline]     
    self.contents.fill_rect(i*14+1, 4, 1, 2, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+2, 3, 1, 4, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+3, 2, 1, 6, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+4, 1, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+5, 2, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+6, 3, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+7, 2, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+8, 1, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+9, 2, 1, 6, Color.new(255, 255, 255, @opacity))
   self.contents.fill_rect(i*14+10, 3, 1, 4, Color.new(255, 255, 255, @opacity))
   self.contents.fill_rect(i*14+11, 4, 1, 2, Color.new(255, 255, 255, @opacity))
#[fill in]
         @c = 200#red
         @l = @e*100/@me#100
         @ho = @l*@stars   #@c, 200, 100 = yellow
         c_color(1)
         self.contents.fill_rect(i*14+2, 4, 1, 2, Color.new(0, 0, @c, @opacity))
         c_color(2)
         self.contents.fill_rect(i*14+3, 3, 1, 4, Color.new(0, 0, @c, @opacity))
         c_color(3)
         self.contents.fill_rect(i*14+4, 2, 1, 6, Color.new(0, 0, @c, @opacity))
         c_color(4)
         self.contents.fill_rect(i*14+5, 3, 1, 6, Color.new(0, 0, @c, @opacity))
         c_color(5)
         self.contents.fill_rect(i*14+6, 4, 1, 6, Color.new(0, 0, @c, @opacity))
         c_color(6)
         self.contents.fill_rect(i*14+7, 3, 1, 6, Color.new(0, 0, @c, @opacity))
         c_color(7)
         self.contents.fill_rect(i*14+8, 2, 1, 6, Color.new(0, 0, @c, @opacity))
         c_color(8)
         self.contents.fill_rect(i*14+9, 3, 1, 4, Color.new(0, 0, @c, @opacity))
         c_color(9)
        self.contents.fill_rect(i*14+10, 4, 1, 2, Color.new(0, 0, @c, @opacity))

         @hr += 1
       end
       
#[update]
  def update
    @value=$game_variables[1]#-------------=[to update current amount of Stars]
    $old_sp = $game_party.actors[0].sp#--------=[to update current amount of SP]
  end

#[options]     
      if @option == 1
         self.contents.font.color.set(0, 0, 0)
   self.contents.draw_text(0 - 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
   self.contents.draw_text(0 - 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
   self.contents.draw_text(0 + 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
   self.contents.draw_text(0 + 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.font.color = normal_color
           self.contents.draw_text(0, 7, 160, 32, $game_party.actors[0].name, 0)
      elsif @option == 2
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@e}/#{@me}", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@e}/#{@me}", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@e}/#{@me}", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@e}/#{@me}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@e}/#{@me}", 0)
      elsif @option == 3
         self.contents.font.color.set(0, 0, 0)
      self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@ho/100}/#{@stars}", 0)
      self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@ho/100}/#{@stars}", 0)
      self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@ho/100}/#{@stars}", 0)
      self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@ho/100}/#{@stars}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@ho/100}/#{@stars}", 0)
      elsif @option == 4
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@l}%", 0)
      end
   end
end
#[color method]
def c_color(a)
if @hr <= (@ho/100)-1
@c = 255 #
else
if @ho/10-@hr*10 >= a and @ho/10-@hr*10 <= 9

@c = 255 #
else
@c = 0 #
end
end
end

#############--------------------------------------=[alias method for Scene_Map]
# Scene_Map #
#############
class Scene_Map
 alias gface2_main main
   def main #MAIN
   @estrellas = Window_Estrellas.new
   gface2_main
   @estrellas.dispose
end
 alias gface2_update update
   def update #UPDATE
   gface2_update

      @estrellas.refresh if $old_sp != $game_party.actors[0].sp
      @estrellas.visible = $game_switches[1]#---------------------=[Variable_ID]
      @estrellas.update
    end
    end

@MA - how could I modify this script to be more efficient in creating the containers?

        - could you point me in the right direction for these algorithms??
          (multiple shapes!? now I'm excited! Stars, Lightning bolts, Diamonds, oh my!!!)

        I've been studying how this script creates and fills containers... still scratching my head (going bald)
        been messing around with these lines of code, no clue as to what I'm doing but I see the changes...
Code: [Select]
#[outline]     
    self.contents.fill_rect(i*14+1, 4, 1, 2, Color.new(255, 255, 255, @opacity))

        - if i were to incorporate pictures, would I have to assign a graphic for each heart and star???

though I have many questions, I'm actively looking for the answers...
and greatly appreciate how far you've brought me in my scripting level...
from 0 to level 0.2 ^,^ ~g
 




**
Rep:
Level 83
Detective Scrotes
would anyone possibly know how to make a "star shape" instead of a heart???

I would like to use this for MP as well...? that's right "Star Containers for MP!"

still working on vertical alignment... ~g


I would suggest you just make a star shape image instead of getting the engine to draw a star itself.

        - if i were to incorporate pictures, would I have to assign a graphic for each heart and star???

No, you would need one image, let's say of a star, called star.png.

Then let's say you have 10 SP and you want 10 stars draw.
Code: [Select]
bitmap = RPG::Cache.picture("star")
scr_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
for i in 0...$game_party.actors[0].sp
  self.contents.blt(x + i * bitmap.width, y, bitmap, src_rect)
end

That should draw 10 stars. You might have to fool around with the x position so that they have the correct spacing between them.
« Last Edit: September 17, 2009, 05:19:14 AM by albertfish »

***
Rep:
Level 83
X-PLAT!
@albertfish - thanks for your suggestion... but I'm not so script savvy as you and modern algebra... yet ^,^
maybe years from now, hopefully I will be... but in the mean time I am a neophyte when it comes to Ruby.
I just get lucky making edits here and there...I still need an expert to verify that these scripts are properly written.

so would I start with using something like
Code: [Select]
@stars.bitmap = RPG::Cache.picture("heart graphic")
 

"?"

~g


**
Rep:
Level 83
Detective Scrotes
so would I start with using something like
Code: [Select]
@stars.bitmap = RPG::Cache.picture("heart graphic")
 
Close, however @stars.bitmap will give you an error if bitmap isn't a function of @stars.

You can keep it as just bitmap if you want. All that it is is a variable that is storing the picture file. So just name it what ever you want. You can call it star, bitmap, starbitmap what ever :).

I'll comment the code I wrote so that you can understand every step if you don't know what they do.

Code: [Select]
bitmap = RPG::Cache.picture("star")
This locates the file named "star" in the Graphics/Pictures folder and stores it in the variable "bitmap".

Code: [Select]
scr_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
This creates a new rectangle that is as big as the image. If it is smaller than the image, it would cut off part of the image. So you can think of it as a bounding box.

Code: [Select]
for i in 0...$game_party.actors[0].sp
  self.contents.blt(x + i * bitmap.width, y, bitmap, src_rect)
end
These lines will draw the stars. self.contents.blt(x, y, bitmap, src_rect) draws the image "bitmap" and the coordinates x, and y, and src_rect is the image's 'bounding box'. The for loop here will repeat the blt command as many times as the amount of sp your actor has. So in the example I gave it would repeat it 10 times.

Now 'i' in the for loop increases after every loop by 1. So the first time it does the blt command i = 0 and so the x coordinate of the image is just x. The second time i = 1 so the x coordinate is x + bitmap.width, and so on.

Hope that helps :).
« Last Edit: September 17, 2009, 05:43:08 AM by albertfish »

***
Rep:
Level 83
X-PLAT!
@albertfish - thank you man you're awesome...i think my brain exploded...

@#*%!
  ~  ~
  `_`
   g

I did try to kick around the coding, compare them to other scripts...
this is what I came up with:

Code: [Select]
class Window_Estrellas < Window_Base #---------=[call class]

   def initialize#----------------------=[define load]
    super(-1, 2, 640, 96)#--------------=[x,y window position & x,y window size]          
  bitmap = RPG::Cache.picture("star")#---------------------------=[store bitmap]
  scr_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#----------=[bitmap box]  
      for i in 0...$game_party.actors[0].sp#-------------------=[display layout]
        self.contents.blt(x + i * bitmap.width, y, bitmap, src_rect)
        end

I either get a syntax error or src_rect error.

I'm not certain of which lines of code I should comment,
now that I'm using a different method to display containers...

I'm trying to use these graphics now:

Heart Icon

Star Icon

 
I'm really looking forward to seeing these scripts with graphics in action...
but wouldn't that require graphics for the container, outline, and fill as well?

thanks again! ~g
« Last Edit: September 17, 2009, 08:20:12 AM by gameface101 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
the error is just a spelling error:

you set scr_rect, but then use src_rect.

You also, technically, don't need to set src_rect as it is the same as bitmap.rect in this case. But you should keep it for a reason I will soon explain.

When it comes to filling a star, it depends on how you want to fill it. If you want to fill it by row, you can change the src_rect so that only part of the bitmap is shown.

**
Rep:
Level 83
Detective Scrotes
I'm trying to use these graphics now:

Heart Icon

Star Icon

 
I'm really looking forward to seeing these scripts with graphics in action...
but wouldn't that require graphics for the container, outline, and fill as well?

thanks again! ~g
You would only need another image if you wanted a blank heart to display when the actor gets hurt.

If you want it to draw an 'empty' heart or star when hp and sp is used the you can do something like this.

Code: [Select]
for i in 0...$game_party.actors[0].maxsp # maxhp for hearts
   if i >= $game_party.actors[0].sp
    # Draw a complete heart/star
  else
    # Draw an empty heart/star
  end
end

***
Rep:
Level 83
X-PLAT!
@MA - nice catch! and now I understand what you mean by the src_rect decreasing in size...
          as if it were shrinking horizontally... whatever is the most simplest for now...
          as I feel I'm asking for too much already, that's why I'm trying my best as well.

          * if I could script like you and albertfish, I'd make it so that each heart/star
             would fill from bottom to top and empty from top to bottom...
             and once a container is completely emptied, for that empty container graphic
             to expand then disappear... only to reappear again when hp/sp has been restored.

@albertfish - so I've whipped up these to be the empty versions of the containers.
            empty heart
           
            empty star
           

            ok, so here's the latest edit to the script:
            I've tried to comment every line to the best of my knowledge
Spoiler for:
Code: [Select]
class Window_Estrellas < Window_Base#------------------------------=[call class]

   def initialize#------------------------------------------------=[define load]
#[bottom left]
     #super(-8, 410, 640, 96)#----------=[x,y window position & x,y window size]
#[top left]
    super(-1, 2, 640, 96)#--------------=[x,y window position & x,y window size]
   
#################################################################[PICTURE SETUP]           
# def draw_stars 
bitmap = RPG::Cache.picture("star")#-----------------------------=[store bitmap]
  src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#----------=[bitmap box]
      for i in 0...$game_party.actors[0].sp#-------------------=[display layout]
      self.contents.blt(x + i * bitmap.width, y, bitmap, src_rect)#crash
    end
  for i in 0...$game_party.actors[0].maxsp#-------------=[show maxhp for hearts]
   if i >= $game_party.actors[0].sp#-------------------=[condition for graphics]
    # Draw a complete heart/star
solid_star = RPG::Cache.picture("star")   
  else
    # Draw an empty heart/star
empty_star = RPG::Cache.picture("star container")     
   
#################################################################[PICTURE SETUP]


#[Star Containers] (number of stars you wish to display)
#--------------------------------------------------
#estrellas = 10 #[use this setting for a fixed number of stars] or...
estrellas = $game_variables[1]#to control amount of stars by variable.

#[Opacity] (how clear or solid in appearance)
#--------------------------------------------------
opacidad = 255 #opacity: 0= invisible to 255= solid

#[Options] 0 =Blank 1 =Hero's name 2 =Value/MaxValue 3 =Stars/Maxstars 4 =HP%
#--------------------------------------------------
opcion = 0#info text, review the options above:

      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.font.name = "Impact"#---------------------------=[FONT TYPE]
      self.contents.font.size = 24#---------------------------------=[FONT SIZE]
      self.z = 3000#-------------------------------------------------=[BLENDING]
      self.opacity = 0 #------------------------------------------=[WINDOW SKIN]
      @stars = estrellas
      @opacity = opacidad
      @option = opcion
      @hr = 0
      refresh
    end
  end#
  end#
      def refresh
      @stars = $game_variables[1]#--------------------------------=[Variable_ID] 
      self.contents.clear
      @e = $game_party.actors[0].sp
      @me = $game_party.actors[0].maxsp
      #n is the value, and mn the maxvalue:
      @hr = 0
      @lh = 0

#[containers]     #coordinates = i*14,= left point
                  #second number    4,
                  #third number     4,
                  #fourth number    4,                 
      for i in 0..@stars-1
         #self.contents.fill_rect(i*14, 4, 1, 2, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14, 4, 1, 2, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+1, 3, 1, 4, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+2, 2, 1, 6, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+3, 1, 1, 8, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+4, 0, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+5, 1, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+6, 2, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+7, 1, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+8, 0, 1, 10, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+9, 1, 1, 8, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+10, 2, 1, 6, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+11, 3, 1, 4, Color.new(0, 0, 0, @opacity))
         self.contents.fill_rect(i*14+12, 4, 1, 2, Color.new(0, 0, 0, @opacity))
#[outline]     
    self.contents.fill_rect(i*14+1, 4, 1, 2, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+2, 3, 1, 4, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+3, 2, 1, 6, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+4, 1, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+5, 2, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+6, 3, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+7, 2, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+8, 1, 1, 8, Color.new(255, 255, 255, @opacity))
    self.contents.fill_rect(i*14+9, 2, 1, 6, Color.new(255, 255, 255, @opacity))
   self.contents.fill_rect(i*14+10, 3, 1, 4, Color.new(255, 255, 255, @opacity))
   self.contents.fill_rect(i*14+11, 4, 1, 2, Color.new(255, 255, 255, @opacity))
#[fill in]
         @c = 200#red
         @l = @e*100/@me#100
         @ho = @l*@stars   #@c, 200, 100 = yellow
         c_color(1)
         self.contents.fill_rect(i*14+2, 4, 1, 2, Color.new(0, 0, @c, @opacity))
         c_color(2)
         self.contents.fill_rect(i*14+3, 3, 1, 4, Color.new(0, 0, @c, @opacity))
         c_color(3)
         self.contents.fill_rect(i*14+4, 2, 1, 6, Color.new(0, 0, @c, @opacity))
         c_color(4)
         self.contents.fill_rect(i*14+5, 3, 1, 6, Color.new(0, 0, @c, @opacity))
         c_color(5)
         self.contents.fill_rect(i*14+6, 4, 1, 6, Color.new(0, 0, @c, @opacity))
         c_color(6)
         self.contents.fill_rect(i*14+7, 3, 1, 6, Color.new(0, 0, @c, @opacity))
         c_color(7)
         self.contents.fill_rect(i*14+8, 2, 1, 6, Color.new(0, 0, @c, @opacity))
         c_color(8)
         self.contents.fill_rect(i*14+9, 3, 1, 4, Color.new(0, 0, @c, @opacity))
         c_color(9)
        self.contents.fill_rect(i*14+10, 4, 1, 2, Color.new(0, 0, @c, @opacity))

         @hr += 1
       end
       
#[update]
  def update
    @value=$game_variables[1]#-------------=[to update current amount of Stars]
    $old_sp = $game_party.actors[0].sp#--------=[to update current amount of SP]
  end

#[options]     
      if @option == 1
         self.contents.font.color.set(0, 0, 0)
   self.contents.draw_text(0 - 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
   self.contents.draw_text(0 - 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
   self.contents.draw_text(0 + 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
   self.contents.draw_text(0 + 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.font.color = normal_color
           self.contents.draw_text(0, 7, 160, 32, $game_party.actors[0].name, 0)
      elsif @option == 2
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@e}/#{@me}", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@e}/#{@me}", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@e}/#{@me}", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@e}/#{@me}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@e}/#{@me}", 0)
      elsif @option == 3
         self.contents.font.color.set(0, 0, 0)
      self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@ho/100}/#{@stars}", 0)
      self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@ho/100}/#{@stars}", 0)
      self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@ho/100}/#{@stars}", 0)
      self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@ho/100}/#{@stars}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@ho/100}/#{@stars}", 0)
      elsif @option == 4
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@l}%", 0)
      end
   end
end#
#[color method]
def c_color(a)
if @hr <= (@ho/100)-1
@c = 255 #
else
if @ho/10-@hr*10 >= a and @ho/10-@hr*10 <= 9

@c = 255 #
else
@c = 0 #
end
end
end

#############--------------------------------------=[alias method for Scene_Map]
# Scene_Map #
#############
class Scene_Map
 alias gface2_main main
   def main #MAIN
   @estrellas = Window_Estrellas.new
   gface2_main
   @estrellas.dispose
end
 alias gface2_update update
   def update #UPDATE
   gface2_update

      @estrellas.refresh if $old_sp != $game_party.actors[0].sp
      @estrellas.visible = $game_switches[1]#---------------------=[Variable_ID]
      @estrellas.update
    end
  end

  I get a line 38 error undefined method for "blt" for nil:nilclass
  I'm guessing it has something to do with using some of the existing lines of codes...?
 
Code: [Select]
   def initialize#------------------------------------------------=[define load]
    super(-1, 2, 640, 96)#--------------=[x,y window position & x,y window size]
           
 and am I sequencing it correctly??

 -class
-def initialize
*
*
*
def refresh
*
*
*
def update
*
*
*
alias

thanks guys, it's as if you naturally use 20% of the brain
                  as I'm trying to keep up with my 5% ~ g

           

**
Rep:
Level 83
Detective Scrotes
@gameface101 the nil class error is because it is attempting to draw the graphic, but no content container has being defined. To do so add this line:
Code: [Select]
def initialize#------------------------------------------------=[define load]
  super(-1, 2, 640, 96)#--------------=[x,y window position & x,y window size]
  self.contents = Bitmap.new(width-32, height-32)

That should fix the error. Also you can place the draw stars code in the refresh function so that it updates.

There are also a few minor changes to the draw stars that should be made:
Code: [Select]
bitmap = RPG::Cache.picture("star")#-----------------------------=[store bitmap]
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#----------=[bitmap box]
  for i in 0...$game_party.actors[0].sp#-------------------=[display layout]
    self.contents.blt(x + i * bitmap.width, y, bitmap, src_rect)#crash
  end
This code is not needed if you used the other piece of code that drew the empty stars. You simply need:
Also I made a mistake, the if statement should be less then or equal too. I've changed that in the following code.
Code: [Select]
for i in 0...$game_party.actors[0].maxsp#-------------=[show maxhp for hearts]
  if i <= $game_party.actors[0].sp#-------------------=[condition for graphics]
    # Draw a complete heart/star
    bitmap = RPG::Cache.picture("star") #------=[store the full star image file in bitmap]
  else
    # Draw an empty heart/star
    bitmap = RPG::Cache.picture("star container") #------=[store the empty star image file in bitmap]
  end
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) #------=[create a new rectangle]
self.contents.blt(x, y, bitmap, src_rect) #------=[draw the image]
What this does is repeats the for loop as many times as your maxhp. So if you have maxhp of 10 but you currently only have 7hp it will go through the loop 10 times. The first 7 times, it will draw a full heart, due to the if statement, the next 3 times it will draw a empty heart.

This is because when i is less than or equal to 7 the if statement will be true and set the bitmap to the full star. Once i is greater than 7, the if statement will no longer be true and there for set the bitmap to the empty star.

You could even make the 'drawing stars' it's own function like so.

Code: [Select]
def draw_stars
  #insert the code that draws the stars (from above)
end

And then in the refresh function you have to call the draw_stars function

Code: [Select]
def refresh
  self.contents.clear
  draw_stars
  #other refresh code here (maybe have another separate function to draw hearts)
end

Also, you mentioned you would like to have the star empty down, and fill up... This can be done easily with the src_rect by changing the height value. Once you get this script all figured out and are more comfortable with it I can gladly help you with that.

Edit: Okay, so I quickly coded up a hearts and stars display script so that I can help you out better and I have one thing to correct.

The for loop should read for i in 1...$game_party.actors[0].maxsp + 1
The changes I made are bold.

This correctly displays the hearts :P.

Hope this all helps! I can answer any further questions you may have.
« Last Edit: September 18, 2009, 01:06:58 AM by albertfish »

***
Rep:
Level 83
X-PLAT!
@albertfish - right on! thanks for sharing your wisdom...

ok so here's my latest attempt to the new picture using star script:
Spoiler for:
Code: [Select]
#picture stars SP meter!
class Window_Starrz < Window_Base
 
def initialize#---------------------------------------------------=[define load]
  super(-1, 100, 640, 96)#--------------=[x,y window position & x,y window size]

starrz = $game_variables[1]#to control amount of stars by variable.
opacity = 255 #opacity: 0= invisible to 255= solid
option = 1#info text, review the options above: 
 
      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.font.name = "Impact"#---------------------------=[FONT TYPE]
      self.contents.font.size = 24#---------------------------------=[FONT SIZE]
      self.z = 3000#-------------------------------------------------=[BLENDING]
      self.opacity = 200 #----------------------------------------=[WINDOW SKIN]

      bitmap = RPG::Cache.picture("star")#-----------------------------=[store bitmap]
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#----------=[bitmap box]
      for i in 0...$game_party.actors[0].sp#-------------------=[display layout]
      self.contents.blt(x + i * bitmap.width, y, bitmap, src_rect)#
      @starrzz = starrz
      @opacity = opacity
      @option = option
      refresh
    end
    end
#######################################################################[refresh]
def refresh
  @starrzz = $game_variables[1]#----------------------------------=[Variable_ID]
  self.contents.clear
  for i in 0...$game_party.actors[0].sp#-------------------=[display layout]
  self.contents.blt(x + i * bitmap.width, y, bitmap, src_rect)#
 
  for i in 1...$game_party.actors[0].maxsp + 1 #--------=[show maxhp for hearts]
  if i <= $game_party.actors[0].sp#--------------------=[condition for graphics]
    # Draw a complete heart/star
    bitmap = RPG::Cache.picture("star")#-=[store full star image file in bitmap]
  else
    # Draw an empty heart/star
    bitmap = RPG::Cache.picture("star container")#--=[store empty star image file in bitmap]
  end
end
end
########################################################################[update]
  def update
    @value=$game_variables[1]#-------------=[to update current amount of Stars]
    $old_sp = $game_party.actors[0].sp#--------=[to update current amount of SP]
  end
 
#######################################################################[options]     
      if @option == 1
         self.contents.font.color.set(0, 0, 0)
   self.contents.draw_text(0 - 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
   self.contents.draw_text(0 - 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
   self.contents.draw_text(0 + 1, 7 - 1, 160, 32, $game_party.actors[0].name, 0)
   self.contents.draw_text(0 + 1, 7 + 1, 160, 32, $game_party.actors[0].name, 0)
         self.contents.font.color = normal_color
           self.contents.draw_text(0, 7, 160, 32, $game_party.actors[0].name, 0)
      elsif @option == 2
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@e}/#{@me}", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@e}/#{@me}", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@e}/#{@me}", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@e}/#{@me}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@e}/#{@me}", 0)
      elsif @option == 3
         self.contents.font.color.set(0, 0, 0)
      self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@ho/100}/#{@starrzz}", 0)
      self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@ho/100}/#{@starrzz}", 0)
      self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@ho/100}/#{@starrzz}", 0)
      self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@ho/100}/#{@starrzz}", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@ho/100}/#{@starrzz}", 0)
      elsif @option == 4
         self.contents.font.color.set(0, 0, 0)
         self.contents.draw_text(0 - 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 - 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 - 1, 160, 32, "#{@l}%", 0)
         self.contents.draw_text(0 + 1, 7 + 1, 160, 32, "#{@l}%", 0)
         self.contents.font.color = normal_color
         self.contents.draw_text(0, 7, 160, 32, "#{@l}%", 0)
      end
   end
#############--------------------------------------=[alias method for Scene_Map]
# Scene_Map #
#############
class Scene_Map
 alias gface3_main main
   def main #MAIN
   @starrzz = Window_Starrz.new
   gface3_main
   @starrzz.dispose
end
 alias gface3_update update
   def update #UPDATE
   gface3_update

      @starrzz.refresh if $old_sp != $game_party.actors[0].sp
      @starrzz.visible = $game_switches[1]#---------------------=[Variable_ID]
      @starrzz.update
    end
  end
  end

I keep getting an undefined method 'main' for class 'Window_Starrz::Scene_Map'
(which I have defined in the alias section) was I to keep the old lines of code?
did I place too many "end" 's?

if you don't mind...could you post the working script you made for testing?
I'd like to see the layout... to understand the sequence/flow of coding a little bit better...
and compare it with this one to see what I've left out? pls

I do feel I'm getting close...and look forward to learning more.
now I understand "bitmap" "src_rect" and the arguments in the "self.contents.blt"

I'll keep messing around with it.... and thanks again for being patient with me! ~g

**
Rep:
Level 83
Detective Scrotes
Yea, I can post it.

Code: [Select]
class Window_Hearts < Window_Base
  def initialize
    super (-16, -16, 640, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.opacity = 0
  end
  def update
    super
    refresh
  end
  def refresh
    self.contents.clear
    draw_star
    draw_heart
  end
  def draw_star
    x = 4
    y = 26
    y = 52 if $game_party.actors[0].maxhp > 10
    for i in 1...$game_party.actors[0].maxsp + 1
      if i <= $game_party.actors[0].sp
        # Draw a complete heart/star
        bitmap = RPG::Cache.picture("star")
      else
        # Draw an empty heart/star
        bitmap = RPG::Cache.picture("star container")
      end
      x, y = 4, 78 if i == 11
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
      self.contents.blt(x, y, bitmap, src_rect)
      x += 26
    end
  end
  def draw_heart
    x = 4
    y = 0
    for i in 1...$game_party.actors[0].maxhp + 1
      if i <= $game_party.actors[0].hp
        # Draw a complete heart/star
        bitmap = RPG::Cache.picture("heart")
      else
        # Draw an empty heart/star
        bitmap = RPG::Cache.picture("heart container")
      end
      x, y = 4, 26 if i == 11
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
      self.contents.blt(x, y, bitmap, src_rect)
      x += 26
    end
  end
end

class Scene_Map
  alias af_hc_hud_main main
  def main
    @hud_window = Window_Hearts.new
    af_hc_hud_main
    @hud_window.dispose
  end
  alias af_hc_hud_update update
  def update
    @hud_window.update
    af_hc_hud_update
  end
end

I did this really quick so I didn't comment it. So if there is any code you don't understand I will happily explain it to you.

Here is a screen shot of the result
Spoiler for:

Hope this helps you further understand.
« Last Edit: September 18, 2009, 04:51:21 AM by albertfish »

***
Rep:
Level 83
X-PLAT!
@albertfish - you're awesome! I will take a look at this and study it line by line...
                 
                  my intentions are to learn how to script, not copy and paste.
                  so that in time, I maybe like you and MA giving script support to
                  eager to learn programming noobs like me...
                  ok it's study time! thanks a bunch "albertfish!"

**
Rep:
Level 83
Detective Scrotes
@albertfish - you're awesome! I will take a look at this and study it line by line...
                 
                  my intentions are to learn how to script, not copy and paste.
                  so that in time, I maybe like you and MA giving script support to
                  eager to learn programming noobs like me...
                  ok it's study time! thanks a bunch "albertfish!"
You are welcome, and I know that is why you wanted the code. Also that is the only reason I supplied you with the code because I knew would would use it to learn.

Good luck and again, I can answer any questions.

***
Rep:
Level 83
X-PLAT!
@albertfish - this was so fun! there was just a few lines of code in your script I didn't understand...
I had commented them with #----=[?]
Spoiler for:
Code: [Select]
class Window_Hearts < Window_Base#-----------------------------=[in game window]
  def initialize#-------------------------------------------------=[define load]
    super (-16, -16, 640, 160)#-----------=[x,y window position x,y window size]
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh#------------------------------=[call refresh command]
    self.opacity = 0#---------------------=[window skin opacity]
  end#------------------------------------=[end definition]
########################################################################[UPDATE]
  def update#-----------------------------=[define update]
    super#--------------------------------=[update the super window]
    refresh#------------------------------=[call refresh command]
  end#------------------------------------=[end definition]
#######################################################################[REFRESH]  
  def refresh#----------------------------=[define refresh]
    self.contents.clear#------------------=[clear bitmap]
    draw_star#----------------------------=[call to draw_heart]
    draw_heart#---------------------------=[call to draw_star]
  end#------------------------------------=[end definition]
####################################################################[DRAW STARS]  
  def draw_star#--------------------------=[define draw_star]
    x = 4 #-------------------------------=[draw x coordinates]
    y = 26 #------------------------------------=[draw y coordinates]
    y = 52 if $game_party.actors[0].maxhp > 10 #----------------------=[?]
    for i in 1...$game_party.actors[0].maxsp + 1 #----------=[for loop stars]
      if i <= $game_party.actors[0].sp #-----------------------=[condition]
        # Draw a complete heart/star
        bitmap = RPG::Cache.picture("star")#draw
      else
        # Draw an empty heart/star
        bitmap = RPG::Cache.picture("star container")#draw
      end#----------------------------------------------=[end definition]
      x, y = 4, 78 if i == 11 #-------------------------------=[?]
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#---=[box of arguements?]
      self.contents.blt(x, y, bitmap, src_rect)#---=[box of arguements]
      x += 26 #---------------------------------------=[space icons evenly?]
    end#----------------------------------=[end 1st box]
  end#---------------------------------=[end 2nd box]
###################################################################[DRAW HEARTS]
  def draw_heart#-------------------------------------=[define draw_heart]
    x = 4 #-------------------------------=[draw x coordinates]
    y = 0 #------------------------------------=[draw y coordinates]
    for i in 1...$game_party.actors[0].maxhp + 1 #--=[for loop hearts]
      if i <= $game_party.actors[0].hp#----------=[condition]
        # Draw a complete heart/star
        bitmap = RPG::Cache.picture("heart")#draw
      else
        # Draw an empty heart/star
        bitmap = RPG::Cache.picture("heart container")#draw
      end#-------------------------------------------------=[end definition]
      x, y = 4, 26 if i == 11#--------------------=[picture placement?]
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#---=[box of arguements?]
      self.contents.blt(x, y, bitmap, src_rect)#---=[box of arguements?]
      x += 26 #------=[second row?]
    end#-----------=[picture placement?]
  end#----------------------------------=[end 1st box]
end#----------------------------------=[end 2nd box]
###############################################################[SCENE_MAP ALIAS]
class Scene_Map#-------------------------=[Map Screen Processing]
  alias af_hc_hud_main main#-------------=[alias af_hc_hud]
  def main#------------------------------=[define main process]
    @hud_window = Window_Hearts.new#-----------=[call hud window]
    af_hc_hud_main#--------------------------=[call with alias]
    @hud_window.dispose#---------------------=[dispose/erase?clear?]
  end#-----------------------------------------=[end definition]
  alias af_hc_hud_update update#-------------[aliased update]
  def update#--------------------------------=[define update]
    @hud_window.update#------------------------=[call update]
    af_hc_hud_update#--------------------------=[call with alias]
  end#-----------------------------------------=[end definition]
end#-------------------------------------------=[end

I couldn't figure out how to assign each container to amount 50pts instead of 1pt.

other than that I feel really good now about how each script "speaks" to the system ^,^

could you verify my comments that I am 'getting it' ?

I'm going to try out your script now and see it in action (excited!)
~g

Edit: woo-hoo! experimenting!

« Last Edit: September 18, 2009, 07:05:05 PM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
Glad it makes sense to you! You'll get a lot better with more experience.
I will add comments to the code you gave me to try to help you understand those parts.

Code: [Select]
class Window_Hearts < Window_Base#-----------------------------=[in game window]
  def initialize#-------------------------------------------------=[define load]
    super (-16, -16, 640, 160)#-----------=[x,y window position x,y window size]
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh#------------------------------=[call refresh command]
    self.opacity = 0#---------------------=[window skin opacity]
  end#------------------------------------=[end definition]
########################################################################[UPDATE]
  def update#-----------------------------=[define update]
    super#--------------------------------=[update the super window]
    refresh#------------------------------=[call refresh command]
  end#------------------------------------=[end definition]
#######################################################################[REFRESH] 
  def refresh#----------------------------=[define refresh]
    self.contents.clear#------------------=[clear bitmap]
    draw_star#----------------------------=[call to draw_heart]
    draw_heart#---------------------------=[call to draw_star]
  end#------------------------------------=[end definition]
####################################################################[DRAW STARS] 
  def draw_star#--------------------------=[define draw_star]
    x = 4 #-------------------------------=[draw x coordinates]
    y = 26 #------------------------------------=[draw y coordinates]
    # The following line of code shifts the row of stars down if the player has more than 10 hearts. This is so when the player only has
       9 hearts he stars are right underneath them and when the player has 11 or more hearts the stars y value is lower so they do not
       over lap the hearts.
    y = 52 if $game_party.actors[0].maxhp > 10 #----------------------=[?]
    for i in 1...$game_party.actors[0].maxsp + 1 #----------=[for loop stars]
      if i <= $game_party.actors[0].sp #-----------------------=[condition]
        # Draw a complete heart/star
        bitmap = RPG::Cache.picture("star")#draw  # store the image in the variable 'bitmap'
      else
        # Draw an empty heart/star
        bitmap = RPG::Cache.picture("star container")#draw # store the image in the variable 'bitmap'
      end#----------------------------------------------=[end definition]
      # if the player has 11 stars go back to the left side of the screen and go down one row. This is so you get two rows of stars (zelda style)
      x, y = 4, 78 if i == 11 #-------------------------------=[?]
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#---=[box of arguements?] # Set the image's rectangle
      self.contents.blt(x, y, bitmap, src_rect)#---=[box of arguements] # Draw the image
      x += 26 #---------------------------------------=[space icons evenly?] # shift x position so that the icon does not overlap.
    end#----------------------------------=[end 1st box] # end of for loop
  end#---------------------------------=[end 2nd box] # end of if statement
###################################################################[DRAW HEARTS]
  def draw_heart#-------------------------------------=[define draw_heart]
    x = 4 #-------------------------------=[draw x coordinates]
    y = 0 #------------------------------------=[draw y coordinates]
    for i in 1...$game_party.actors[0].maxhp + 1 #--=[for loop hearts]
      if i <= $game_party.actors[0].hp#----------=[condition]
        # Draw a complete heart/star
        bitmap = RPG::Cache.picture("heart")#draw # store the image in the variable 'bitmap'
      else
        # Draw an empty heart/star
        bitmap = RPG::Cache.picture("heart container")#draw # store the image in the variable 'bitmap'
      end#-------------------------------------------------=[end definition]
      x, y = 4, 26 if i == 11#--------------------=[picture placement?] # refer to above
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#---=[box of arguements?]  # refer to above
      self.contents.blt(x, y, bitmap, src_rect)#---=[box of arguements?]  # refer to above
      x += 26 #------=[second row?]] # refer to above
    end#-----------=[picture placement?] # end for loop
  end#----------------------------------=[end 1st box] # end if statement
end#----------------------------------=[end 2nd box] # end class Window_Hearts
###############################################################[SCENE_MAP ALIAS]
class Scene_Map#-------------------------=[Map Screen Processing]
  alias af_hc_hud_main main#-------------=[alias af_hc_hud]
  def main#------------------------------=[define main process]
    @hud_window = Window_Hearts.new#-----------=[call hud window]
    af_hc_hud_main#--------------------------=[call with alias]
    @hud_window.dispose#---------------------=[dispose/erase?clear?] Gets rid of the window.
  end#-----------------------------------------=[end definition]
  alias af_hc_hud_update update#-------------[aliased update]
  def update#--------------------------------=[define update]
    @hud_window.update#------------------------=[call update]
    af_hc_hud_update#--------------------------=[call with alias]
  end#-----------------------------------------=[end definition]
end#-------------------------------------------=[end

Other than that you seem to understand the script.

***
Rep:
Level 83
X-PLAT!
@albertfish - thank you for taking the time to help me out...
                  you are like my kung fu master and I'm training to kick some @$$! ^,^

I know I get all the window positioning all lot better, it's the 'for loop' lines of code that threw me off...

in your script I'm still trying to use the same methods I've used before in making:
-an on/off switch
-a variable to control the amount of containers

I just haven't been able to get that working......?

can the graphics shrink/slide for each container as it fills or empties?
or will that require a little more coding??
(if I understand correctly, this script was just to display one graphic or another)

and how difficult would it be to have an option for vertical alignment??

once I learn to iron these items out the final goal will be:

to have an animation for when you completely fill or completely empty a container
that the filled will zoom in or the emptied will zoom out...

so there is an end to all of my questions! X-P
but no end in me returning the favor. ~g

edit: oh and for those viewing this thread here is the latest screen shot!
« Last Edit: September 18, 2009, 10:07:17 PM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
in your script I'm still trying to use the same methods I've used before in making:
-an on/off switch
-a variable to control the amount of containers
Well... the players maxhp and maxsp are what is controlling the number of stars. It wouldn't be too hard to change that to a variable. As for the switch, again this would be very easy to do.

To create an on/off switch, I added 2 lines of code to the Scene_Map class.
Code: [Select]
class Scene_Map
  alias af_hc_hud_main main
  def main
    @hud_window = Window_Hearts.new
    @hud_window.visible = $game_switches[1] # <----- This line
    af_hc_hud_main
    @hud_window.dispose
  end
  alias af_hc_hud_update update
  def update
    @hud_window.update
    @hud_window.visible = $game_switches[1] # <----- This line
    af_hc_hud_update
  end
end

These lines set the visibility of the hud_window to the same boolean value as the switch 1. This means, when switch one is off(false) then the window visibility is also false.

As for using a variable to control the number of hearts, in the Window_Hearts class I change maxhp to $game_variables[num] where num is the number of the in-game variable that you want to use to set the number of hearts.

Quote
oh? and can the graphics shrink/slide for each container as it fills or empties?
or will that require a little more coding??
(if I understand correctly, this script was just to display one graphic or another)

I also created a script that does this, however it is a little more confusing. I will help you with this when you get all of your other functions working.

Quote
and how difficult would it be to have an option for vertical alignment??
This can be quite easy. In the initialize method of the Window_Hearts class create a variable similar to this:
Code: [Select]
def initialize
    super (-16, -16, 640, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    @valign = 0
    refresh
    self.opacity = 0
  end
And then in the draw_hearts and draw_stars function do the following:
Code: [Select]
def draw_heart
    x = 4
    y = @valign
    ...
end
Code: [Select]
def draw_star
    x = 4
    y = 26 + @valign
    ...
end
Just fool around with that and I think you'll get it working :).
« Last Edit: September 21, 2009, 04:04:30 AM by albertfish »

***
Rep:
Level 83
X-PLAT!
@albertfish - YES! oh I will! ^,^ it's study time!!! thanks to albertfish! man you're the best! ~g

edit:
Quote
I added 2 lines of code to the Scene_Map class.
I was trying to add this to the refresh and update sections...I get it...Scene_Map trumps
for it's the entire scene, not part of it. now the switch is marked off the list...check~

(currently working on the counter variable.)

another edit:
Quote
in the Window_Hearts class I change maxhp to $game_variables[num] where num is the number of the in-game variable that you want to use to set the number of hearts.
it loads fine, same number of hearts...?
Code: [Select]
#########################################################################[CLASS]
class Window_Hearts < Window_Base#-----------------------------=[in game window]
  def initialize#-------------------------------------------------=[define load]
    super (-16, 20, 630, 170)#170#-----------=[x,y window position x,y window size]
    self.contents = Bitmap.new(width - 32, height - 32)
    maxhp = $game_variables[101]#=================================={like this?]
    refresh#------------------------------=[call refresh command]
    self.opacity = 0#---------------------=[window skin opacity]
  end#------------------------------------=[end definition]
 

tinkering away...
« Last Edit: September 18, 2009, 11:44:02 PM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
Like this

Code: [Select]
  def draw_heart
    x = 4
    y = 0
    for i in 1...$game_variables[num] + 1#-------------=[show maxhp for hearts]
      if i <= $game_party.actors[0].hp#-------------------=[condition for graphics]
        # Draw a complete heart/star
        bitmap = RPG::Cache.picture("heart") #------=[store the full star image file in bitmap]
      else
        # Draw an empty heart/star
        bitmap = RPG::Cache.picture("heart container") #------=[store the empty star image file in bitmap]
      end
      x, y = 4, 26 if i == 11
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) #------=[create a new rectangle]
      self.contents.blt(x, y, bitmap, src_rect) #------=[draw the image]
      x += 26
    end
  end

***
Rep:
Level 83
X-PLAT!
@albertfish - oh in the 'draw heart definition! I was thinking "class" as in the first section...
I was just about to re-edit that post then bam! thanks for the quick response!

^^
8.8 -amazin!
 o
I was making it more complicated for myself but
this is what I came up with....before I read your latest post:
Spoiler for:
Code: [Select]
 def draw_star#--------------------------=[define draw_star]
    x = 17 #-------------------------------=[draw x coordinates]
    y = 12 #------------------------------------=[draw y coordinates]
    y = 52 if $game_variables[101] > 1#----------------------=[amount control]
for i in 1...$game_variables[102] + 1#-----------------------=[amount control]    
      if i <= $game_party.actors[0].sp #-----------------------=[condition]
        # Draw a complete heart/star
        bitmap = RPG::Cache.picture("star")#draw
      else
        # Draw an empty heart/star
        bitmap = RPG::Cache.picture("star container")#draw
      end#----------------------------------------------=[end definition]
      
      x, y = 4, 78 if i == 1001 #-------------------------------=[11?]
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#---=[box of arguements?]
      self.contents.blt(x, y, bitmap, src_rect)#---=[box of arguements]
      x += 26 #---------------------------------------=[space icons evenly?]
    end#----------------------------------=[end 1st box]
  end#---------------------------------=[end 2nd box]
  

I've changed it back towards your example...

before we go into vertical alignment, could you show me how to
make the hearts and stars fill and drain? and assign hp/sp?
like for example each heart/star is worth a 100 HP/SP~g

EDIT:here's the latest screen shot! (switch works! variable amount works! working on vertical and fill/drain)

isn't it COOL!? thanks again to modern algebra for support on the first script (top display)
and a super BIG thanks to albertfish for lots of support and ultimately making a test script for me to learn from. (bottom display)



talk about progress!
« Last Edit: September 19, 2009, 01:52:24 AM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
@albertfish - oh in the 'draw heart definition! I was thinking "class" as in the first section...
I was just about to re-edit that post then bam! thanks for the quick response!

^^
8.8 -amazin!
 o
I was making it more complicated for myself but
this is what I came up with....before I read your latest post:
Spoiler for:
Code: [Select]
 def draw_star#--------------------------=[define draw_star]
    x = 17 #-------------------------------=[draw x coordinates]
    y = 12 #------------------------------------=[draw y coordinates]
    y = 52 if $game_variables[101] > 1#----------------------=[amount control]
for i in 1...$game_variables[102] + 1#-----------------------=[amount control]    
      if i <= $game_party.actors[0].sp #-----------------------=[condition]
        # Draw a complete heart/star
        bitmap = RPG::Cache.picture("star")#draw
      else
        # Draw an empty heart/star
        bitmap = RPG::Cache.picture("star container")#draw
      end#----------------------------------------------=[end definition]
      
      x, y = 4, 78 if i == 1001 #-------------------------------=[11?]
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#---=[box of arguements?]
      self.contents.blt(x, y, bitmap, src_rect)#---=[box of arguements]
      x += 26 #---------------------------------------=[space icons evenly?]
    end#----------------------------------=[end 1st box]
  end#---------------------------------=[end 2nd box]
  

I've changed it back towards your example...

before I start with the vertical alignment could you show me how to
make the hearts and stars fill and drain? and assign hp/sp?
like for example each heart/star is worth a 100 HP/SP~g
Yea you did it correctly, but there you put ---[11?] you're right, it should be 11 :P.

I will redo the script so that 1 heart = 100hp so that I don't give you examples with errors lol. I'll help you create the code to do that though.

Okay, I worked out the logic... Here is to show you that it works (you can't access the source code yet. We will try to rebuild this before I let you read the code since it can get confusing :P)

Demo attached, guy on left take sp away, guy on right takes hp away.

BTW: It's looking pretty good so far! Keep at it.
« Last Edit: September 19, 2009, 02:05:06 AM by albertfish »

***
Rep:
Level 83
X-PLAT!
@albertfish - you are a force to be reckoned with.
                  I downloaded the demo and gave it a try...yes this is what I'm talking about!
                  could you please make the containers 'fill from bottom to top' and
                  drain from 'top to bottom' as if it were liquid?
 
                  Yes, It's looking really good thanks to you   " /A\|L|3|=|R-T-><)))'> "

    



edit: @albertfish - double/triple/quadruple post! base upon the views in this thread...
                         there's a lot of silent students, if you know what I mean...
    
                         ok now I'm reviewing your most excellent tutorial ~((G
« Last Edit: September 26, 2009, 06:15:28 AM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
@albertfish - you are a force to be reckoned with.
                  I downloaded the demo and gave it a try...yes this is what I'm talking about!
                  could you please make the containers 'fill from bottom to top' and
                  drain from 'top to bottom' as if it were liquid?
 
                  Yes, It's looking really good thanks to you   " /A\|L|3|=|R-T-><)))'> "

   
 

Yea that would be easy to do.

So, just to let you know the draining hearts, like in the demo, might get confusing while I explain it. The logic might be hard to understand at first (took me a few minutes and a few trials to solve it). So I will try to explain as best as I can.

I am currently writing an in depth tutorial that is design to try to show you how everything works step by step. This may take awhile but at the end I hope you will be able to write the script and get it working! I believe you will get this working pretty soon. So I will edit or post the tutorial after.

PS. Nice albertfish name thing :P.

**
Rep:
Level 83
Detective Scrotes
I know this is a double post, but I didn't want to tag this on to my last post since it is fairly long :P

So, to begin, the basic structure of the script remains the same. The only thing that we really need to do is to change how the code draws the images.

So, what do we want the script to do?
Well, we want this script to display partial hearts depending on how much hp the actor has. If each heart represents 100 hp, if the actor has 50 hp, only half of the heart will be displayed. So, we want to 'trim' or 'crop' the image proportional to the amount of hp the actor has. This is where the src_rect that we defined earlier comes into play.

As we alter the dimensions of the src_rect we will find we can cut off parts of the image and create the effect of a draining heart. Let's experiment with this.

Keeping the original code, let’s find the lines in the draw_hearts method that look like this:
Code: [Select]
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)

We are quite familiar with what this code does. This code draws the full image of the heart without clipping or cropping any of the image. The result is this:


But what if we changed some values of the src_rect? Let’s find out.
Let’s divide the width of the image by 2 and see what that gives us.
Code: [Select]
src_rect = Rect.new(0, 0, bitmap.width/2, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)

As you can see here, I did not change anything in the blt() function call. The only thing I changed was the dimensions of the src_rect. From here on I will omit the blt() function unless I make a change to it. The change that we made to the src_rect gives us this result:


Now what if we changed the height of the src_rect?
Code: [Select]
src_rect = Rect.new (0, 0, bitmap.width, bitmap.height/2)

This gives us:

So far so good right? We sort of got the result we want! But what happens if we change the x or y values?
Code: [Select]
src_rect = Rect.new(0, 12, bitmap.width, bitmap.height)


As you can see, this shifted the image upwards and as a result it trimmed off the top of the image. This shows two layers of hearts to show you what it actually looks like and that I didn’t just trim the image.
Now following that logic, it would make sense that if we changed the x value that it would shift the image horizontally trimming the side of the image right? Well let’s take a look.
Code: [Select]
src_rect = Rect.new(12, 0, bitmap.width, bitmap.height)

Turns out that our assumption is correct!

Well now that we have a grasp on what happens when we alter the dimensions of the src_rect we can continue. This is very important to understand before getting further into the logic of the script.

Part 2
Now we get into the hard stuff. The logic here may be difficult to understand why and how it works, but I will try my best to explain. Now I will give you the code bits at a time and explain what it does. It will be your job to piece them back together correctly, and get the script working.

But before we begin first this is first! We must go into the data base and give the actor a bunch of hp and sp. I set both hp and sp to over 1000 so that I can make sure the two image layers work.

Now we must modify the for loop and some code before it. Switching to the draw_star method briefly we had a line of code that originally said:
Code: [Select]
y = 52 if $game_party.actors[0].maxhp > 10

This positioned the stars down a line when there are two rows of hearts. We must make a quick edit to this since the actor now has hundreds of hp! There is a simple way to do this:

Code: [Select]
y = 52 if $game_party.actors[0].maxhp > 1000

This simple change is needed because each heart represents 100 hp, so 10 hearts * 100 hp = 1000.

Okay, back to the draw_heart method. We must modify the for loop as well so that loops the right amount of times. The logic in this loop may be confusing at first glance but the reasoning behind it is quite simple.
Code: [Select]
for i in 0...($game_party.actors[0].maxhp + 99) / 100

You might be asking yourself right now, “Why did he add 99 to the maxhp and divide by 100?” and the answer to this is really quite simple. Since the player may have 1000 hp, if we did not change this for loop, it would repeat 1000 times! We do not want that, we only want it to repeat about 10 times to show all the hearts. Knowing that, it makes a lot of sense why I would divide by 100, but why add 99?

The answer is because when you take the maxhp and divide it by 100, it stores that value as an integer. What this means is if you had 650 hp and you divide by 1000, the result will be 6, not 6.5. That is because when storing a floating point number (a number with a decimal point) into an integer, the decimal places are dropped off. The number is not rounded, so 6.99 would still become 6. But if our actor had 650 hp, we would want 6 full hearts to display and one half heart to display right? Well 650 / 100 gives us 6 so the for loop will only loop 6 times and display only the 6 full hearts. This is not our wanted result. This is why I added 99. If the actor has anywhere from 601 to 699 hp and we add 99, the resulting value will be between 700 and 798. Notice this never will go over 800, so when we divide by 100 we get 7! Good, now this will loop 7 times, that one problem out of the way. Also, if the actor only has 600 hp and we add 99, which gives us 699, then we divide by 100 we get 600 still. But if we added 100, then at 600, the loop will repeat 7 times. So that is where the 99 came from, any more or any less than that value would not work in all circumstances.

So what is the next problem? Well, we have the script drawing a full heart, and we have it drawing an empty heart, but we don’t have it drawing a partial heart. So we have to tell it to draw that! Also, we have to fix some of the numbers that have been changed since we now have a lot more hp.
Code: [Select]
if i < $game_party.actors[0].hp / 100

This should fix the if statement for the increase in hp. Now on adding in the code that will draw the partial heart.

First, before we jump right into writing the code, let’s think about what we need to do. Well, we need to calculate the proportion of the full heart to draw based on how much hp the actor has. We then need to trim the image correctly and have the empty heart get drawn in its play. However we do not want the empty heart and the full heart overlapping so we also need to trim the empty heart. We must trim the empty heart the exact opposite of the full heart so that they line up seamlessly.

So now that we know what we must accomplish where do we put the code? Well if we look at out if statement that determines what type of heart to draw we see that:
Code: [Select]
if i < $game_party.actors[0].hp / 100

This says, if the loop number is greater than the actors current hp (rounded down to the nearest hundredth since it is divided by 100, so 683 becomes 6 which only resembles 600hp) draw a full heart. If the loop number is greater than that draw an empty heart. The empty heart however should only be drawn if the full 100 hp is gone from that heart. So we can modify this if statement with an else if statement. An else if is very similar to an else statement where when the first condition is false it moves on and checks if the next condition is true. Else statements have no condition and will always execute if no other part of the if statement executes. But an else if statement have a new condition that must be true to execute. Let’s take a look that the syntax of this.
Code: [Select]
if false
  print “Hello”
elsif true
  print “Yay”
else
  print “elseeee”
end

If we were to execute this if statement, what do you think the output would be? The answer is Yay. This is because the first condition is false there for print “Hello” will not execute, the next condition is true so  print “Yay” will execute. Since that if executed, the else will not execute and therefore print “elseeee” will not execute.

So let’s use this to create an if statement where we can place the code to draw the partial heart.
Code: [Select]
elsif i < ($game_party.actors[0].hp + 99) / 100

Again we see that I added 99. This is simply because, if hp = 650, then hp/100 = 6. So in the original if statement, this will be true and draw a full heart, and if that is true then the elsif will never execute. So if hp=650 6 full heart will be draw and we know that hp must be at least 600. If the hp > 600 then we must draw a partial heart. That is what this else if says, since 650 + 99 = 749 / 100 = 700.

This is quite a bit to read, and learn from all at once. So let’s just try to make sure we understand everything before advancing. To check our understanding of this let’s try something.

Using the provide else if statement try to code it so it draws the correct number of full hearts, and for the partial heart, just use a different graphic for now so you know that the code is executing properly. Once the code executes correctly we will move on, and code the algorithm that will trim the images correctly.
« Last Edit: September 19, 2009, 05:38:05 AM by albertfish »

***
Rep:
Level 83
X-PLAT!
@albertfish - here's the extra graphic I used

and here's the latest edit to "THE" script
Spoiler for:
Code: [Select]
################################################################################
#                          Hearts and Stars! V 0.3
#                    (advance containers for HP and SP)
#                           by albertfish 9.17.09
#                          modified by gameface101
#                                 RMRK.NET
#

#########################################################################[CLASS]
class Window_Hearts < Window_Base#-----------------------------=[in game window]
  def initialize#-------------------------------------------------=[define load]
    super (-16, -16, 640, 160)#-----------=[x,y window position x,y window size]
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh#---------------------------------------------=[call refresh command]
    self.opacity = 0#-------------------------------------=[window skin opacity]
  end#---------------------------------------------------------=[end definition]
  
########################################################################[UPDATE]
  def update#---------------------------------------------------=[define update]
    super#--------------------------------------------=[update the super window]
    refresh#---------------------------------------------=[call refresh command]
  end#---------------------------------------------------------=[end definition]
  
#######################################################################[REFRESH]  
  def refresh#-------------------------------------------------=[define refresh]
    self.contents.clear#-----------------------------------------=[clear bitmap]
    draw_star#---------------------------------------------=[call to draw_heart]
    draw_heart#---------------------------------------------=[call to draw_star]
  end#---------------------------------------------------------=[end definition]
  
####################################################################[DRAW STARS]  
  def draw_star#---------------------------------------------=[define draw_star]
    x = 4 #------------------------------------------------=[draw x coordinates]
    y = 26 #-----------------------------------------------=[draw y coordinates]
# The following line of code shifts the row of stars down if the player has more
# than 10 hearts. This is so when the player only has 9 hearts the stars are
# right underneath them and when the player has 11 or more hearts the stars
# y value is lower so they do not over lap the hearts.
    y = 52 if $game_party.actors[0].maxhp > 1000#--------------------=[new edit]
    for i in 1...$game_party.actors[0].maxsp + 1 #-------------=[for loop stars]
      if i <= $game_party.actors[0].sp #----------------------------=[condition]
        # Draw a complete heart/star
        bitmap = RPG::Cache.picture("star")#draw  # store the image in the variable 'bitmap'
      else
        # Draw an empty heart/star
        bitmap = RPG::Cache.picture("star container")#draw # store the image in the variable 'bitmap'
      end#----------------------------------------------=[end definition]
      # if the player has 11 stars go back to the left side of the screen and go down one row. This is so you get two rows of stars (zelda style)
      x, y = 4, 78 if i == 11 #-------------------------------=[?]
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#---=[box of arguements?] # Set the image's rectangle
      self.contents.blt(x, y, bitmap, src_rect)#---=[box of arguements] # Draw the image
      x += 26 #---------------------------------------=[space icons evenly?] # shift x position so that the icon does not overlap.
    end#----------------------------------=[end 1st box] # end of for loop
  end#---------------------------------=[end 2nd box] # end of if statement
  
###################################################################[DRAW HEARTS]
  def draw_heart#-------------------------------------=[define draw_heart]
    x = 4 #-------------------------------=[draw x coordinates]
    y = 0 #------------------------------------=[draw y coordinates]
    for i in 0...($game_party.actors[0].maxhp + 99) / 100#-----------=[new edit]
      if i < $game_party.actors[0].hp / 100#-------------------------=[new edit]
        # Draw a complete heart
        bitmap = RPG::Cache.picture("heart")# store the image in the variable 'bitmap'
      elsif i < ($game_party.actors[0].hp + 99) / 100
        # Draw a partial heart
        bitmap = RPG::Cache.picture("cursor")# store the image in the variable 'bitmap'
      else
        # Draw an empty heart
        bitmap = RPG::Cache.picture("heart container")#store the image in the variable 'bitmap'
      end#-----------------------------------------------------=[end definition]
      x, y = 4, 26 if i == 11#---------------------------------=[refer to above]
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#--=[refer to above]
      self.contents.blt(x, y, bitmap, src_rect)#---------------=[refer to above]
      x += 26 #------------------------------------------------=[refer to above]
    end#---------------------------------------------------------=[end for loop]
  end#-------------------------------------------------------=[end if statement]
end#--------------------------------------------------=[end class Window_Hearts]

###############################################################[SCENE_MAP ALIAS]
class Scene_Map#----------------------------------------=[Map Screen Processing]
  alias af_hc_hud_main main#----------------------------------=[alias af_hc_hud]
  def main#-----------------------------------------------=[define main process]
    @hud_window = Window_Hearts.new#--------------------------=[call hud window]
    af_hc_hud_main#-------------------------------------------=[call with alias]
    @hud_window.dispose#-------------------------------=[gets rid of the window]
  end#---------------------------------------------------------=[end definition]
  alias af_hc_hud_update update#--------------------------------[aliased update]
  def update#---------------------------------------------------=[define update]
    @hud_window.update#-------------------------------------------=[call update]
    af_hc_hud_update#-----------------------------------------=[call with alias]
  end#---------------------------------------------------------=[end definition]
end#---------------------------------------------------------------=[end it all]

and here's my results


you've outlined it so well... and I'm really catching on!
ready to code some algorithms, I think my brain is starting to smoke ^,^ ~g

edit: here's the latest edit to "THE" script:
Spoiler for:
Code: [Select]
################################################################################
#                          Hearts and Stars! V 0.3
#                    (advance containers for HP and SP)
#                           by albertfish 9.17.09
#                          modified by gameface101
#                                 RMRK.NET
#

#########################################################################[CLASS]
class Window_Hearts < Window_Base#-----------------------------=[in game window]
  def initialize#-------------------------------------------------=[define load]
    super (-16, 0, 640, 160)#-----------=[x,y window position x,y window size]
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh#---------------------------------------------=[call refresh command]
    self.opacity = 0#-------------------------------------=[window skin opacity]
  end#---------------------------------------------------------=[end definition]
 
########################################################################[UPDATE]
  def update#---------------------------------------------------=[define update]
    super#--------------------------------------------=[update the super window]
    refresh#---------------------------------------------=[call refresh command]
  end#---------------------------------------------------------=[end definition]
 
#######################################################################[REFRESH] 
  def refresh#-------------------------------------------------=[define refresh]
    self.contents.clear#-----------------------------------------=[clear bitmap]
    draw_star#---------------------------------------------=[call to draw_heart]
    draw_heart#---------------------------------------------=[call to draw_star]
  end#---------------------------------------------------------=[end definition]
 
####################################################################[DRAW STARS] 
  def draw_star#---------------------------------------------=[define draw_star]
    x = 4 #------------------------------------------------=[draw x coordinates]
    y = 26 #-----------------------------------------------=[draw y coordinates]
# The following line of code shifts the row of stars down if the player has more
# than 10 hearts. This is so when the player only has 9 hearts the stars are
# right underneath them and when the player has 11 or more hearts the stars
# y value is lower so they do not over lap the hearts.
    y = 52 if $game_party.actors[0].maxhp > 1000#-------------------=[new edit]
    for i in 0...($game_party.actors[0].maxsp + 99) / 100# + 1#------=[new edit]
      if i < $game_party.actors[0].sp / 100#-------------------------=[new edit]
        # Draw a complete star
        bitmap = RPG::Cache.picture("star")#draw  # store the image in the variable 'bitmap'
        elsif i < ($game_party.actors[0].sp + 99) / 100#-------------=[new edit]
        # Draw a partial star
        bitmap = RPG::Cache.picture("cursor")#store the image in the variable 'bitmap'
      else
        # Draw an empty star
        bitmap = RPG::Cache.picture("star container")#draw # store the image in the variable 'bitmap'
      end#----------------------------------------------=[end definition]
      # if the player has 11 stars go back to the left side of the screen and go down one row. This is so you get two rows of stars (zelda style)
      x, y = 4, 78 if i == 11 #-------------------------------=[?]
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#---=[box of arguements?] # Set the image's rectangle
      self.contents.blt(x, y, bitmap, src_rect)#---=[box of arguements] # Draw the image
      x += 26 #---------------------------------------=[space icons evenly?] # shift x position so that the icon does not overlap.
    end#----------------------------------=[end 1st box] # end of for loop
  end#---------------------------------=[end 2nd box] # end of if statement
 
###################################################################[DRAW HEARTS]
  def draw_heart#-------------------------------------------=[define draw_heart]
    x = 4 #------------------------------------------------=[draw x coordinates]
    y = 0 #------------------------------------------------=[draw y coordinates]
    for i in 0...($game_party.actors[0].maxhp + 99) / 100#-----------=[new edit]
      if i < $game_party.actors[0].hp / 100#-------------------------=[new edit]
        # Draw a complete heart
        bitmap = RPG::Cache.picture("heart")#store the image in the variable 'bitmap'
      elsif i < ($game_party.actors[0].hp + 99) / 100
        # Draw a partial heart
        bitmap = RPG::Cache.picture("cursor")#store the image in the variable 'bitmap'
      else
        # Draw an empty heart
        bitmap = RPG::Cache.picture("heart container")#store the image in the variable 'bitmap'
      end#-----------------------------------------------------=[end definition]
      x, y = 4, 26 if i == 11#---------------------------------=[refer to above]
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#--=[refer to above]
      self.contents.blt(x, y, bitmap, src_rect)#---------------=[refer to above]
      x += 26 #------------------------------------------------=[refer to above]
    end#---------------------------------------------------------=[end for loop]
  end#-------------------------------------------------------=[end if statement]
end#--------------------------------------------------=[end class Window_Hearts]

###############################################################[SCENE_MAP ALIAS]
class Scene_Map#----------------------------------------=[Map Screen Processing]
  alias af_hc_hud_main main#----------------------------------=[alias af_hc_hud]
  def main#-----------------------------------------------=[define main process]
    @hud_window = Window_Hearts.new#--------------------------=[call hud window]
    af_hc_hud_main#-------------------------------------------=[call with alias]
    @hud_window.dispose#-------------------------------=[gets rid of the window]
  end#---------------------------------------------------------=[end definition]
  alias af_hc_hud_update update#--------------------------------[aliased update]
  def update#---------------------------------------------------=[define update]
    @hud_window.update#-------------------------------------------=[call update]
    af_hc_hud_update#-----------------------------------------=[call with alias]
  end#---------------------------------------------------------=[end definition]
end#---------------------------------------------------------------=[end it all]

*I have commented the new edits with #-------=[new edit]

as you can see I have both sp and hp ready for their algorithms... ~.^

I should have warned you...I learn just as fast as I can forget X-P  ~g
« Last Edit: September 19, 2009, 08:02:13 AM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
Awesome so far. I'm glad you are understanding my explanations.

Part Three
Okay, so now we have the if statement all set up, now we just have to write up the code that will correctly draw the images. We are going to do this using two images, the full heart and the empty heart. So first thing we do is store the full heart image in a variable. I used bitmap previously, so I will use it again. Now comes the confusing part.

What do I need to do so that I get the correct proportions for the hearts? Well, if I have 678 hp, I’ll have 6 full hearts and one partial heart. But how much of the heart should there be? Well, there should be 78% of a heart. This is because at 700hp there will be 7 full hearts. Since we are using 100 hp per heart it is very easy to see that 678 lies 78% of the way between 600 and 700 and therefore that is how much of the heart should be full.

So how can we extract that value 78? Well, 100 – (700 – 678) = 78 right? Seems easy, but hp changes. Your actor could have 1325 hp. Then the equation becomes 100 – (1400 – 1325) = 25. So we need to create some code that will round up the current hp to the next hundred. How do we do this? Well, we have actually seen this before haven’t we?
Code: [Select]
hp = ($game_party.actors[0].hp+99)/100*100

Here I took the actors current hp and rounded it up to the next hundred. However this is slightly different than before. This time I added *100 to the end. This is because if we go back to the example of having 678 hp + 99 = 777 / 100 = 7 right? Well we wanted to round up to the next hundred so 7*100 = 700. Simple isn’t it?

So now what we have is the actor’s current hp, 678 for example, and a way of calculating the next hundred and we stored that in the variable ‘hp’. Now that equation we looked at earlier can be coded and will work for and actor hp value.

This is the equation we want to use: 100 – (next hundred – actor’s hp)

For simplicity sake I used a new variable for the next line, although you can easily use hp. Let’s just make a new variable called ‘amount’. This variable will hold the value of the equation. So let’s set that up now.
Code: [Select]
amount = 100 - (hp - $game_party.actors[0].hp)

This should seem straight forward. So what we have right now is the percentage of the image that needs to be displayed stored in amount. But this is just a number, 78% is the integer 78. So we have to do some calculations to modify this number and scale it down so that it is proportional to the size of the image. So how do we do that? Well, from math you most likely know that if you want to find how much 78% is of 90 you put 78% into decimal form, 0.78 and multiply by 90. 0.78 * 90 = 70.2. The same logic applies here. Except there is a slight problem! If we divide 78 by 100 and store it as an integer, the value will become 0. So a very easy way around this would be to multiply by 90 first and then divide by 100. 78 * 90 = 7020 / 100 = 70.2. We arrive at the same answer (obviously).

So let’s put this into terms of the image. We want the value stored in ‘amount’, for example 78, to be multiplied by the images height then divide by 100. So the first thing that may come to mind is the following code:
Code: [Select]
amount = amount * bitmap.height / 100

There are many ways of writing this same code. If you choose to use *= instead of = you would have to split this code into 2 lines.
Code: [Select]
amount *= bitmap.height
 amount /= 100

This does the same thing as the previous line. Now what do we have? Well using the previous example, 78 * image height(24) = 1872 / 100 = 18. Therefore, 18 / 24 = 78 / 100. So we only want to draw the bottom 18 pixels of the full heart. Now we saw when fooling around with the src_rect that we can clip off parts of an image. Well that is where this all comes into play. This next line of code you will understand better later, but this is needed. Without this next line, the heart will empty from the bottom up(along with a couple other changes)!
Code: [Select]
amount = 24 – amount

Now let’s define the src_rect.
Code: [Select]
src_rect = Rect.new(0, amount, bitmap.width, bitmap.height- amount)

This may look confusing, so I’ll try to explain. I’ll start with the height. As you can see, I am taking the total height of the bitmap(24) and subtracting the value of amount (24 – 18 = 6). 24 – 6 = 18. It seems like we go around in a big circle doesn’t it? It was 18, 24 – 18 = 6, so then it was 6, and now 24 – 6 = 18 it’s back to 18. Why? Well as you can see the y value is set to amount, in this case 6. This is so that the image keeps it’s correct alignment. This is also why the previous piece of code was needed.

Now we have to draw the image.
Code: [Select]
self.contents.blt(x, y + amount, bitmap, src_rect)

The y value is y + amount because as we saw earlier, when we change the y value of the src_rect the entire image shifts. So we have to counter balance that shift so the image is displayed in the correct location.

And similarly, we have to set the empty hear to the bitmap variable then set up its bitmap:
Code: [Select]
src_rect = Rect.new(0, 0, bitmap.width, amount)

Almost there! Now in the original code we had this code:
Code: [Select]
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
 self.contents.blt(x, y, bitmap, src_rect)

Well, we have to move the src_rect now. This can be deleted and put at the bottom of the first if and the else. This is because in the else if we set up the src_rect at the end, and if we didn’t delete the src_rect setup right before we drew the image then the src_rect will be incorrect. I hope you understand that very long sentence :|. This is it, I gave you all the harder bits of code, now you have to figure out how to use them and where they go! Then do the same for the stars! Good luck, and I will answer further questions you may have.

There is also some little changes I have made that you may need to change later, but for now let’s just try to get the draining part working!

*I have commented the new edits with #-------=[new edit]

as you can see I have both sp and hp ready for their algorithms... ~.^

I should have warned you...I learn just as fast as I can forget X-P  ~g
You are one step ahead of me with doing the stars one :P. And lol about the forgetting thing.

***
Rep:
Level 83
X-PLAT!
@albertfish - this is just simply amazing, been working hard on the case,
                  now about to crack it wide open!!!
                  
here's the latest edit to "THE" script:
Spoiler for:
Code: [Select]
################################################################################
#                          Hearts and Stars! V 0.4
#                    (advance containers for HP and SP)
#                           by albertfish 9.17.09
#                          modified by gameface101
#                                 RMRK.NET
#

#########################################################################[CLASS]
class Window_Hearts < Window_Base#-----------------------------=[in game window]
  def initialize#-------------------------------------------------=[define load]
    super (-16, 0, 640, 160)#-----------=[x,y window position x,y window size]
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh#---------------------------------------------=[call refresh command]
    self.opacity = 0#-------------------------------------=[window skin opacity]
  end#---------------------------------------------------------=[end definition]
  
########################################################################[UPDATE]
  def update#---------------------------------------------------=[define update]
    super#--------------------------------------------=[update the super window]
    refresh#---------------------------------------------=[call refresh command]
  end#---------------------------------------------------------=[end definition]
  
#######################################################################[REFRESH]  
  def refresh#-------------------------------------------------=[define refresh]
    self.contents.clear#-----------------------------------------=[clear bitmap]
    draw_star#---------------------------------------------=[call to draw_heart]
    draw_heart#---------------------------------------------=[call to draw_star]
  end#---------------------------------------------------------=[end definition]
  
####################################################################[DRAW STARS]  
  def draw_star#---------------------------------------------=[define draw_star]
    x = 4 #------------------------------------------------=[draw x coordinates]
    y = 26 #-----------------------------------------------=[draw y coordinates]
# The following line of code shifts the row of stars down if the player has more
# than 10 hearts. This is so when the player only has 9 hearts the stars are
# right underneath them and when the player has 11 or more hearts the stars
# y value is lower so they do not over lap the hearts.
    y = 52 if $game_party.actors[0].maxhp > 1000#--------------------=[new edit]
    for i in 0...($game_party.actors[0].maxsp + 99) / 100# + 1#------=[new edit]
      if i < $game_party.actors[0].sp / 100#-------------------------=[new edit]
        # Draw a complete star
        bitmap = RPG::Cache.picture("star")#draw  # store the image in the variable 'bitmap'
       src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#-----=[edit v 0.4]
       self.contents.blt(x, y, bitmap, src_rect)#------------------=[edit v 0.4]
        elsif i < ($game_party.actors[0].sp + 99) / 100#-------------=[new edit]
        # Draw a partial star
    sp = ($game_party.actors[0].sp+99)/100*100#--------------=[edit v 0.4]
    amount = 100 - (sp - $game_party.actors[0].sp)#----=[edit v 0.4]
    amount = amount * bitmap.height / 100#----=[edit v 0.4]
#   amount = 24 – amount#----------------------------------------------=[syntax]
    src_rect = Rect.new(0, amount, bitmap.width, bitmap.height- amount)#----=[edit v 0.4]
    self.contents.blt(x, y + amount, bitmap, src_rect)#---=[edit v 0.4]
    src_rect = Rect.new(0, 0, bitmap.width, amount)#---=[edit v 0.4]
        #bitmap = RPG::Cache.picture("cursor")#store the image in the variable 'bitmap'
      else
        # Draw an empty star
        bitmap = RPG::Cache.picture("star container")#draw # store the image in the variable 'bitmap'
       src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#-----=[edit v 0.4]
       self.contents.blt(x, y, bitmap, src_rect)#------------------=[edit v 0.4]
      end#-----------------------------------------------------=[end definition]
      # if the player has 11 stars go back to the left side of the screen and go down one row. This is so you get two rows of stars (zelda style)
      x, y = 4, 78 if i == 11 #-------------------------------=[?]
#      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#---=[box of arguements?] # Set the image's rectangle
#      self.contents.blt(x, y, bitmap, src_rect)#---=[box of arguements] # Draw the image
      x += 26 #---------------------------------------=[space icons evenly?] # shift x position so that the icon does not overlap.
    end#----------------------------------=[end 1st box] # end of for loop
  end#---------------------------------=[end 2nd box] # end of if statement
  
###################################################################[DRAW HEARTS]
  def draw_heart#-------------------------------------------=[define draw_heart]
    x = 4 #------------------------------------------------=[draw x coordinates]
    y = 0 #------------------------------------------------=[draw y coordinates]
    for i in 0...($game_party.actors[0].maxhp + 99) / 100#-----------=[new edit]
      if i < $game_party.actors[0].hp / 100#-------------------------=[new edit]
        # Draw a complete heart
        bitmap = RPG::Cache.picture("heart")#store the image in the variable 'bitmap'
 src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#-----------=[edit v 0.4]
 self.contents.blt(x, y, bitmap, src_rect)#------------------------=[edit v 0.4]
      elsif i < ($game_party.actors[0].hp + 99) / 100
    # Draw a partial heart
    hp = ($game_party.actors[0].hp+99)/100*100#--------------=[edit v 0.4]
    amount = 100 - (hp - $game_party.actors[0].hp)#----=[edit v 0.4]
    amount *= bitmap.height#----=[edit v 0.4]
    amount /= 100#----=[edit v 0.4]
    #amount = amount * bitmap.height / 100#----=[edit v 0.4]
#   amount = 24 – amount#----------------------------------------------=[syntax]
    src_rect = Rect.new(0, amount, bitmap.width, bitmap.height- amount)#----=[edit v 0.4]
    self.contents.blt(x, y + amount, bitmap, src_rect)#---=[edit v 0.4]
    src_rect = Rect.new(0, 0, bitmap.width, amount)#---=[edit v 0.4]
#   bitmap = RPG::Cache.picture("cursor")#store the image in the variable 'bitmap'
      else
        # Draw an empty heart
        bitmap = RPG::Cache.picture("heart container")#store the image in the variable 'bitmap'
 src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#-----------=[edit v 0.4]
 self.contents.blt(x, y, bitmap, src_rect)#------------------------=[edit v 0.4]
      end#-----------------------------------------------------=[end definition]
      x, y = 4, 26 if i == 11#---------------------------------=[refer to above]
#      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#-----=[edit v 0.4]
#      self.contents.blt(x, y, bitmap, src_rect)#------------------=[edit v 0.4]
      x += 26 #------------------------------------------------=[refer to above]
    end#---------------------------------------------------------=[end for loop]
  end#-------------------------------------------------------=[end if statement]
end#--------------------------------------------------=[end class Window_Hearts]

###############################################################[SCENE_MAP ALIAS]
class Scene_Map#----------------------------------------=[Map Screen Processing]
  alias af_hc_hud_main main#----------------------------------=[alias af_hc_hud]
  def main#-----------------------------------------------=[define main process]
    @hud_window = Window_Hearts.new#--------------------------=[call hud window]
    af_hc_hud_main#-------------------------------------------=[call with alias]
    @hud_window.dispose#-------------------------------=[gets rid of the window]
  end#---------------------------------------------------------=[end definition]
  alias af_hc_hud_update update#--------------------------------[aliased update]
  def update#---------------------------------------------------=[define update]
    @hud_window.update#-------------------------------------------=[call update]
    af_hc_hud_update#-----------------------------------------=[call with alias]
  end#---------------------------------------------------------=[end definition]
end#---------------------------------------------------------------=[end it all]

here's where I got stuck: had to comment this line due to a syntax error
Code: [Select]
amount = 24 – amount
it works! but containers drain backwards as you had mentioned.


Quote
This next line of code you will understand better later, but this is needed. Without this next line, the heart will empty from the bottom up(along with a couple other changes)!
Code:

amount = 24 – amount

syntax error - am I missing an extra end? or the line itself? ~g

EDIT: here's the latest screenshot!

« Last Edit: September 19, 2009, 12:08:31 PM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
thar error does be because MS Word turned thar - into a symbol, which appears as a long -. Simple fix thought, highlight thar - an' press - again, yarr should see it turn from black text to a light blue.

Haha, talk like a pirate day. yonder does be just kind of weird.
« Last Edit: September 19, 2009, 04:38:40 PM by albertfish »

***
Rep:
Level 83
X-PLAT!
@albertfish - aye captain, that lily-livered hyphen got the Keelhaul and went straight ta Davey Jone's locker...
                  ya must thinks me is a squiffy for not catchin' that blasted part of code... aye, still a sprog but
                  ready to cast off and set sail to the next "X" on the map.
                  (show empty graphic when fill/drain, vertical alignment, container animations)

                 ~g

EDIT: here's the latest edit to "THE" script!:
Spoiler for:
Code: [Select]
################################################################################
#                          Hearts and Stars! V 0.5
#                    (advance containers for HP and SP)
#                           by albertfish 9.19.09
#                          modified by gameface101
#                                 RMRK.NET
#
#

#########################################################################[CLASS]
class Window_Hearts < Window_Base#-----------------------------=[in game window]
  def initialize#-------------------------------------------------=[define load]
    super (-16, 20, 640, 160)#------------=[x,y window position x,y window size]
    self.contents = Bitmap.new(width - 32, height - 32)#--------------------=[?]
    refresh#---------------------------------------------=[call refresh command]
    self.opacity = 0#-------------------------------------=[window skin opacity]
  end#---------------------------------------------------------=[end definition]
  
########################################################################[UPDATE]
  def update#---------------------------------------------------=[define update]
    super#--------------------------------------------=[update the super window]
    refresh#---------------------------------------------=[call refresh command]
  end#---------------------------------------------------------=[end definition]
  
#######################################################################[REFRESH]  
  def refresh#-------------------------------------------------=[define refresh]
    self.contents.clear#-----------------------------------------=[clear bitmap]
    draw_star#---------------------------------------------=[call to draw_heart]
    draw_heart#---------------------------------------------=[call to draw_star]
  end#---------------------------------------------------------=[end definition]
  
####################################################################[DRAW STARS]  
  def draw_star#---------------------------------------------=[define draw_star]
    x = 17 #-----------------------------------------------=[draw x coordinates]
    y = 12 #-----------------------------------------------=[draw y coordinates]
# The following line of code shifts the row of stars down if the player has more
# than 10 hearts. This is so when the player only has 9 hearts the stars are
# right underneath them and when the player has 11 or more hearts the stars
# y value is lower so they do not over lap the hearts.
    y = 52 if $game_party.actors[0].maxhp > 7000#--=[drop star bar to make room]
    for i in 0...($game_party.actors[0].maxsp + 99) / 100# + 1#------=[new edit]
      if i < $game_party.actors[0].sp / 100#-------------------------=[new edit]
        
#--------------------------------------------------------=[Draw a complete star]
       bitmap = RPG::Cache.picture("star")#-----=[variable 'bitmap' store image]
       src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#-----=[edit v 0.4]
       self.contents.blt(x, y, bitmap, src_rect)#------------------=[edit v 0.4]

#-------------------------------------------------------=[ Draw a partial star ]
       elsif i < ($game_party.actors[0].sp + 99) / 100#--------------=[new edit]
        
#------------------------------------------------------------------=[edit v 0.5]    
    bitmap = RPG::Cache.picture("star container")#-----=[variable 'bitmap' store image]
       src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#-----=[edit v 0.4]
       self.contents.blt(x, y, bitmap, src_rect)#------------------=[edit v 0.4]
    self.z = 1000      
    sp = ($game_party.actors[0].sp+99)/100*100#--------------=[edit v 0.4]
    amount = 100 - (sp - $game_party.actors[0].sp)#----=[edit v 0.4]
    amount = amount * bitmap.height / 100#----=[edit v 0.4]
    amount = 24 - amount
    src_rect = Rect.new(0, amount, bitmap.width, bitmap.height- amount)#=[edit v 0.4]
    self.contents.blt(x, y + amount, bitmap, src_rect)#---=[edit v 0.4]
    src_rect = Rect.new(0, 0, bitmap.width, amount)#---=[edit v 0.4]
#------------------------------------------------------------------=[edit v 0.5]

    sp = ($game_party.actors[0].sp+99)/100*100#--------------=[edit v 0.4]
    amount = 100 - (sp - $game_party.actors[0].sp)#----=[edit v 0.4]
    amount = amount * bitmap.height / 100#----=[edit v 0.4]
    amount = 24 - amount
    bitmap = RPG::Cache.picture("star")#--------=[variable 'bitmap' store image]
    src_rect = Rect.new(0, amount, bitmap.width, bitmap.height- amount)#----=[edit v 0.4]
    self.contents.blt(x, y + amount, bitmap, src_rect)#---=[edit v 0.4]
    src_rect = Rect.new(0, 0, bitmap.width, amount)#---=[edit v 0.4]

#-------------------------------------------------------------=[Draw empty star]      
        else
        # Draw an empty star
        bitmap = RPG::Cache.picture("star container")#-----=[variable 'bitmap' store image]
       src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#-----=[edit v 0.4]
       self.contents.blt(x, y, bitmap, src_rect)#------------------=[edit v 0.4]
      end#-----------------------------------------------------=[end definition]
      # if the player has 11 stars go back to the left side of the screen and go down one row. This is so you get two rows of stars (zelda style)
      x, y = 4, 78 if i == 11 #-------------------------------=[?]
#      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#---=[box of arguements?] # Set the image's rectangle
#      self.contents.blt(x, y, bitmap, src_rect)#---=[box of arguements] # Draw the image
      x += 26 #---------------------------------------=[space icons evenly?] # shift x position so that the icon does not overlap.
    end#----------------------------------=[end 1st box] # end of for loop
  end#---------------------------------=[end 2nd box] # end of if statement
  
###################################################################[DRAW HEARTS]
  def draw_heart#-------------------------------------------=[define draw_heart]
    x = 4 #------------------------------------------------=[draw x coordinates]
    y = 0 #------------------------------------------------=[draw y coordinates]
    for i in 0...($game_party.actors[0].maxhp + 99) / 100#-----------=[new edit]
      if i < $game_party.actors[0].hp / 100#-------------------------=[new edit]
        # Draw a complete heart
        bitmap = RPG::Cache.picture("heart")#store the image in the variable 'bitmap'
 src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#-----------=[edit v 0.4]
 self.contents.blt(x, y, bitmap, src_rect)#------------------------=[edit v 0.4]
 
#------------------------------------------------------=[ Draw a partial heart ]
    elsif i < ($game_party.actors[0].hp + 99) / 100
#------------------------------------------------------------------=[edit v 0.5]    
    bitmap = RPG::Cache.picture("heart container")#-----=[variable 'bitmap' store image]
       src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#-----=[edit v 0.4]
       self.contents.blt(x, y, bitmap, src_rect)#------------------=[edit v 0.4]
    self.z = 1000      
    hp = ($game_party.actors[0].hp+99)/100*100#--------------=[edit v 0.4]
    amount = 100 - (hp - $game_party.actors[0].hp)#----=[edit v 0.4]
    amount = amount * bitmap.height / 100#----=[edit v 0.4]
    amount = 24 - amount
    bitmap = RPG::Cache.picture("heart")#--------=[variable 'bitmap' store image]    
    src_rect = Rect.new(0, amount, bitmap.width, bitmap.height- amount)#----=[edit v 0.4]
    self.contents.blt(x, y + amount, bitmap, src_rect)#---=[edit v 0.4]
    src_rect = Rect.new(0, 0, bitmap.width, amount)#---=[edit v 0.4]
    
#------------------------------------------------------------------=[edit v 0.5]

    hp = ($game_party.actors[0].hp+99)/100*100#--------------=[edit v 0.4]
    amount = 100 - (hp - $game_party.actors[0].hp)#----=[edit v 0.4]
    amount *= bitmap.height#----=[edit v 0.4]
    amount /= 100#----=[edit v 0.4]
    #amount = amount * bitmap.height / 100#----=[edit v 0.4]
    amount = 24 - amount#----------------------------------------------=[syntax]
    src_rect = Rect.new(0, amount, bitmap.width, bitmap.height- amount)#----=[edit v 0.4]
    self.contents.blt(x, y + amount, bitmap, src_rect)#---=[edit v 0.4]
    src_rect = Rect.new(0, 0, bitmap.width, amount)#---=[edit v 0.4]
#   bitmap = RPG::Cache.picture("cursor")#store the image in the variable 'bitmap'
      else
        # Draw an empty heart
        bitmap = RPG::Cache.picture("heart container")#store the image in the variable 'bitmap'
 src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#-----------=[edit v 0.4]
 self.contents.blt(x, y, bitmap, src_rect)#------------------------=[edit v 0.4]
      end#-----------------------------------------------------=[end definition]
      x, y = 4, 26 if i == 11#---------------------------------=[refer to above]
#      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)#-----=[edit v 0.4]
#      self.contents.blt(x, y, bitmap, src_rect)#------------------=[edit v 0.4]
      x += 26 #------------------------------------------------=[refer to above]
    end#---------------------------------------------------------=[end for loop]
  end#-------------------------------------------------------=[end if statement]
end#--------------------------------------------------=[end class Window_Hearts]

###############################################################[SCENE_MAP ALIAS]
class Scene_Map#----------------------------------------=[Map Screen Processing]
  alias af_hc_hud_main main#----------------------------------=[alias af_hc_hud]
  def main#-----------------------------------------------=[define main process]
    @hud_window = Window_Hearts.new#--------------------------=[call hud window]
    af_hc_hud_main#-------------------------------------------=[call with alias]
    @hud_window.dispose#-------------------------------=[gets rid of the window]
  end#---------------------------------------------------------=[end definition]
  alias af_hc_hud_update update#--------------------------------[aliased update]
  def update#---------------------------------------------------=[define update]
    @hud_window.update#-------------------------------------------=[call update]
    af_hc_hud_update#-----------------------------------------=[call with alias]
  end#---------------------------------------------------------=[end definition]
end#---------------------------------------------------------------=[end it all]

and the latest screenshot!:


it took a few minutes of messing around with the "elsif" statements in draw_hearts and draw_stars
but I think I've got it!!! I'd like to make sure that this was done correctly... if so...

how would I incorporate an animation to play for when a container appears completely filled (zoom in)
and when a containers disappears completely empty (zoom out)
???
 
if I'm able to configure an option for vertical alignment, then the animation will be the final function to tackle for this
amazing project! thanks " /A\|L|3|=|R-T-><)))'> "

~(G


                  
« Last Edit: September 26, 2009, 06:06:58 AM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
I;m not exactly sure what you mean by zoom in and zoom out.

Also great job getting the partial empty hearts/stars working. I knew you would figure it out.
« Last Edit: September 20, 2009, 05:43:39 AM by albertfish »

***
Rep:
Level 83
X-PLAT!
@albertfish - I''l try my best to describe the animation feature request for "THE" script.
                   here is the four points that I would like to animate:

1.)
DRAIN ANIMATION: the first animation I would like to incorporate will be for the 'LOSS of HP' or the 'USE of SP'
(under 100 pts so partial damage or loss)

for example when you lose HP, the current heart container will show blood squirts.
and the same for when you use SP, the current star will show sparkles.

2.)
FILL ANIMATION: the second animation will be for regaining HP/SP
(again under 100pts so partial gain of HP/SP)

for example when you regain HP, the current heart container will glow.
and the same for when you regain SP, the current star will shine.

3.)
COMPLETELY EMPTIED CONTAINER: the third animation will be for when you lose 100 or more HP/SP
so that when the most recent container (or all containers) completely empties a "zoom out" animation will show.
what I mean by zoom out is 'regular size to enlarged size' then fades away...

for example when you lose 100 or more HP/SP the most recently emptied Heart/Star (or all) will show
the same "empty container image" starting regular size to a larger size as it fades away then disappears.
the empty containers will remain, maybe a little less in opacity.

4.)
COMPLETLY FILLED CONTAINER: the forth and final animation will be for when you gain 100 or more HP/SP
so that when the next container (or all containers) completely fills a "zoom in" animation will show.
what I mean by zoom in is 'enlarged size to regular size' then fades away...

for example when you regain 100 or more HP/SP the most recently filled Heart/Star (or all) will show
the same "filled container image" starting enlarged size to regular size as it fades in to match the container.

I hope I've explained it well enough to make it possible.

BTW - thank you again for getting me this far, I'm glad you've notice that I'm starting to understand script
and actually worked out some things on my own (instead of asking questions for each and every step)
I'm already excited about "THE" script's current version and where this will lead me into my creative future... ~g

edit: Haha! I was trying to comment the script and I already forgot what some lines of code do...^,^
       it's " more I learn, the more I forget " reviewing your ever so clever posts.
« Last Edit: September 20, 2009, 09:24:48 AM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
Animating these is a lot more advanced than the rest of the script. I'm going to be busy with school this week, but I'll try to help in my spare time.

***
Rep:
Level 83
X-PLAT!
@albertfish - animations, more advance!? oh my... just making the 'elsif' statments were complex enough to make
                  my brain beg for mercy ^,^ but I'm ready to torture it with more code...
 
                  school? ahh ~ so are you getting a degree in programming?
                  well take it easy on your busy week, and I look forward to your spare time...

                  in the mean time I'll be working on the vertical alignment option
                  and a module for easy option settings. ~((G//A//\/\||E||F//A((C||=

                    
« Last Edit: September 26, 2009, 06:06:28 AM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
No, I almost went for a degree in programming. Now it's just a hobby. I'm studying forensic science, which is quite a bit different then programming lol.

***
Rep:
Level 83
X-PLAT!
@albertfish - ahh~ I get it... Detective Scrotes! ^,^ the original CSI is my favorite...

just so you know I've followed your instructions for vertical alignment
I keep getting an undefined local variable or method 'valign' error.
(if i understand correctly, i need to define what 'valign' does....?)

Quote

Code: [Select]
def initialize
    super (-16, -16, 640, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    $valign = 0
    refresh
    self.opacity = 0
  end
And then in the draw_hearts and draw_stars function do the following:

Code: [Select]
def draw_heart
    x = 4
    y = valign
    ...
end


Code: [Select]
def draw_star
    x = 4
    y = 26 + valign
    ...
  end

experimenting...
« Last Edit: September 21, 2009, 05:28:17 AM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
The answer to that is because valign is not defined.

There are many different types of variables. Four very common ones are global, instance, local variables and constants.

Global variables can be accessed and changed anywhere. You do not need to define them in every class, hence the name global. The are defined by a $, for example:
Code: [Select]
$valign = 0 #This is a global variable

Instance variables can be accessed my any method but only in the class in which they are defined in. If you create an instance variable in class Cool_Window, you can access it in the redraw method or the update method, but you cannot access it in class Notsocool_Window. Although you can set it up as a public instance variable to do so, however I will not go into this. Instance variables are defined by @, for example:
Code: [Select]
@valign = 0 #This is an instance variable

Local variables can only be accessed in the method in which it was defined in. So if you create this variable in the refresh method, you can't access it in the update method. These are defined by putting nothing in front of it. For example:
Code: [Select]
valign = 0 #This is a local variable

Constants are variables that do not get changed. For example the math number pi. This value is always 3.14159265..... These variables are defined by using upper case letters, for example
Code: [Select]
VALIGN = 0 #This is a constant

So you defined a instance variable @valign, and then you tried to access an undefined local variable valign.

Edit: I realize that I typed that in one of my previous posts, but I never tested the code so I never caught the error lol. I changed it, thanks for catching it.
« Last Edit: September 21, 2009, 04:05:34 AM by albertfish »

***
Rep:
Level 83
X-PLAT!
@albertfish - aha~ just like variables in the event commands, there's variables in script.

Global Variables:
Quote
Global variables can be accessed and changed anywhere. You do not need to define them in every class, hence the name global. The are defined by a $, for example:
Code: [Select]
$valign = 0 #This is a global variable
I always see that "$" because most scripts are called by using a 'global' variable ~ $scene = Super_Cool_Window.new
(ok I get it)

Instant variables:
Quote
Instance variables can be accessed my any method but only in the class in which they are defined in. If you create an instance variable in class Cool_Window, you can access it in the redraw method or the update method, but you cannot access it in class Notsocool_Window. Although you can set it up as a public instance variable to do so, however I will not go into this. Instance variables are defined by @, for example:
Code: [Select]
@valign = 0 #This is an instance variable
so when you start a script, you use a "Class" and if there's a variable in that class you want to use in your script
you can simply use @that_variable (right?)

Quote
Local variables can only be accessed in the method in which it was defined in. So if you create this variable in the refresh method, you can't access it in the update method. These are defined by putting nothing in front of it. For example:
Code: [Select]
valign = 0 #This is a local variable
you make variables local not global if you only want it access in a certain part of code

Quote
Constants are variables that do not get changed. For example the math number pi. This value is always 3.14159265..... These variables are defined by using upper case letters, for example
Code: [Select]
VALIGN = 0 #This is a constant
ok, I've seen this in scripts that use CONSTANTS for easy options such as BUTTON = X
and this is why you don't capitalize Variables = variables, convention right?

oh and I've tried using this method in "THE" script for vertical alignment:

class:
Code: [Select]
#########################################################################[CLASS]
class Window_Hearts < Window_Base#-----------------------------=[in game window]
  def initialize#-------------------------------------------------=[define load]
    super (-16, 20, 340, 400)#------------=[x,y window position x,y window size]
    self.contents = Bitmap.new(width - 32, height - 32)#--------------------=[?]
    @valign = 50#-----------------------------------=[vertical alignment option]
    refresh#---------------------------------------------=[call refresh command]
    self.opacity = 50#------------------------------------=[window skin opacity]
  end#---------------------------------------------------------=[end definition]
 

draw_star
Code: [Select]
####################################################################[DRAW STARS] 
  def draw_star#---------------------------------------------=[define draw_star]
    x = 17 #-----------------------------------------------=[draw x coordinates]
    y = 26 + $valign #----------------------------------------=[vertical option]
#    y = 12 #----------------------------------------------=[draw y coordinates]
   

and draw_heart
Code: [Select]
###################################################################[DRAW HEARTS]
  def draw_heart#-------------------------------------------=[define draw_heart]
    x = 4 #------------------------------------------------=[draw x coordinates]
    y = $valign #---------------------------------------------=[vertical option]   
#    y = 0 #-----------------------------------------------=[draw y coordinates]

it loads but everything remains horizontal at a lower position...
I'm currently studying a few scripts that use a vertical setup
maybe I'll get lucky ^,^ if not I'll patiently wait

well thanks for making time on your spare time... I'm glad programming is your hobby...
mine is making music and drawing freehand art... (how ever I can return the favor, you let me know ^,^)
the reason why I'm trying so hard to be good at programming
is so that I can bring my art and music to life through my passion towards making games... ~g

**
Rep:
Level 83
Detective Scrotes
I suck at music and art lol. I'm very left brain logic, which is why I understand programming as well as I do. It is a very logical language, and when I read a piece of code I understand how the code will run.

There is something I want to say about instance variables. You said if you want to use a variable in a script you would use it... Well, that depends. A lot of scripts are generally made up of many classes. For example a CMS could edit class Scene_Menu, class Window_Status, class Scene_Status, etc.

This could all be in one script, but there are many class edits. Your script for example has two classes. So you can't use an instance variable over the entire script that easily. However you can make it a public instance variable and then be able to access it from a different class, but that is a bit more advanced.

And you are right about $scene. It is a global variable that has the current scene stored. However you wouldn't store a window class in the scene variable.

As for your code problem, I wont give you the solution in code format, I'll just tell you what you did.

You define a instance variable, @valign, correctly. However you are trying to access a global variable which has not previously been defined.

I use local variable quite a lot. There are useful when you are passing something into a method for calculations to be made for example.

Code: [Select]
def initialize
  y = add(1, 2)
end
def add(num1, num2)
  return num1 + num2
end
All the variables used here, y, num1, and num2, are all local variables. If I tried to access num1 or num2 from the initialize method, I would get an error.
« Last Edit: September 21, 2009, 05:48:13 AM by albertfish »

***
Rep:
Level 83
X-PLAT!
@albertfish - I suck at logic! HAHA, I'm very right side of the mind, I'm even left handed ^,^
                  Now it's time to examine the evidence in the laboratory for further investigation...  
                  I'll try my best to solve this case of incorrect code... ~g

edit: ok so far I know that the instance variable in the windows class was setup but not defined
       and the global variables in the draw_hearts/stars definitions needed the '$' removed to make them local.
       
       now to define the instance variable in the windows class is where I'm stuck...
       to define "valign" I know it's going to take more than just:
Code: [Select]
  def valign
    y = 10
    end
I've tried your example
Code: [Select]
  def valign
  y = add(-10, 50)
end
def add(num1, num2)
  return num1 + num2
end
but still I only get everything to shift down "Y" no "X"

I've made sure to increase the size for the super
and opacity on the window skin to test my results...
I'm certain it's a mathematical formula I've never seen before. ^,^

here's the latest screenshot:

(tinkering with algorithms during lunch)
       
« Last Edit: September 21, 2009, 07:28:02 PM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
You are making it more complicated then it is :P.
Code: [Select]
def initialize
  @valign = 0
  ...
end
def draw_hearts
  y = @valign
  ...
end

***
Rep:
Level 83
X-PLAT!
@albertfish - HAH! I knew it! I always do ^,^ guess it's part of sucking at logic...
                  funny how I can get some complicated stuff and then get stuck on the simple stuff. ;D
                  so let me get this straight...
 
we are using an instance variable and defining it as 0 under the window class.
then in the draw_hearts definition we are defining y as that instance. right?
just asking, but is this the same as turning y = 0?

here's what I've done...
class:
Code: [Select]
#########################################################################[CLASS]
class Window_Hearts < Window_Base#-----------------------------=[in game window]
  def initialize#-------------------------------------------------=[define load]
  @valign = 0#--------------------------------------=[vertical alignment option]
#  super (-16, 20, 340, 100)#------------------------------=[vertical alignment]
  super (-16, 100, 100, 340)#--------------=[x,y window position x,y window size]
    self.contents = Bitmap.new(width - 32, height - 32)#--------------------=[?]   
    refresh#---------------------------------------------=[call refresh command]
    self.opacity = 50#-------------------------------------=[window skin opacity]
  end#---------------------------------------------------------=[end definition]
 
and draw_hearts
Code: [Select]
###################################################################[DRAW HEARTS]
  def draw_heart#-------------------------------------------=[define draw_heart]
    x = 4 #------------------------------------------------=[draw x coordinates]
     y = @valign#---------------------------------------------=[vertical option]   
#    y = 0#------------------------------------------------=[draw y coordinates]

what I don't get is where in the code does it instruct the src_rect or bitmap
to vertically stack top to bottom or bottom to top...? trying not to overthink! :lol: ~g


           

**
Rep:
Level 83
Detective Scrotes
I thought you meant by vertical alignment that you wanted to shift the hud up or down. But now I think you want then hearts to be oriented vertically. Is that correct?

***
Rep:
Level 83
X-PLAT!
@albertfish - oh! ^,^ yes that's what I was referring to...
                  sorry for the confusion
/\/\ _/\_
\  / >   <
 V
/\/\ _/\_
\  / >   <
 V
/\/\ _/\_
\  / >   <
 V

edit: alright! here's the latest! ^,^
all I 've done was swap x for y and width for height on each line of code, except!
for self.contents (under super) swapped bitmaps in the 'elsif' statements and it worked!!!
the meter now stacks vertically and each container and containers themselves drain from bottom to top...
I'm sure I will figure out how to make it go from top to bottom...


ok now the time has come to do the animations
this will be final stage! thanks again to albertfish for getting me this far....

@albertfish - take it easy at school! ~g

 /   \
 ^ ^
\___/
« Last Edit: September 24, 2009, 10:35:25 PM by gameface101 »

**
Rep:
Level 83
Detective Scrotes
Awesome! I thought you would figure it out.
But I've gotta study for a midterm, I was coming by to check the progress. Nicely done :P.