Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Shalaren

41
I need to move it in the X value by 1 I think as it sticks out a bit, where do I find that?
I'm at this line
self.bitmap.fill_rect(30*(i-1), 1, len, 8, Color.new(255, 255, 0))

The 1 by ,len moves in by Y value, where the x then?

and haha thanks xD
42
That's great!  :haha: lv up*

the hud is great now thank you!, now I'm just trying to work with some add ons.
I am using Action Recharge Times by Winkio
http://forum.chaos-project.com/index.php/topic,2312.0.html

tho I guess because this is a custom hud it messes it up a bit so this happens
Spoiler: ShowHide

The distance is too big, I tried playing with random numbers in the script but nothing I can see affects the distance between each recharge sprite.
I think it should be somewhere at this part
Spoiler: ShowHide
 #----------------------------------------------------------------------------
  # draw
  #  Draws the recharge sectors over the hotkey display.
  #----------------------------------------------------------------------------
  def draw(index = nil)
    # iterate through all skills that need to be recharged
    (@skillrecharge).each {|i|
      # temporary var
      object = $data_skills[$game_player.skill_hotkeys[i%10]]
      ind = $game_player.skill_hotkeys[i%10]+1
      if $game_player.recharging?(ind)
        # remove old image
        self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        # draw recharge indicator
        len = (24*$game_player.rech_rate(ind)).to_i
        self.bitmap.fill_rect(32*(i-1)+4, 0, len, 4, Color.new(255, 255, 0))
        self.bitmap.draw_text_full(32*(i-1)+4, 4, 24, 24, (($game_player.rechcounter[ind]/40).to_i+1).to_s, 1)
      else
        if object != nil
          # remove old image
          self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        end
        @skillrecharge.delete(i)
      end}
    # iterate through all items that need to be recharged
    (@itemrecharge).each {|i|
      # temporary var
      object = $data_items[$game_player.item_hotkeys[i%10]]
      ind = $game_player.item_hotkeys[i%10]+1
      if $game_player.recharging?(ind)
        # remove old image
        self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        # draw recharge indicator
        len = (24*$game_player.rech_rate(ind)).to_i
        self.bitmap.fill_rect(32*(i-1)+4, 0, len, 4, Color.new(255, 255, 0))
        self.bitmap.draw_text_full(32*(i-1)+4, 4, 24, 24, (($game_player.rechcounter[ind]/40).to_i+1).to_s, 1)
      else
        if object != nil
          # remove old image
          self.bitmap.fill_rect(32*(i-1), 0, 32, 32, Color.new(0, 0, 0, 0))
        end
        @itemrecharge.delete(i)
      end}
  end
haha I can't seem to find what I need to modify, (learning how to script is gonna take some time for me xD)

btw unrelated to the hud, only if you know what to do, --
but there is a problem with the recharge script as if you try to put recharge on items it wont do anything in game. it does work with skills however, about this problem tho Ill probably have to post in the Script Troubleshooting forum if you aren't sure.

Thanks in advance :] you've already helped so much, I'm really enjoying how this hud turned out.
43
So wait how do I change the size for the Quantity? its still enormous S:
I changed the opacity in the option you added but it makes no difference. the only configuration I am able to do to the Quantity it seems is to change the X and Y values
I want to take the bold off and make it really small, opacity lower and put it at the corner of the hotkey. but no matter what I do it stays as big as it is in the picture above  :wacko:

Edit: Yeah I see what you did, The text was green so I missed it! found the Size feature and all...
Regardless-- the Opacity doesnt work, the rest does tho :)
44

if I change the size, it will only change the size for the Hotkey#, however wont change the size of the oversized Quantity. and for the quantity text, I tried to look for it in the script... can I change opacity? if not can there be an option added to change opacity?
plus could there be an option to hide the Hotkey#? I think it would look better if I just make the numbers on the background image.

and again, thank you KK20, you are a great scripter!
(I added you to my game's credit scene)
45
um hey, I was testing the game and realized something in the hud,  im using direct hotkeys,
so besically if I put potions on the hotkeys, I cant really know how many are there
Spoiler: ShowHide

its like this, its just unknown how many potions are there,
so I wanted to know if there is a way to put numbers on them
something like
Spoiler: ShowHide

Do I just need to change something in the class Hotkey_Assignment ? what would I need to add in there to make it so it shows the amount?
46
Recruitment / Re: The Storyline Service. Epic Stories.
August 13, 2013, 10:59:06 pm
hahaha ok  :^_^':
47
Recruitment / Re: The Storyline Service. Epic Stories.
August 13, 2013, 10:40:52 pm
Haha oh boy I dont know where to start with this...
ok this is some history of the world for my game
Spoiler: ShowHide
QuoteMagic. One of the greatest mysteries of this world, from simple magic capable of levitating objects off the ground to conjuring powerful lightning storms. It takes on many forms and yet it is bound by none. To use such mysterious and sometimes terrifying power one must have the right knowledge,understanding and mentallity to control it. However not everyone is born to use it as it is a birthright only granted to a few.
54 years before the Enchanted Seal, the Eight Nethien, filled with tremendous powers, were the first to discover the mysterious forces of magic, How they had done so remains a mystery. Each of  The Eight had seen it fit to pass on their knowledge to students who in turn taught to their own, and slowly magic had become more widespread in the world of Shalaren. Magic had made living much easier, creating vast improvements in the fields of Agriculture, Travel and most importantly in Warfare. People were quick to notice that magic was also useful not only in improving lives but in taking them as well. The Order of the Maestre founded by The Eight, the first wielders of magic had seen over the years the chaos that magic had caused and thus they created the Shroud, An elite force of soldiers with only one task.
To regulate the use of magic from the shadows. The Shroud did their work well. Too well for that matter as many magical users had been slain by their religious zeal to fufill their duty to the Maestre. Soon it had become an unspoken rule that those who use magic, regardless of their position or occupation will be swiftly silenced permenently. The Maestre thinking that the Shroud's actions had solved their problem had breathed a sigh of relief. The world was finally at peace.
How very wrong they were.
Soon leaders from all different races over the world felt  threatened by The Eight being the only ones allowed to use magic, and had begun to rise up in open revolt to fight for their freedom to use magic. The Miea, a peace court founded by the Maestre sought to calm these leaders through peaceful negotiations, However they could not be swayed by mere words and thus they had to be silenced by force. With a heavy heart they gave the order and the Shroud sprung into action silently stiffling the voices of the rebellion. At least that was the initial plan. The major powers of the rebellion had managed to convince some of the more prominent and powerful warriors to join their cause and a vicious and terrible battle ensued between the sides that rallied to the Maestre's flag and those who opposed them. The rampant use of magic by both forces had caused reality to shift and dissolve causing most individuals to descend into madness.
Lucius, one of The Eight and a very well educated pupeteer and also a well known leader in the Shroud, had managed to create a curse, a seal to limit the use of magic throughout the world. The raging flames of war had been cooled. Everyone's magical abillity had begun to weaken slowly over the course of days, some even losing their abillity to use magic at all. The Enchanter's Seal as they called it brought peace throughout the land. The leaders of the uprising had accepted their loss of access to magic seeing as even the Eight were stripped of their own magical abillity. And thus peace took it's hold on the land.
At least for awhile...
The remaining Seven resented their loss of magical abillity and demanded Lucious to break the Seal. They claimed that they were wrong and that Shalaren needed magic as the people had grown too accostomed in using it. However their true goal was power, Power over the weak and to be looked upon as Gods among all races. Lucius begged them to give the seal a chance, It will bring peace he argued but his pleas fell on deaf ears.
The remaining Seven rallied upon those still loyal to them and formed a new union which they called the "True Order". Knowing that Lucious's death would destroy the seal as he was the one that had created it. Although The Seven who opposed Lucious only held a shadow of the power they once weilded they still managed to consolodate all their powers into one last powerful spell of destruction. Lightning struck the earth violently, the earth split asunder and the winds howled in rage.
All this just to kill one. Lucius however had managed to gather those loyal to him within the Shroud and as destruction raged around them he was protected by the powerful force of his allies. Lucious knew that the seal was the cause of this madness and that only he could control it. Upon realizing this it was up to him to seal himself and the rest of the Eight forever. The Seal held great magic poweful enough to entomb the Eight in a powerful spell, sealing them away for all eternity and scattering them through out the landscape to be forgotten throughout time.
However the True Order remained, creating chaos driven by only one purpose, To break Enchanter's Seal. Few had risen up against the tyrnical Order intending to thwart their plans of breaking the seal. These brave men and women are the Heroes of Shalaren and it is up to them to stop the so called True Order and trully bring peace to this world.

which I had for a while, but to be honest... I am not happy with it at all S: it focuses too much about magic, and it just isnt that big of an emphasis, actually Magic is just another concept in the world just like anything else, the only difference is that a seal was cast on the world just to weaken magic generally, but I dont want an emphasis on that either! S: The seal isnt the only thing that was done to end the chaos, and the Chaos it self was only caused because of the eight to begin with. so its ok to have an emphasis that the eight used magic, and that they had to be sealed away since they were dangerous, but in a different way I suppose. there are 2 stories I need to built, a story of how the world became to be (as how the gods created it) and just general history of the world which is what this one is... so it needs to be along the lines of how the world was going in its natural rhythm, and then the eight discovered their powers (I am thinking of coming up with a different name for magic... S:) and from there crap began to happen, but emphasising more on events like the establishment of the Meastre, or the Shroud, and how the world changed.  I hope I didnt confuse you too much, but I need help reorganising this story, because I can't figure it out myself S:, I tried many different things but I just fail at writing so much x-x

incase you aren't sure what I mean about something just let me know, otherwise do you have any suggestions and ideas? :)

Thank you in advance!

Edit: I thought of making it easier by merging the stories together too, of explaining how the world became to be and the events that followed that
Here is a rough draft of the story about the gods
Spoiler: ShowHide
QuoteThere's old scriptures carved onto the walls of the ancient ruins of Adalyn, of two twins symbolizing two different moons, fighting over a rock, a rock the locals believe to be our world before it was given life. The two kept pulling the rock back and fourth, screaming and teasing one another until it finally cracked, but they kept pulling until they soon found themselves falling into opposite directions with a different piece of the rock... angriliy the twins kept screaming at one another wanting the second piece. On these walls however there's unclear scribbles of a dark figure watching the twins from distance, and following them where ever they go... the locals say the light of their world protected the twins from darkness , and as long as it stays near, the dark figure cannot harm them. unfortunately it shows in the old scriptures that  at night when one of the twins was asleep, the other stole the other piece of the rock, and ran away to play with it leaving his brother alone. There was alot that was missing on the ruins but further down the walls, it showed of one of the twins holding two pieces of the rock over the dead corpse of his other twin brother. The dead corpse was consumed with anger, fear, and darkness. The remaining twin began crying, devestated by regret kept holding onto the rocks and with a single tear to fall upon them, it softened and connected the pieces together, and as tears kept falling, the oceans were created, and slowly over the long years so was life in this world.

which I hate I definetly need to think about something more creative x-x
48
General Discussion / Re: Ideas, Give them.
August 13, 2013, 10:00:39 pm
Teleportation stations  8) best futuristic way to travel.
looks like an outside elevator, or a police box like of Dr.who's  :V:
49
EDIT: NVM I FIXED IT BY MESSING WITH THE CMS! thanks Drago :)

Just one more suggestion, to add opacity option
altough for me I just changed this line
    "@name_event.opacity    = self.opacity" to a number
50
ok so you know im using a CMS, here is what happens

is there a way to make it so it is at the bottom of the bubble?
that the bubble overlaps and the name is under?
51
sorry for the Necroposting

I tried adding it to a new project and it gives me the error
Spoiler: ShowHide
QuoteScript 'Event-Name' line 120: NoMethodError Occurred
undefined method 'width' for #<sprite:0x3175780>

Im trying to play around with it but I just can't figure out whats wrong, its on a new project there are no other scripts
52
Thank you :) that works great.
lv up*
53
awesome thanks :) lv*

tho I found an annoying thing this does.
with the Babs caterpillar script the bubble appears on the 4th actor instead on the one you are controlling. (and even if you only have 1 person in your party, it shows the bubble over where the 4th character would of been if there was one, so it wont be over the main character regardless) is there a way to fix that? (as long as the bubble is on top of the main character, although it would of been cool if it would be possible to choose which character the bubble should appear on top of)
54
Recruitment / Re: The Storyline Service. Epic Stories.
August 13, 2013, 12:57:21 am
anyone still offering any service? I need a little help with writing the story for my project
55
Thanks for the reply :)
I tried it and the game crashes when moving, with the error of

Script "BlizzABS Check - Zer0" line 32 NameError occurred.
uninitialized constant BlizzABS::Controller::Cache
56
Hey guys! I really like this Custom Message Script by Hodgeelmf, its small simple and animated and is just really pleasant to use. you can try it and you'll see what I mean. however it wont work with Blizz-ABS :( is there anyway to fix it? maybe anyway to disable blizz abs anytime the message script is acitve? its similar to ForeverZer0 CMS, its just that this one has a smoother feel and the chat bubble is a lot smaller making it very nice visually for cutscenes.
Spoiler: ShowHide



EDIT: Because of the character limit, the following script could not be fully displayed and had to be deleted. It would be best to either provide the link to the script itself or post it into something like Pastebin. -KK20
57
Recruitment / Re: [rmxp] Shalaren Mappers needed :D
August 12, 2013, 01:32:10 am
Hey thank you for reading! haha I figured it would of been too much to read.

and yeah haha thats where it gets a bit complicated, I just didn't explain it well. I will be using a quest system which creates two groups of quests. Main quests and side quests. the main quests will be the longest chain of quests which are all about your character, letting you develop it making a 'hero' out of it. so your character will start off simple, lets say as a farm boy (depending on your choice) and slowly as you progress in the game your character becomes a lot more. and side quests, are about other characters, short stories that can be completely unrelated to the storyline of your character. these quest-lines follow different stories and different events. so there is no 'real hero' considering there are many things to be the hero of.

what do you think about that? :P

It's a bit hard for me to explain, but basically doing this is my way of making sure I can add any new story I have in mind, or any story someone has suggested to me. I could just add it without interfering with the main story :).

Edit: The story is something along these lines... I tried leaving a lot out because I don't want to spoil it... S: I'm really bad at writing stories that don't spoil what's going to be in the game
Spoiler: ShowHide
Saber Harkrader is an old man living in the city of Franae's Pass. he worked at the nearby bakery where he would be famous for his amazing muffins. He seemed like the nicest person to all of the city's residents, however Saber had a great secret that he's been waiting for a long time to reveal, and now, finally the time has come. When one of the five Nethien Meastre represantive, Alysia Liberati returned to her home in Franae's Pass,  Shroud soldiers came back with her, Soldiers who aren't all Nethiens. she wanted to inform her people of what she had found out from the Meastre, she had told them that the Shroud's Citadel by the City of Panshaw in Euphea had been wiped out with all the people in it by a mysterious explosion, and that the Meastre is suspecting the culprit meant to target Panshaw, and that the Citadel was just in the way. There are rumours going around of the Infamous Order finding a way to break the seal that limits their powers, either way the Meastre representatives believe that Nethien cities might be targeted. which is why the Shroud soldiers are here, to defend Franae's Pass from any possible threats outside the cities walls, not letting anyone in, or anyone out. Your character is a Mundane living in the town of Amoria of the continent of Arcania, you will have around three biographies to choose for your character which will determine where your story begins, and you will then choose one out of the six available classes. which ever path you choose, it will eventually lead you to having to go talk with one of the a Meastre Representative, which one event leads to the other and you will be caught in a battle between the Shroud and the Infamous Order.
58
ah crap. this is gonna take a while x-x
I just need some features in that script and its definitely none of the ones I need that's causing it...
well Ill try to play around with it and ill let ya know if I find out which one causes it S:

regardless thank you for your help! youve helped me alot :) *lv up
59
it loads forever x-x so I just tried playing around with it,
it doesnt fade for you because "Tons of addons" causes it, it happens when I have it, but when I deleted it, it doesnt happen.
my guess is its because of the "Black Fade" feature in tons of addons

anyway i can fix it without taking tons of addons out?
60
Spoiler: ShowHide
module Hud_Config
  HP       = 'HP'
  MP       = 'MP'
  EXP      = 'EXP'
  Empty    = 'Empty'
  EmptyExp = 'Empty_Exp'
  Back     = 'Back'
  MapBack  = 'Map_Back'
  EmptyExt = 'Empty_'
end
#==============================================================================
# Hud
#------------------------------------------------------------------------------
#  This class was modified to support SR display and modify the number of
#  skills left to use.
#==============================================================================
$map_infos = load_data('Data/MapInfos.rxdata')
$map_infos.keys.each {|key| $map_infos[key] = $map_infos[key].name}

class Hud < Sprite
 
  #----------------------------------------------------------------------------
  # Initialization
  #  viewport - the viewport for the sprite
  #----------------------------------------------------------------------------
  def initialize(viewport = nil)
    # call superclass method
    super
    # create positions
    create_positions
    # get height
    h = @hud_height
    $game_system.minimap = 1
    $game_system.hotkeys = true
    @name = Player_Name.new(self)
    @lvl  = Player_Lvl.new(self)
    @gold = Party_Gold.new(self)
    @ach = Party_ach.new(self)
    # create bitmap
    self.bitmap = Bitmap.new(@hud_width, h)
    # set font
    self.bitmap.font.name = 'Arial'
    # set font size
    self.bitmap.font.size = 12
    # set font to bold
    self.bitmap.font.bold = true
    # set x, y position depending on which HUD mode
    self.y = 480 - (h)
    # set z coordinate
    self.z = 1000
    # draw basic HUD
    draw_basic
    # update
    update
  end
  #----------------------------------------------------------------------------
  # create_positions
  #  Sets drawing positions. Can be aliased and the positions modified to
  #  create a different HUD.
  #----------------------------------------------------------------------------
  def create_positions
    @original_width = @hud_width = 474
    @original_height = @hud_height = 54
    @hp_x, @hp_y, @sp_x, @sp_y = 3, 15, 3, 35
    @hot_x, @hot_y, @left_x, @left_y = 4, 49, 8, 63
    @exp_x,@exp_y,@gold_x,@gold_y, @ach_x, @ach_y = 175, 0, 0, 0, 0, 0
  end
  #----------------------------------------------------------------------------
  # draw_basic
  #  Draws the HUD template.
  #----------------------------------------------------------------------------
  def draw_basic
    # fill with grey rectangle
    bitmap = RPG::Cache.picture('HUD/'+Hud_Config::Back)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.bitmap.blt(0,0, bitmap, src_rect)
    # determine color depending on HUD style
    color = case BlizzABS::Config::HUD_TYPE
    when 0 then Color.new(255, 255, 255, 195)
    when 1 then Color.new(0, 0, 0, 0)
    end
    # if color exists
    if color.is_a?(Color)
      # draw outline in color
      self.bitmap.fill_rect(@hp_x, @hp_y+3, 116, 14, color)
      # draw outline in color
      self.bitmap.fill_rect(@sp_x, @sp_y+3, 116, 14, color)
    end
    # set font color
    self.bitmap.font.color = system_color
  end
  #----------------------------------------------------------------------------
  # draw_empty
  #  Draws the HP and SP display when actor doesn't exist.
  #----------------------------------------------------------------------------
  def draw_empty
    # draw empty bars
    self.bitmap.gradient_bar_hud(@hp_x, @hp_y+3, 114, 0, 'hud_red_bar', 1)
    # draw empty bars
    self.bitmap.gradient_bar_hud(@sp_x, @sp_y+3, 114, 0, 'hud_blue_bar', 2)
    # draw empty bars
    self.bitmap.gradient_bar_hud(@exp_x, @exp_y+3, 200,0, 'hud_green_bar', 3)
    # set font color
    self.bitmap.font.color = disabled_color
    # draw empty HP
    self.bitmap.draw_text_full(@hp_x + 6, @hp_y, 48, 20, '0', 2)
    self.bitmap.draw_text_full(@hp_x + 54, @hp_y, 12, 20, '/', 1)
    self.bitmap.draw_text_full(@hp_x + 66, @hp_y, 48, 20, '0')
    # draw empty SP
    self.bitmap.draw_text_full(@sp_x + 6, @sp_y, 48, 20, '0', 2)
    self.bitmap.draw_text_full(@sp_x + 54, @sp_y, 12, 20, '/', 1)
    self.bitmap.draw_text_full(@sp_x + 66, @sp_y, 48, 20, '0')
     # draw empty EXP
    self.bitmap.draw_text_full(@exp_x + 54, @exp_y, 84, 20, '0.0', 2)
    # reset all flag variables
    @name = @level = @hp = @sp = @maxhp = @maxsp = @exp = @states = @skill =
        @skills_left = @item = @items_left = @gold = @ach = @exp = nil
  end
  #----------------------------------------------------------------------------
  # draw_hp
  #  Draws the HP display.
  #----------------------------------------------------------------------------
  def draw_hp
    # set current variables
    @hp, @maxhp = actor.hp, actor.maxhp
    # set fill rate
    rate = (@maxhp > 0 ? @hp.to_f / @maxhp : 0)
    # draw gradient bar
    self.bitmap.picture_bar(@hp_x, @hp_y+3,rate,Hud_Config::HP)
    # set font color depending on how many HP left
    self.bitmap.font.color = @hp == 0 ? knockout_color :
        @hp <= @maxhp / 4 ? crisis_color : normal_color
    # draw HP
    self.bitmap.draw_text_full(@hp_x+6, @hp_y, 48, 20, @hp.to_s, 2)
    # set color
    self.bitmap.font.color = normal_color
    # draw "/"
    self.bitmap.draw_text_full(@hp_x+54, @hp_y, 12, 20, '/', 1)
    # draw max HP
    self.bitmap.draw_text_full(@hp_x+66, @hp_y, 48, 20, @maxhp.to_s)
    self.bitmap.draw_text_full(@hp_x+2, @hp_y, 32, 20, $data_system.words.hp)
  end
  #----------------------------------------------------------------------------
  # draw_sp
  #  Draws the SP display.
  #----------------------------------------------------------------------------
  def draw_sp
    # set current variables
    @sp, @maxsp = actor.sp, actor.maxsp
    # set fill rate
    rate = (@maxsp > 0 ? @sp.to_f / @maxsp : 0)
    # draw gradient bar
    self.bitmap.picture_bar(@sp_x, @sp_y+3,rate,Hud_Config::MP)
    # set font color depending on how many SP left
    self.bitmap.font.color = @sp == 0 ? knockout_color :
        @sp <= @maxsp / 4 ? crisis_color : normal_color
    # draw SP
    self.bitmap.draw_text_full(@sp_x+6, @sp_y, 48, 20, @sp.to_s, 2)
    # set font color
    self.bitmap.font.color = normal_color
    # draw "/"
    self.bitmap.draw_text_full(@sp_x+54, @sp_y, 12, 20, '/', 1)
    # draw max SP
    self.bitmap.draw_text_full(@sp_x+66, @sp_y, 48, 20, @maxsp.to_s)
    self.bitmap.draw_text_full(@sp_x+2, @sp_y, 32, 20, $data_system.words.sp)
  end
  #----------------------------------------------------------------------------
  # draw_exp
  #  Draws the EXP display.
  #----------------------------------------------------------------------------
  def draw_exp
    # set current variables
    @exp = actor.exp
    # set fill rate
    rate = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp : 1)
    # draw gradient bar
    self.bitmap.picture_bar(@exp_x, @exp_y+3,rate,Hud_Config::EXP)
    self.bitmap.font.color = normal_color
    percent = (rate * 100).to_i
    self.bitmap.draw_text_full(@exp_x+60, @exp_y, 200, 18,
    "#{actor.cur_exp} / #{actor.max_exp}")
    self.bitmap.draw_text_full(@exp_x+195, @exp_y, 145, 18,percent.to_s)
    self.bitmap.draw_text_full(@exp_x+210, @exp_y, 150, 18,'%')
    self.bitmap.draw_text_full(@exp_x+2, @exp_y, 32, 18, 'EXP')
  end
 
  def draw_name
  end
 
  def draw_level
  end
   
  alias hud_update update
  def update
    draw_basic  if $game_temp.hud_refresh
    $game_temp.hud_refresh ? draw_exp : test_exp if actor != nil
    @gold.update
    @ach.update
    @name.update
    @lvl.update
    hud_update
  end
 
  def dispose
    super
    @name.dispose
    @lvl.dispose
    @gold.dispose
    @ach.dispose
  end
 
  def test_exp
    draw_exp if actor.exp != @exp
  end
 
  def test_name
    return
  end
 
  def test_level
    return
  end
 
end

class Hotkey_Assignment < Sprite
 
  def initialize(viewport = nil)
    # call superclass
    super
    # create bitmap
    self.bitmap = Bitmap.new(320, 32)
    # set font to bold
    self.bitmap.font.bold = true
    # decrease font size
    self.bitmap.font.size -= 8
    # set font color
    self.bitmap.font.color = system_color
    # set x and y position
    self.x, self.y, self.z = 174, 448, 1100
    # skill IDs on hotkeys
    @skills = BlizzABS::Cache::EmptyKeys
    # item IDs on hotkeys
    @items = BlizzABS::Cache::EmptyKeys
    # update display
    update
  end
 
  def draw(index = nil)
    # iterate through all hotkeys
    (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
        # if hotkey is skill hotkey
        if $game_player.skill_hotkeys[i%10] != 0
          # temporary object
          object = $data_skills[$game_player.skill_hotkeys[i%10]]
        # if hotkey is item hotkey
        elsif $game_player.item_hotkeys[i%10] != 0
          # temporary object
          object = $data_items[$game_player.item_hotkeys[i%10]]
        end
        # if any change applied (10 is used for 0)
        if @items[i%10] != $game_player.item_hotkeys[i%10] ||
            @skills[i%10] != $game_player.skill_hotkeys[i%10]
          # remove this icon
          self.bitmap.fill_rect(30*(i-1), 0, 24, 24, Color.new(0, 0, 0, 0))
          # if object exists
          if object != nil
            # load bitmap
            bitmap = RPG::Cache.icon(object.icon_name)
            # draw bitmap
            self.bitmap.blt(30*(i-1), 0, bitmap, Rect.new(0, 0, 24, 24))
          end
          # draw hotkey number
          self.bitmap.draw_text_full(30*(i-1), 10, 30, 32, (i%10).to_s, 2)
        end}
    # set new items
    @items = $game_player.item_hotkeys.clone
    # set new skills
    @skills = $game_player.skill_hotkeys.clone
  end
 
  alias hud_update update
  def update
    $game_system.hotkeys = ($game_system.hud)
    hud_update
  end
 
end

class Minimap < Sprite
 
  def initialize
    # call superclass method
    super(Viewport.new(478, 359, 160, 120))
    # get autotile image from Blizz-ABS Cache
    @autotile = $BlizzABS.cache.image('minimap_autotile')
    # creates the passable floor map
    @map_back = Map_Back.new(self)
    create_passable_floor
    # set x and y position
    self.x = self.y = 0
    # set z position
    viewport.z = 5000
    # store events
    @events, @names = check_events
    # create sprites for events
    create_sevents
    @map_name = Map_Name.new(self)
    # set all sprites visible
    self.visible = true
    # update
    update
  end
 
  alias hud_update update
  def update(con=false)
    hud_update(con)
    @map_back.update
    @map_name.update
  end
 
  def dispose
    destroy_sevents
    @map_back.dispose
    @map_name.dispose
    super
  end
 
end

class Scene_Hotkeys
 
  #----------------------------------------------------------------------------
  # main
  #  The main processing method.
  #----------------------------------------------------------------------------
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 0, 0)
    # set tone to current screen tone
    @view.tone = @tone.clone
    # create HUD if HUD is turned on and HUD active
    @hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud
    # if ASSIGNMENT is turned
    if BlizzABS::Config::HOTKEYS
      # create assignment display
      @hotkeys = Hotkey_Assignment.new
      # set z position
      @hotkeys.z = 5000
    end
    # if MINIMAP is turned on and minimap active
    if BlizzABS::Config::MINIMAP && $game_system.minimap > 0
      # create minimap
      @minimap = Minimap.new
    end
    # create sprite
    @choice = Sprite.new
    # create bitmap
    @choice.bitmap = $BlizzABS.cache.image('menu_arrow')
    @choice.angle = 180
    # set x, y and z positions
    @choice.x, @choice.y, @choice.z, @choice.opacity = 204, 448, 5001, 108
    # set x position offset
    @choice.ox = -8
    # set active flag
    @active = true
    # set index
    @index = 0
    # set up mode flag
    @up_mode = true
    # create modified skill window
    @skill_window = Window_Skill_Hotkey.new($game_player.battler)
    @skill_window.y -= 66
    @skill_window.height -= 70
    # create modified item window
    @item_window = Window_Item_Hotkey.new
    @item_window.y -= 66
    @item_window.height -= 70
    # set last active
    @last_active = true
    # transtition
    Graphics.transition
    # loop
    loop do
      # update game screen
      Graphics.update
      # update input
      Input.update
      # frame update
      update
      # stop if chosen an option
      break if $scene != self
    end
    # freeze screen
    Graphics.freeze
    # delete spriteset
    @spriteset.dispose
    # delete HUD elements that exist
    [@hud, @hotkeys, @minimap].each {|s| s.dispose if s != nil}
    # delete choice sprite
    @choice.dispose
    # delete skill window
    @skill_window.dispose
    # delete item window
    @item_window.dispose
    # delete viewport
    @view.dispose
    # while real leader is not first actor in party
    while @party_leader != $game_party.actors[0]
      # switch to next actor
      $BlizzABS.player.switch_leader
    end
  end
 
  def update_choice
    # set x position
    @choice.x = 204 + @index * 30
    # if pressed B
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # create map scene
      $scene = Scene_Map.new
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # not active
      @active = false
      # the one that was active the last time is now active
      @skill_window.active = @last_active
      @item_window.active = (!@last_active)
    # if RIGHT is being pressed
    elsif Input.repeat?(Input::RIGHT)
      # if RIGHT is pressed or index is less than 9
      if Input.trigger?(Input::RIGHT) || @index < 9
        # play sound
        $game_system.se_play($data_system.cursor_se)
        # set new index
        @index = (@index + 1) % 10
      end
    # if LEFT is being pressed
    elsif Input.repeat?(Input::LEFT)
      # if LEFT is pressed or index is equal or greater than 1
      if Input.trigger?(Input::LEFT) || @index >= 1
        # play sound
        $game_system.se_play($data_system.cursor_se)
        # set new index
        @index = (@index + 9) % 10
      end
    end
  end
 
end

class Map_Back < Sprite
 
  def initialize(map)
    super()
    self.x ,self.y, self.z = 474, 356, 4999
    self.bitmap = RPG::Cache.picture('HUD/'+Hud_Config::MapBack)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.bitmap.blt(0, 0, bitmap, src_rect)
    @map = map
  end
 
  def update
    self.opacity = @map.opacity
    if $game_system.minimap != 1
      self.visible = false
    end
  end
 
end

class Map_Name < Sprite
 
  def initialize(map)
    super()
    self.x ,self.y, self.z = 474, 456, 5001
    self.bitmap = Bitmap.new(120,32)
    self.bitmap.font.color = Color.new(255,255,255)
    self.bitmap.font.size = 16
    draw_map_name
    @map = map
  end
 
  def draw_map_name
    self.bitmap.clear
    @map_id = $game_map.map_id
    self.bitmap.draw_text_full(0,0, 160, 20, $map_infos[@map_id],1)
  end
 
  def update
    super
    self.opacity = @map.opacity
    if $game_system.minimap != 1
      self.visible = false
    end
    draw_map_name if @map_id != $game_map.map_id
  end
 
end

class Player_Name < Sprite
 
  def initialize(hud)
    super()
    self.x ,self.y, self.z = 123, 441, 5001
    self.bitmap = Bitmap.new(120,32)
    self.bitmap.font.color = Color.new(255,255,255)
    self.bitmap.font.size = 14
    @hud = hud
    draw_text
  end
 
  def draw_text
    self.bitmap.clear
    @actor = @hud.actor
    self.bitmap.font.color = Color.new(255, 255, 255)
    self.bitmap.draw_text_full(0,0, 120, 20, @actor.name)
  end
 
  def update
    super
    self.opacity = @hud.opacity
    draw_text if @actor != @hud.actor
  end
 
end

class Player_Lvl < Sprite
 
  def initialize(hud)
    super()
    self.x ,self.y, self.z = 123, 461, 5001
    self.bitmap = Bitmap.new(120,32)
    self.bitmap.font.color = Color.new(255,255,255)
    self.bitmap.font.size = 12
    @hud = hud
    draw_text
  end
 
  def draw_text
    self.bitmap.clear
    @level = @hud.actor.level
    self.bitmap.font.color = system_color
    self.bitmap.draw_text_full(0,0, 20, 20, 'LV')
    self.bitmap.font.color = normal_color
    self.bitmap.draw_text_full(15,0, 20, 20, @level.to_s,2)
  end
 
  def update
    super
    self.opacity = @hud.opacity
    draw_text if @level != @hud.actor.level
  end
 
end

class Party_Gold < Sprite
 
  def initialize(hud)
    super()
    self.x ,self.y, self.z = 336, 409, 5001
    self.bitmap = Bitmap.new(140,34)
    self.bitmap.font.size = 16
    @hud = hud
    draw_text
  end
 
  def draw_text
    self.bitmap.clear
    @gold = $game_party.gold
    self.bitmap.font.color = normal_color
    self.bitmap.draw_text_full(125,0, 20, 20, $data_system.words.gold)
    self.bitmap.font.color = Color.new(193,172,81)
    self.bitmap.draw_text_full(2,0, 120, 20,@gold.to_s,2)
  end
 
  def update
    super
    self.opacity = @hud.opacity
    draw_text if @gold != $game_party.gold
  end
 
end

class Party_ach < Sprite
 
  def initialize(hud)
    super()
    self.x ,self.y, self.z = 280, 409, 5001
    self.bitmap = Bitmap.new(180,34)
    self.bitmap.font.size = 16
    @hud = hud
    draw_text
  end
 
def draw_text
    self.bitmap.clear
    @ach = $game_variables[5]
    self.bitmap.font.color = normal_color
    icon = RPG::Cache.icon('AC') # Gets the icon graphic. If icon file is gold.png, then you would just put 'gold'
    self.bitmap.blt(117, -4, icon, Rect.new(0, 0, 24, 24)) # Draws the icon to the bitmap. Just need to put in your x and y values.
    #self.bitmap.draw_text_full(125,0, 20, 20, 'AC')
    self.bitmap.font.color = normal_color
    self.bitmap.draw_text_full(2,0, 120, 20,@ach.to_s,2)

  end
 
  def update
    super
    self.opacity = @hud.opacity
    draw_text if @ach != $game_variables[5]
  end
 
end

class Game_Actor < Game_Battler
 
  def cur_exp
    return (@exp - @exp_list[@level] > 0 ? @exp - @exp_list[@level] : 0)
  end
 
  def max_exp
    return (@exp_list[@level] - @exp_list[@level+1]).abs
  end
 
end

class Bitmap
 
  def picture_bar(x,y,r,image)
    empty_bar = RPG::Cache.picture('HUD/'+Hud_Config::EmptyExt+image)
    bar       = RPG::Cache.picture('HUD/'+image)
    h = bar.height
    w = bar.width
    self.blt(x,y,empty_bar,Rect.new(0,0,w,h))
    self.blt(x,y,bar,Rect.new(0,0,w*r,h))
  end

end