LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



View previous topic View next topic Go down Message [Page 1 of 1]

Administrator
Administrator
#1 default RMXP = Algorithmic Graphic Meters Script
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
Here's my very first attempt to contribute to the RMXP community.
RMXP is short for RPG MAKER XP, and this script can be used to draw up the player's containers for health, mana, or experience.
The default setting is to draw a row of Heart containers
(similar to Link's Health Bar on Legend of Zelda)


ALGORITHMIC GRAPHIC METERS for ABS HUD

Version:1.4
Author: G@MeF@Ce
(original 'Heart Container' script by DarkRog 2006)

special thanks to modern algebra AND albertfish for script Help!
Latest Update: 2-8-2012


[You must be registered and logged in to see this image.][You must be registered and logged in to see this image.]

Version History
Version 1.1 = included alias method, so no need to edit Scene_Map
Version 1.2 = included variable setting to control the amount of hearts
Version 1.3 = included switch setting to enable or disable display
Version 1.4 = new version for SP with a blue diamond algorithm


Planned Future Versions
- vertical alignment or orientation
- constant settings for an even easier setup



Features
-the script will draw the "container", "outline", and "fill" through algorithms, meaning... no need for pictures!
-option settings can display hero's name, value and max value, containers and max containers, or percentage!
-multiple algorithms to use for different shapes, hearts, diamonds, triangles, squares.... even customize your own!
-easy one switch to disable or enable display and easy one variable to control the amount of containers!

Script
Spoiler:
Code:
################################################################################
# Algorithmic Graphic Meter
# revised by ~G@MeF@Ce
# V 1.4 (2009) 
#
# original "Heart Container" script by DarkRog (2006)
# special thanks to modern algebra and albertfish for rgss support
#
# http://rmrk.net/index.php/topic,34542.0.html
#
################################################################################
# Instructions:
#
# 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 hearts
################################################################################

class Window_Corazones < Window_Base

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


#[Heart Containers] (number of hearts you wish to display)
#--------------------------------------------------
#corazones = 10 #[use this setting for a fixed number of hearts] or...
corazones = $game_variables[101]#to control amount of hearts 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 =Hearts/Maxhearts 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]
      @hearts = corazones
      @opacity = opacidad
      @option = opcion
      @hr = 0
      refresh
    end
#-------------------------------------------------------------------------------
      def refresh
      @hearts = $game_variables[101]#-----------------------------=[Variable_ID] 
      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
##############################################################[heart containers]           
        self.contents.fill_rect(i*14, 4, 1, 3, Color.new(0, 0, 0, @opacity))
        self.contents.fill_rect(i*14+1, 3, 1, 5, Color.new(0, 0, 0, @opacity))
        self.contents.fill_rect(i*14+2, 2, 1, 7, Color.new(0, 0, 0, @opacity))
        self.contents.fill_rect(i*14+3, 1, 1, 9, Color.new(0, 0, 0, @opacity))
        self.contents.fill_rect(i*14+4, 0, 1, 11, Color.new(0, 0, 0, @opacity))
        self.contents.fill_rect(i*14+5, 1, 1, 11, Color.new(0, 0, 0, @opacity))
        self.contents.fill_rect(i*14+6, 2, 1, 11, Color.new(0, 0, 0, @opacity))
        self.contents.fill_rect(i*14+7, 1, 1, 11, Color.new(0, 0, 0, @opacity))
        self.contents.fill_rect(i*14+8, 0, 1, 11, Color.new(0, 0, 0, @opacity))
        self.contents.fill_rect(i*14+9, 1, 1, 9, Color.new(0, 0, 0, @opacity))
        self.contents.fill_rect(i*14+10, 2, 1, 7, Color.new(0, 0, 0, @opacity))
        self.contents.fill_rect(i*14+11, 3, 1, 5, Color.new(0, 0, 0, @opacity))
        self.contents.fill_rect(i*14+12, 4, 1, 3, Color.new(0, 0, 0, @opacity))
################################################################################
       
#################################################################[heart 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))
################################################################################

#[color settings]
        @c = 255
        @l = @n*100/@mn
        @ho = @l*@hearts
####################################################################[heart fill]
        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
     
#[update]
  def update
    @value=$game_variables[101]#-------------=[to update current amount of Hearts]
    $old_hp = $game_party.actors[0].hp#--------=[to update current amount of HP]
  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
################################################################################


#############=======================================[alias method for Scene_Map]
# Scene_Map #
#############
class Scene_Map
 alias gameface101_main main
  def main #MAIN
  @corazones = Window_Corazones.new
  gameface101_main
  @corazones.dispose
end
 alias gameface101_update update
  def update #UPDATE
  gameface101_update

      @corazones.refresh if $old_hp != $game_party.actors[0].hp
      @corazones.visible = $game_switches[401]#------=[SWITCH_ID DISPLAY ON/OFF]
      @corazones.update
    end
    end
Credits
-original "Window_Corazones" script by DarkRog (2006)
-revised and modified by G@MeF@Ce (2009)

Special Thanks
-first I'd like to thank DarkRog for making the original script which was the only heart container script out there...
-second I would like to thank modern algebra for script help and starting me off on my scripting quest
-third I would like to thank albertfish for ultimately stepping in and becoming my scripting mentor
-and last, I can't forget about all those zelda games I played when I was a kid...

Compatibility
there shouldn't be any problems with other scripts.

Demo
[You must be registered and logged in to see this link.]
(link updated 2-8-12)

~Zelda ~ eat your hearts out! ^,^

Restrictions
free to use...must give credit

Instructions
-copy and paste this script above your Main script
-assign a switch to control display (default is 401)
-assign a variable to control container amount (default is 101)
-then control through events...^,^



HOW TO USE AS A HEART CONTAINER HEALTH BAR:

STEP ONE: copy script, paste above Main script
(included an alias method with Scene_Map, so no need to edit other scripts)

STEP TWO: create "control" event

Default Settings:(example)

[set trigger = parallel process]
@>Control Variables: [0002:HEARTS]=3 (for three hearts...)
@>Control Switches: [0002:HEARTS]= ON (to display the hearts...)
@>Control Self Switch:A =ON (turn to the next event page)


STEP THREE: copy graphic to your character folder

[You must be registered and logged in to see this image.]


STEP FOUR: create "heart" event

Default Settings:(example)(10 points as an example)

[set trigger = player touch]
@>Play SE:'003-System03',100,100 #(sound when collect heart)
@>Control Parameters: [Hero], MaxHP +10 #(increase Hero's maximum HP 'capacity')
@>Control Variables: [0002:HEARTS] +=1 #(to gain extra heart container)
@>Change HP: Entire Party,+10 #(increase Hero's HP)
@>Control Self Switch:A =ON (turn to the next event page)

*set graphic (copied above)
*check - Stop Animation

this script works well with the hearts and stars HUD I made with albertfish
[You must be registered and logged in to see this image.]
Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
ACTIVATED
ACTIVATED
#2 default Re: RMXP = Algorithmic Graphic Meters Script
Loading

mely

mely
ACTIVATED
ACTIVATED
ACTIVATED
profile
download link said:
Invalid or Deleted File.
ACTIVATED
Show Signature
ACTIVATED
Administrator
Administrator
#3 default Re: RMXP = Algorithmic Graphic Meters Script
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
Cool - yo mely! most likely the download link had expired. just so happens that I was able to find the old hearts demo I mad a few years ago!

here you go...


[You must be registered and logged in to see this link.]


this brings back memories ^,^

updating original post
Administrator
Show Signature


Hey Guest, check out my demos!
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]




G101's theme colors
[You must be registered and logged in to see this image.]
[You must be registered and logged in to see this link.]

[You must be registered and logged in to see this image.]


shhh.... [You must be registered and logged in to see this link.]



[You must be registered and logged in to see this link.]
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 1 of 1]

 

Chatbox system disabled
Personal messaging disabled