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 - shintashi

1
Quote from: KK20 on November 20, 2012, 08:36:02 pm
It's being called from the event you are copying and pasting. When you copy an event from one game and paste it into another, all of that event's data is copied, including the graphic filename that doesn't exist in your project. Even though it says "None" when you look at the graphic it's using, the event is still saved as "octopi_pc" in the variable character_name.

It has nothing to do with Blizz ABS or any scripts.


ahh! so it is copypasting information from the event image area.

any idea how i can install attack and action animations for my character? In the previous game, I created an event that checked if you had a weapon, and then depending on which direction you were facing it played one of four animations. it was semi glitchy but worked reliably. I would have preferred referencing a single 128x192 character graphic though.
2
I created a new game recently. I copied the Blizz ABS script from my previous game.

Now when I tried to create a new monster event, the new game calls to old game monster graphic files by name. For example,
Graphics/Characters/octopi_pc

But when I press CONTROL+F to search the script for the location of "octopi_pc" or "octopi" or "oct" or any variation of my old monster file name, the program does not return any instances in my script. It is as if it is pulling this information from thin air.

I remember doing something to load graphics into the game, besides creating a graphics file in the character folder. But I do not recall what it is that I did to do that, except that there is a lot of automatic code generation involved in Blizz ABS, which is actually making it harder to figure out what the line of code is, that is calling out to phantom graphic files.

If I copy paste an event from the old game, such as a spidercrab, even though it is only loaded as "/e[3]" or whatever, somehow, my new game with the copy pasted script knows it is a spidercrab graphics file. I want to know why it knows to look for an octopi or spidercrab or whatever monster I imported, since I must be directing it to a file somewhere where it knows them by name.
3
Quote from: KK20 on October 23, 2012, 07:08:44 pm
True, but I need the graphics for your project as well. If I have no graphics to work with, what can I possibly do?



here's the file. I cannot make any further progress with this system until the money display is functional.
http://www.sendspace.com/file/wqxjp6
4
the only thing I've got running in this system is the Blizz ABS with the Zelda HUD. Do you know where I can go to upload a demo?
5
this is what I've been able to get so far:


 #shintashi
 def draw_gold
   @gold = $game_party.gold
   b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
   @hotkey_sprite.bitmap.blt(0, 0, b1, Rect.new(0, 0, b1.width, b1.height))
   if @gold != 0
     bitmap = RPG::Cache.icon("crystal_icon")
     x, y = (b1.width - 24) / 2, (b1.height + 24) / 2
     @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
   end
   draw_my_gold
 end  
 
 
 def draw_my_gold
   self.bitmap.clear
   self.bitmap.font.color = normal_color
   self.bitmap.font.size = 20
  self.bitmap.draw_text(84, 68, 120, 32, $game_party.gold.to_s)
 end



the self.bitmap.clear is also clearing some icons i dont want cleared like hit points and spell points, but at least it updates the number. The Number itself appears in a tight zone and my attempts to change the location by more than 30-ish pixels along the X or Y coordinate results in the number being partially, or fully masked. The original destination I set was 48x 48y, just so I could find it, but attempts to set something like

  self.bitmap.draw_text(480, 100, 120, 32, $game_party.gold.to_s)

failed to display.
6
undefined method 'contents' for #<HUD:0x8f3a848>


What the heck? Since when can you not insert a self.contents.blah blah in XP? What's going on? I can't even state the font color without it exploding.


 def draw_gold
   @gold = $game_party.gold
   b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
   @hotkey_sprite.bitmap.blt(0, 0, b1, Rect.new(0, 0, b1.width, b1.height))
   if @gold != 0
     bitmap = RPG::Cache.icon("crystal_icon")
     x, y = (b1.width - 24) / 2, (b1.height + 24) / 2
     @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
   end
   
   self.contents.fill_rect(Rect.new(4, 32, 256, 32), Color.new(0, 0, 0, 0)) #crashes
    self.contents.font.color = normal_color #crashes
    self.contents.draw_text(x, y, 120, 32, $game_party.gold) #crashes
        
   
   
 end  



//insert expletives here//
7
Quote from: Ezel Berbier on October 19, 2012, 03:18:08 am
You didn't add your code to be called in the update method:
  alias update_zhud_later update
 def update
   update_sp_y if actor != nil
   draw_gold
   update_zhud_later
 end
If you can't even understand what you're doing, I'd advise throwing in comments for each line of code saying specifically what each thing should do. At least then I can understand the idea you have and point to you what should be done instead.


ah, that works much faster than taking damage for the update. Now if I can just figure out how to get some white text to display a number, like x99 or whatever. I'm going to try self.contents type stuff to see if I can get something on there.
8
Quote from: Ezel Berbier on October 19, 2012, 02:29:34 am
I can't guarantee anything as I have nothing to work with here. Add the draw_gold to the class Hud. In the Hud update method, put draw_gold in there. Change 'contents' to 'bitmap' in your code (contents is the name Window classes use).

You can play around with it after that.


This is what I've got so far as a rewrite:


 def draw_gold
   @gold = $game_party.gold
   b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
   @hotkey_sprite.bitmap.blt(0, 0, b1, Rect.new(0, 0, b1.width, b1.height))
   if @gold != 0
     bitmap = RPG::Cache.icon("crystal_icon")
     x, y = (b1.width - 24) / 2, (b1.height - 24) / 2
     @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
   end

 end  
 


but so far, i can't even get the crystal to appear.

here's the full zelda hud with my snippet

Spoiler: ShowHide

class Hud
 
 attr_reader :hotkey_sprite
 
 alias init_zhud_later initialize
 def initialize(viewport = nil)
   init_hotkey_sprite(viewport)
   init_zhud_later(viewport)
   self.x, self.y = 4, 4
   @hotkey_sprite.z = self.z
   if BlizzCFG::Z_HUD_BACKGROUND != ''
     @zhud_back = Sprite.new
     @zhud_back.bitmap = RPG::Cache.picture(BlizzCFG::Z_HUD_BACKGROUND)
     @zhud_back.z = self.z - 1
   end
 end
 
 alias create_positions_zhud_later create_positions
 def create_positions
   create_positions_zhud_later
   b1 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE)
   b2 = RPG::Cache.picture(BlizzCFG::Z_SP_FILE)
   if BlizzCFG::Z_HP_TILING
     w = b1.width * BlizzCFG::Z_HP_TILE_COLUMNS
   else
     w = b1.width
   end
   @hud_width = w if @hud_width < w
   if BlizzCFG::Z_SP_TILING
     w = b2.width * BlizzCFG::Z_SP_TILE_COLUMNS
   else
     w = b2.width
   end
   @hud_width = w if @hud_width < w
   @hud_height = BlizzCFG::Z_HUD_HEIGHT
   @hp_x, @hp_y, @sp_x, @sp_y = 0, 0, 0, b1.height + 4
   update_sp_y
   b = RPG::Cache.picture(BlizzCFG::Z_ITEM_BACK)
   @left_x = b.width
   @left_y = b.height
   @hot_x = b.width
 end
 
 def draw_basic
 end
 
 def draw_empty
 end
 
 #shintashi
 def draw_gold
   @gold = $game_party.gold
   b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
   @hotkey_sprite.bitmap.blt(0, 0, b1, Rect.new(0, 0, b1.width, b1.height))
   if @gold != 0
     bitmap = RPG::Cache.icon("crystal_icon")
     x, y = (b1.width - 24) / 2, (b1.height - 24) / 2
     @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
   end

 end  
 
 
 
 def draw_name
 end
 
 def draw_level
 end
 
 def draw_hp
   @hp, @maxhp = actor.hp, actor.maxhp
   rate = (@maxhp > 0 ? @hp.to_f / @maxhp : 0)
   b1 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE)
   b2 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE_EMPTY)
   if BlizzCFG::Z_HP_TILING
     tiles = @maxhp / BlizzCFG::Z_HP_PER_TILE
     rows = (tiles.to_f / BlizzCFG::Z_HP_TILE_COLUMNS).ceil
     w, h = b1.width, b1.height
     self.bitmap.fill_rect(@hp_x, @hp_y, w * BlizzCFG::Z_HP_TILE_COLUMNS,
         h * rows, Color.new(0, 0, 0, 0))
     full_tiles = (rate * tiles).to_i
     semi_full = ((rate * tiles != full_tiles) ? 1 : 0)
     (0...full_tiles).each {|i|
         x = @hp_x + (i % BlizzCFG::Z_HP_TILE_COLUMNS) * w
         y = @hp_y + (i / BlizzCFG::Z_HP_TILE_COLUMNS) * h
         self.bitmap.blt(x, y, b1, Rect.new(0, 0, w, h))}
     if semi_full > 0
       x = @hp_x + (full_tiles % BlizzCFG::Z_HP_TILE_COLUMNS) * w
       y = @hp_y + (full_tiles / BlizzCFG::Z_HP_TILE_COLUMNS) * h
       if BlizzCFG::Z_HP_FILL_UP
         h2 = ((1 - rate * tiles + full_tiles) * h).to_i
         self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h2))
         self.bitmap.blt(x, y + h2, b1, Rect.new(0, h2, w, h - h2))
       else
         w2 = ((rate * tiles - full_tiles) * w).to_i
         self.bitmap.blt(x, y, b1, Rect.new(0, 0, w2, h))
         self.bitmap.blt(x + w2, y, b2, Rect.new(w2, 0, w - w2, h))
       end
     end
     ((full_tiles + semi_full)...tiles).each {|i|
         x = @hp_x + (i % BlizzCFG::Z_HP_TILE_COLUMNS) * w
         y = @hp_y + (i / BlizzCFG::Z_HP_TILE_COLUMNS) * h
         self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h))}
   else
     w1 = (b1.width * rate).to_i
     w2 = b2.width - w1
     self.bitmap.fill_rect(@hp_x, @hp_y, b1.width, b1.height, Color.new(0, 0, 0, 0))
     self.bitmap.blt(@hp_x, @hp_y, b1, Rect.new(0, 0, w1, b1.height))
     self.bitmap.blt(@hp_x + w1, @hp_y, b2, Rect.new(w1, 0, w2, b2.height))
   end
   draw_sp
   draw_gold
 end
 
 def draw_sp
   @sp, @maxsp = actor.sp, actor.maxsp
   rate = (@maxsp > 0 ? @sp.to_f / @maxsp : 0)
   b1 = RPG::Cache.picture(BlizzCFG::Z_SP_FILE)
   b2 = RPG::Cache.picture(BlizzCFG::Z_SP_FILE_EMPTY)
   if BlizzCFG::Z_SP_TILING
     tiles = @maxsp / BlizzCFG::Z_SP_PER_TILE
     rows = (tiles.to_f / BlizzCFG::Z_SP_TILE_COLUMNS).ceil
     w, h = b1.width, b1.height
     self.bitmap.fill_rect(@sp_x, @sp_y, w * BlizzCFG::Z_SP_TILE_COLUMNS,
         h * rows, Color.new(0, 0, 0, 0))
     full_tiles = (rate * tiles).to_i
     semi_full = ((rate * tiles != full_tiles) ? 1 : 0)
     (0...full_tiles).each {|i|
         x = @sp_x + (i % BlizzCFG::Z_SP_TILE_COLUMNS) * w
         y = @sp_y + (i / BlizzCFG::Z_SP_TILE_COLUMNS) * h
         self.bitmap.blt(x, y, b1, Rect.new(0, 0, w, h))}
     if semi_full > 0
       x = @sp_x + (full_tiles % BlizzCFG::Z_SP_TILE_COLUMNS) * w
       y = @sp_y + (full_tiles / BlizzCFG::Z_SP_TILE_COLUMNS) * h
       if BlizzCFG::Z_SP_FILL_UP
         h2 = ((1 - rate * tiles + full_tiles) * h).to_i
         self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h2))
         self.bitmap.blt(x, y + h2, b1, Rect.new(0, h2, w, h - h2))
       else
         w2 = ((rate * tiles - full_tiles) * w).to_i
         self.bitmap.blt(x, y, b1, Rect.new(0, 0, w2, h))
         self.bitmap.blt(x + w2, y, b2, Rect.new(w2, 0, w - w2, h))
       end
     end
     ((full_tiles + semi_full)...tiles).each {|i|
         x = @sp_x + (i % BlizzCFG::Z_SP_TILE_COLUMNS) * w
         y = @sp_y + (i / BlizzCFG::Z_SP_TILE_COLUMNS) * h
         self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h))}
   else
     w1 = (b1.width * rate).to_i
     w2 = b2.width - w1
     self.bitmap.fill_rect(@sp_x, @sp_y, b1.width, b1.height, Color.new(0, 0, 0, 0))
     self.bitmap.blt(@sp_x, @sp_y, b1, Rect.new(0, 0, w1, b1.height))
     self.bitmap.blt(@sp_x + w1, @sp_y, b2, Rect.new(w1, 0, w2, b2.height))
   end
 end
 
 def draw_hskill
   @skill = actor.skill
   b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
   @hotkey_sprite.bitmap.blt(0, 0, b1, Rect.new(0, 0, b1.width, b1.height))
   if @skill != 0
     bitmap = RPG::Cache.icon($data_skills[@skill].icon_name)
     x, y = (b1.width - 24) / 2, (b1.height - 24) / 2
     @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
   end
   draw_lskill
 end
 
 def draw_lskill
   @hotkey_sprite.bitmap.fill_rect(0, @left_y + 4, @left_x, 16, Color.new(0, 0, 0, 0))
   @skills_left = get_skills_left
   if @skill != nil && @skill > 0
     if @skills_left >= 0
       if @skills_left == 0
         @hotkey_sprite.bitmap.font.color = Color.new(255, 0, 0)
       elsif @skills_left <= 5
         @hotkey_sprite.bitmap.font.color = Color.new(255, 255, 0)
       else
         @hotkey_sprite.bitmap.font.color = normal_color
       end
       @hotkey_sprite.bitmap.font.size -= 2
       @hotkey_sprite.bitmap.draw_text_full(0, @left_y, @left_x, 20, @skills_left.to_s, 1)
       @hotkey_sprite.bitmap.font.size += 2
     elsif @skills_left == -1
       @hotkey_sprite.bitmap.font.color = Color.new(0, 255, 0)
       @hotkey_sprite.bitmap.font.size += 4
       @hotkey_sprite.bitmap.draw_text_full(0, @left_y, @left_x, 20, '∞', 1)
       @hotkey_sprite.bitmap.font.size -= 4
     end
   end
 end
 
 
 def draw_hitem
   @item = actor.item
   b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   b2 = RPG::Cache.picture(BlizzCFG::Z_ITEM_BACK)
   x = b1.width + 4
   @hotkey_sprite.bitmap.fill_rect(x, 0, b2.width, b2.height, Color.new(0, 0, 0, 0))
   @hotkey_sprite.bitmap.blt(x, 0, b2, Rect.new(0, 0, b2.width, b2.height))
   if @item != 0
     bitmap = RPG::Cache.icon($data_items[@item].icon_name)
     x, y = b1.width + 4 + (b2.width - 24) / 2, (b2.height - 24) / 2
     @hotkey_sprite.bitmap.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
   end
   draw_litem
 end
 
 def draw_litem
   @items_left = $game_party.item_number(@item)
   @hotkey_sprite.bitmap.fill_rect(@left_x + 4, @left_y + 4, @left_x, 16, Color.new(0, 0, 0, 0))
   if @item != nil && @item > 0
     if $data_items[@item] != nil && !$data_items[@item].consumable
       @hotkey_sprite.bitmap.font.color = Color.new(0, 255, 0)
       @hotkey_sprite.bitmap.font.size += 4
       @hotkey_sprite.bitmap.draw_text_full(@left_x + 4, @left_y, @left_x, 20, '∞', 1)
       @hotkey_sprite.bitmap.font.size -= 4
     else
       if @items_left == 0
         @hotkey_sprite.bitmap.font.color = Color.new(255, 0, 0)
       elsif @items_left <= 10
         @hotkey_sprite.bitmap.font.color = Color.new(255, 255, 0)
       else
         @hotkey_sprite.bitmap.font.color = normal_color
       end
       @hotkey_sprite.bitmap.font.size -= 2
       @hotkey_sprite.bitmap.draw_text_full(@left_x + 4, @left_y, @left_x, 20, @items_left.to_s, 1)
       @hotkey_sprite.bitmap.font.size += 2
     end
   end
 end
 
 alias update_zhud_later update
 def update
   update_sp_y if actor != nil
   update_zhud_later
 end
 
 def update_sp_y
   return if !BlizzCFG::Z_HP_TILING
   b1 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE)
   tiles = actor.maxhp / BlizzCFG::Z_HP_PER_TILE
   @sp_y = (tiles.to_f / BlizzCFG::Z_HP_TILE_COLUMNS).ceil * b1.height
 end
 
 alias dispose_zhud_later dispose
 def dispose
   @hotkey_sprite.dispose if @hotkey_sprite != nil
   @hotkey_sprite = nil
   @zhud_back.dispose if @zhud_back != nil
   @zhud_back = nil
   dispose_zhud_later
 end
 
 def init_hotkey_sprite(viewport)
   b1 = RPG::Cache.picture(BlizzCFG::Z_ITEM_BACK)
   b2 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
   width = b1.width + b2.width
   @hotkey_sprite = Sprite.new(viewport)
   @hotkey_sprite.x = 632 - width
   @hotkey_sprite.y = 4
   @hotkey_sprite.bitmap = Bitmap.new(width + 4, b1.height + 24)
   @hotkey_sprite.bitmap.font.name = 'Arial'
   @hotkey_sprite.bitmap.font.size = 16
   @hotkey_sprite.bitmap.font.bold = true
 end
   
end

#==============================================================================
# Hotkey_Assignment
#==============================================================================

class Hotkey_Assignment
 
 def initialize(viewport = nil)
   super
   self.bitmap = Bitmap.new(32, 320)
   self.bitmap.font.bold = true
   self.bitmap.font.size -= 8
   self.bitmap.font.color = system_color
   self.x, self.y, self.z = 0, 160, 1100
   @skills = BlizzABS::Cache::EmptyKeys
   @items = BlizzABS::Cache::EmptyKeys
   update
 end
 
 def draw(index = nil)
   back = RPG::Cache.picture(BlizzCFG::Z_HOTKEYS_BACK)
   w, h = back.width, back.height
   ow, oh = (w - 24) / 2, (h - 24) / 2
   (index == nil ? BlizzABS::Cache::HotkeyRange : [index]).each {|i|
       if $game_player.skill_hotkeys[i%10] != 0
         object = $data_skills[$game_player.skill_hotkeys[i%10]]
       elsif $game_player.item_hotkeys[i%10] != 0
         object = $data_items[$game_player.item_hotkeys[i%10]]
       end
       if @items[i%10] != $game_player.item_hotkeys[i%10] ||
           @skills[i%10] != $game_player.skill_hotkeys[i%10]
         self.bitmap.fill_rect(0, h*(i-1), w, h, Color.new(0, 0, 0, 0))
         self.bitmap.blt(0, h*(i-1), back, Rect.new(0, 0, w, h))
         if object != nil
           bitmap = RPG::Cache.icon(object.icon_name)
           self.bitmap.blt(ow, h*(i-1)+oh, bitmap, Rect.new(0, 0, 24, 24))
         end
         self.bitmap.draw_text_full(0, h*(i-1)+10, w-2, 32, (i%10).to_s, 2)
       end}
   @items = $game_player.item_hotkeys.clone
   @skills = $game_player.skill_hotkeys.clone
 end
 
end

#==============================================================================
# Minimap
#==============================================================================

class Minimap
 
 alias update_zhud_later update
 def update(override = false)
   update_zhud_later(override)
   update_minimap_back
 end
 
 def update_minimap_back
   if $game_system.minimap == 1
     if @minimap_back == nil
       @minimap_back = Sprite.new
       @minimap_back.bitmap = RPG::Cache.picture(BlizzCFG::Z_MINIMAP_BACK)
       @minimap_back.x = self.vx - (@minimap_back.bitmap.width - self.vw) / 2
       @minimap_back.y = self.vy - (@minimap_back.bitmap.height - self.vh) / 2
       @minimap_back.z = self.z + 1
       @minimap_back.opacity = self.opacity
     end
   elsif @minimap_back != nil
     @minimap_back.dispose
     @minimap_back = nil
   end
 end
 
 alias opacity_is_zhud_later opacity=
 def opacity=(value)
   opacity_is_zhud_later(value)
   @minimap_back.opacity = value if @minimap_back != nil
 end
 
 alias dispose_zhud_later dispose
 def dispose
   dispose_zhud_later
   @minimap_back.dispose if @minimap_back != nil
   @minimap_back = nil
 end
 
end
 
#==============================================================================
# Scene_Map
#==============================================================================

class Scene_Map
 
 alias hud_update_zhud_later hud_update
 def hud_update
   hud_update_zhud_later
   if @hud != nil
     s = @hud.hotkey_sprite
     s.update
     if $game_player.screen_x < s.vx + s.vw + 16 &&
         $game_player.screen_y < s.vy + s.vh + 48 &&
         $game_player.screen_x > s.vx && $game_player.screen_y > s.vy
       s.opacity -= 25 if s.opacity > 80
     elsif s.opacity <= 255
       s.opacity += 25
     end
   end
 end
 
end

#==============================================================================
# Window_Skill_Hotkey
#==============================================================================

class Window_Skill_Hotkey < Window_Skill
 
 def initialize(actor)
   super
   @column_max = 1
   self.width, self.height = 288, 480
   self.x, self.y, self.z = 64, 64, 21000
   self.cursor_rect.empty
   self.active = false
   refresh
 end
 
 def draw_item(i)
   if @data[i] == nil
     self.contents.font.color = normal_color
     self.contents.draw_text(32, i*32, 204, 32, '<Remove>')
   else
     if @actor.skill_can_use?(@data[i].id)
       self.contents.font.color = normal_color
     else
       self.contents.font.color = disabled_color
     end
     self.contents.fill_rect(Rect.new(4, i*32, 256, 32), Color.new(0, 0, 0, 0))
     bitmap = RPG::Cache.icon(@data[i].icon_name)
     opacity = self.contents.font.color == normal_color ? 255 : 128
     self.contents.blt(4, 4+i*32, bitmap, Rect.new(0, 0, 24, 24), opacity)
     text = @data[i].name
     if @actor.skills.include?(@data[i].id) &&
         $tons_version != nil && $tons_version >= 3.7 &&
         TONS_OF_ADDONS::EQUAP_SKILLS && DISPLAY_AP_REQ
       aps = BlizzCFG.maxap(@data[i].id)
       text = "#{text} (#{@actor.ap(@data[i].id)}/#{aps})" if aps != 0
     end
     self.contents.draw_text(32, i*32, 204, 32, text)
     sp_cost = @data[i].sp_cost
     if $tons_version != nil && $tons_version >= 6.54 &&
         $game_system.SP_COST_MOD
       sp_cost = BlizzCFG.get_cost_mod(@actor.states, sp_cost)
     end
     self.contents.draw_text(204, i*32, 48, 32, sp_cost.to_s, 2)
   end
 end
 
end

#==============================================================================
# Window_Item_Hotkey
#==============================================================================

class Window_Item_Hotkey < Window_Item
 
 def initialize
   super
   @column_max = 1
   self.width, self.height = 288, 480
   self.x, self.y, self.z = 352, 64, 21000
   self.cursor_rect.empty
   self.active = false
   refresh
 end
 
 def draw_item(i)
   if @data[i] == nil
     self.contents.font.color = normal_color
     self.contents.draw_text(32, i*32, 212, 32, '<Remove>')
   else
     number = $game_party.item_number(@data[i].id)
     if $game_party.item_can_use?(@data[i].id)
       self.contents.font.color = normal_color
     else
       self.contents.font.color = disabled_color
     end
     self.contents.fill_rect(Rect.new(4, i*32, 256, 32), Color.new(0, 0, 0, 0))
     bitmap = RPG::Cache.icon(@data[i].icon_name)
     opacity = self.contents.font.color == normal_color ? 255 : 128
     self.contents.blt(4, 4+i*32, bitmap, Rect.new(0, 0, 24, 24), opacity)
     self.contents.draw_text(32, i*32, 212, 32, @data[i].name)
     self.contents.draw_text(212, i*32, 16, 32, ':', 1)
     self.contents.draw_text(228, i*32, 24, 32, number.to_s, 2)
   end
 end
 
end

#==============================================================================
# Scene_Hotkeys
#==============================================================================

class Scene_Hotkeys
 
 def main
   @spriteset = Spriteset_Map.new
   @view = Viewport.new(0, 0, 640, 480)
   @view.tone = @tone.clone
   @hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud
   if BlizzABS::Config::HOTKEYS
     @hotkeys = Hotkey_Assignment.new
     @hotkeys.z = 5000
   end
   if BlizzABS::Config::MINIMAP && $game_system.minimap > 0
     @minimap = Minimap.new
   end
   @choice = Sprite.new
   @choice.bitmap = $BlizzABS.cache.image('menu_arrow')
   @choice.x, @choice.y, @choice.z, @choice.opacity = 40, 192, 500, 128
   @choice.angle = 90
   @choice.ox = -8
   @active = true
   @index = 0
   @up_mode = true
   @skill_window = Window_Skill_Hotkey.new($game_player.battler)
   @item_window = Window_Item_Hotkey.new
   @last_active = true
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     break if $scene != self
   end
   Graphics.freeze
   @spriteset.dispose
   [@hud, @hotkeys, @minimap].each {|s| s.dispose if s != nil}
   @choice.dispose
   @skill_window.dispose
   @item_window.dispose
   @view.dispose
   while @party_leader != $game_party.actors[0]
     $BlizzABS.player.switch_leader
   end
 end
 
 def update
   @choice.update
   @skill_window.update
   @item_window.update
   @hotkeys.update if @hotkeys != nil
   @choice.oy += (@up_mode ? (@active ? 2 : 1) : (@active ? -2 : -1))
   @up_mode = (@up_mode ? (@choice.oy < 8) : (@choice.oy <= -8))
   if $game_system.select_button && Input.trigger?(Input::Select)
     $game_system.se_play($data_system.cursor_se)
     $BlizzABS.player.switch_leader
     @skill_window.switch_actor
     @hud.update if @hud != nil
     @hotkeys.update if @hotkeys != nil
   elsif @active
     @choice.oy = @choice.oy / 2 * 2
     update_choice
   elsif @skill_window.active
     update_skill
   elsif @item_window.active
     update_item
   end
 end
 
 def update_choice
   @choice.y = 192 + @index * 32
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Map.new
   elsif Input.trigger?(Input::C)
     $game_system.se_play($data_system.decision_se)
     @active = false
     @skill_window.active = @last_active
     @item_window.active = (!@last_active)
   elsif Input.repeat?(Input::DOWN)
     if Input.trigger?(Input::DOWN) || @index < 9
       $game_system.se_play($data_system.cursor_se)
       @index = (@index + 1) % 10
     end
   elsif Input.repeat?(Input::UP)
     if Input.trigger?(Input::UP) || @index >= 1
       $game_system.se_play($data_system.cursor_se)
       @index = (@index + 9) % 10
     end
   end
 end
 
end


my stuff appears on line 154-166 and again on line 218 "draw_gold" obviously I don't know what I am doing.

edit: this version actually does something!
when i take damage (my hit points change) it displays gems if I have any, but it doesn't display a number, as far as I can tell. Still, that's way better than nothing.
9
Quote from: Ezel Berbier on October 18, 2012, 11:13:14 pm
Quote from: shintashi on October 18, 2012, 09:24:32 pm
I'm trying to get something like "(icon) X 99" to display in the top right of my screen in the Blizz ABS battle system, and I have no idea how to do it successfully. I've tried placing the following -code- in strategic places in both the 3rd section of Blizz ABS (below the script for "draw_lskill"), and tried a similar tactic in the ZELDA HUD script, but could not get anything to appear at all.
Probably because the method isn't even getting called AT ALL? Just because you have the method in your game, that doesn't mean it's automatically going to run it. My recommendation is to put that method in Scene_Map and in the class's update call your method draw_gold.

Also, this
bitmap = RPG::Cache.icon($data_skills[50].icon_name)
is pretty bad practice. You use the name of the icon file, like so
bitmap = RPG::Cache.icon("035-Item04")


Also, welcome back. I take it you gave up on that Class-Actor-Skill hybrid that you had me working on for weeks?  :P


The uber program? I basically moved a year ago and my hard drive crashed.  The last bloated parts I worked on included the afterlife and Power Armor.

As to the current dilemma, I tried putting it in, but i keep getting no method errors with the self.contents commands.
10
Script Requests / Blizz ABS/Zelda HUD: Gold Display?
October 18, 2012, 09:24:32 pm
I'm trying to get something like "(icon) X 99" to display in the top right of my screen in the Blizz ABS battle system, and I have no idea how to do it successfully. I've tried placing the following


  def draw_gold
self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(124, 20, 124, 32, $game_party.gold.to_s, 2)
    self.contents.font.color = normal_color
    self.contents.draw_text(120, 20, 50, 32, "X", 2)
   
    b1 = RPG::Cache.picture(BlizzCFG::Z_SKILL_BACK)
    @hotkey_sprite.bitmap.fill_rect(0, 0, b1.width, b1.height, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon($data_skills[50].icon_name) #set icon to Crystal   
    @hotkey_sprite.bitmap.blt(112, 20, bitmap, Rect.new(0, 0, 24, 24))

end


in strategic places in both the 3rd section of Blizz ABS (below the script for "draw_lskill"), and tried a similar tactic in the ZELDA HUD script, but could not get anything to appear at all. I even created a crystal icon (crystal are my currency) and created a skill to store the icon to try to speed up the process, but I think I screwed up somewhere. I'm just trying to get a tiny icon, and some white text that says "X (gold total)"

So if you had 37 "crystals", it would have '(crystal icon) x 37" in the top right corner of the screen, and if you bought something, that number would update and go down. Standard 8 bit stuff.
11
that worked pretty good. Thanks!
12
Quote from: winkio on October 13, 2012, 10:01:36 pm
from section 4.1.2 of the manual:

Quote\g[ID] - different alignment group than the default primary enemy group (read Alignment Groups for more information)


You only need to make them enemies with different alignment groups if you want them destroyed, or to react to attacks (torches that light on fire when hit with a fire spell, for example), other stuff like blocks to be pushed can be done without using any Blizz-ABS functionality.


I got as far as making an event rock object that just sat there, using
\e[4] rock \g[4]


but I still pass through it. What precisely must I do in Blizz ABS to NOT be able to walk through an event rock? The technique used in unmodified XP does not present the problem the Blizz ABS presents.
13
so I've been reading over the manual, and I get the impression if I want to create a non passable event, like a rock that is later destroyed or pushed out of the way, I have to first create some kind of event, but the event has to be alignment group #4: Objects, and considered lifeless, linked, and permanent. I cannot however locate the instructions to make this possible. Whereas setting an enemy is simple as saying
Goblin \e[1]
in the event title, or even
 \e[1]
there is nothing like
Rock \o[1]
to indicate objects that I can discern, nor do I know where objects like rocks or beer barrels might be stored. Are they enemies? items? characters? I have no idea.
14
Quote from: Zexion on October 10, 2012, 04:08:39 pm
I remember stuff like this used to happen to me. I'm not 100% sure, but did you delete your maps and re-make them after installing blizz-abs. (Again I'm not sure if you have to, but Idk why I have a feeling you should).


using stock maps for now, although I made a single hue shifted "desert" map. The errors occur on default and imported maps.
15
I'm experiencing a couple of problems with 'through' aka collision detection with events.

First of all, when I create an event using a non passable tile map for it's icon, it becomes passable. For example, a non passable boulder can be walked through, whereas in the non-ABS default, an imported tile map event retains its original pass/non pass abilities.

Second, I tried making jumping spiders on my map, but the system crashed. Then I tried using this code:

$game_map.events[id].jump(x,y)

in response to this error:
Bliz_ABS3 line 1869: NoMethodError occured

undefined method 'jump_passable?" for #<Map_Enemy:0x8e66a8>

but this also crashed. Finally I took out any of the programmed movements and just set "approach" as default. My event was on water, and could not move, regardless of what I had set for pass/through. The event functioned normally on land with regard to moving at random or approach. Custom crashes immediately with any kind of jump.

When I tried using a passable event on top of a non passable terrain (a common technique in default for making bridges and tunnels) I could not pass through.

I feel like this pass/no pass, through, and jump, are all related to the same or similar glitches in the movement/through section of ABS events.




16
Quote from: shintashi on October 08, 2012, 05:12:22 pm
Quote from: gameus on October 07, 2012, 01:23:41 am
It's called Z-Hud.
http://forum.chaos-project.com/index.php/topic,4284.0.html


i installed it and created icons, reset my hit points to discretionary blocks of 100 (300hp = 3 hearts), and all that works,
but is there a way to set it up so the hit point containers themselves drain from right to left, instead of top to bottom?

I tried messing with the parameters below, but only got a bunch of different kinds of mess.
Spoiler: ShowHide


  def draw_hp
    @hp, @maxhp = actor.hp, actor.maxhp
    rate = (@maxhp > 0 ? @hp.to_f / @maxhp : 0)
    b1 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE)
    b2 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE_EMPTY)
    if BlizzCFG::Z_HP_TILING
      tiles = @maxhp / BlizzCFG::Z_HP_PER_TILE
      rows = (tiles.to_f / BlizzCFG::Z_HP_TILE_COLUMNS).ceil
      w, h = b1.width, b1.height
      self.bitmap.fill_rect(@hp_x, @hp_y, w * BlizzCFG::Z_HP_TILE_COLUMNS,
          h * rows, Color.new(0, 0, 0, 0))
      full_tiles = (rate * tiles).to_i
      semi_full = ((rate * tiles != full_tiles) ? 1 : 0)
      (0...full_tiles).each {|i|
          x = @hp_x + (i % BlizzCFG::Z_HP_TILE_COLUMNS) * w
          y = @hp_y + (i / BlizzCFG::Z_HP_TILE_COLUMNS) * h
          self.bitmap.blt(x, y, b1, Rect.new(0, 0, w, h))}
      if semi_full > 0
        x = @hp_x + (full_tiles % BlizzCFG::Z_HP_TILE_COLUMNS) * w
        y = @hp_y + (full_tiles / BlizzCFG::Z_HP_TILE_COLUMNS) * h
        if BlizzCFG::Z_HP_FILL_UP
          h2 = ((1 - rate * tiles + full_tiles) * h).to_i
          self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h2))
          self.bitmap.blt(x, y + h2, b1, Rect.new(0, h2, w, h - h2))
        else
          w2 = ((rate * tiles - full_tiles) * w).to_i
          self.bitmap.blt(x, y, b1, Rect.new(0, 0, w2, h))
          self.bitmap.blt(x + w2, y, b2, Rect.new(w2, 0, w - w2, h))
        end
      end
      ((full_tiles + semi_full)...tiles).each {|i|
          x = @hp_x + (i % BlizzCFG::Z_HP_TILE_COLUMNS) * w
          y = @hp_y + (i / BlizzCFG::Z_HP_TILE_COLUMNS) * h
          self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h))}
    else
      w1 = (b1.width * rate).to_i
      w2 = b2.width - w1
      self.bitmap.fill_rect(@hp_x, @hp_y, b1.width, b1.height, Color.new(0, 0, 0, 0))
      self.bitmap.blt(@hp_x, @hp_y, b1, Rect.new(0, 0, w1, b1.height))
      self.bitmap.blt(@hp_x + w1, @hp_y, b2, Rect.new(w1, 0, w2, b2.height))
    end
    draw_sp
  end





never mind, if i set 'tile fill up" to false, it fills sideways like I wanted :)
17
Quote from: gameus on October 07, 2012, 01:23:41 am
It's called Z-Hud.
http://forum.chaos-project.com/index.php/topic,4284.0.html


i installed it and created icons, reset my hit points to discretionary blocks of 100 (300hp = 3 hearts), and all that works,
but is there a way to set it up so the hit point containers themselves drain from right to left, instead of top to bottom?

I tried messing with the parameters below, but only got a bunch of different kinds of mess.
Spoiler: ShowHide


  def draw_hp
    @hp, @maxhp = actor.hp, actor.maxhp
    rate = (@maxhp > 0 ? @hp.to_f / @maxhp : 0)
    b1 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE)
    b2 = RPG::Cache.picture(BlizzCFG::Z_HP_FILE_EMPTY)
    if BlizzCFG::Z_HP_TILING
      tiles = @maxhp / BlizzCFG::Z_HP_PER_TILE
      rows = (tiles.to_f / BlizzCFG::Z_HP_TILE_COLUMNS).ceil
      w, h = b1.width, b1.height
      self.bitmap.fill_rect(@hp_x, @hp_y, w * BlizzCFG::Z_HP_TILE_COLUMNS,
          h * rows, Color.new(0, 0, 0, 0))
      full_tiles = (rate * tiles).to_i
      semi_full = ((rate * tiles != full_tiles) ? 1 : 0)
      (0...full_tiles).each {|i|
          x = @hp_x + (i % BlizzCFG::Z_HP_TILE_COLUMNS) * w
          y = @hp_y + (i / BlizzCFG::Z_HP_TILE_COLUMNS) * h
          self.bitmap.blt(x, y, b1, Rect.new(0, 0, w, h))}
      if semi_full > 0
        x = @hp_x + (full_tiles % BlizzCFG::Z_HP_TILE_COLUMNS) * w
        y = @hp_y + (full_tiles / BlizzCFG::Z_HP_TILE_COLUMNS) * h
        if BlizzCFG::Z_HP_FILL_UP
          h2 = ((1 - rate * tiles + full_tiles) * h).to_i
          self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h2))
          self.bitmap.blt(x, y + h2, b1, Rect.new(0, h2, w, h - h2))
        else
          w2 = ((rate * tiles - full_tiles) * w).to_i
          self.bitmap.blt(x, y, b1, Rect.new(0, 0, w2, h))
          self.bitmap.blt(x + w2, y, b2, Rect.new(w2, 0, w - w2, h))
        end
      end
      ((full_tiles + semi_full)...tiles).each {|i|
          x = @hp_x + (i % BlizzCFG::Z_HP_TILE_COLUMNS) * w
          y = @hp_y + (i / BlizzCFG::Z_HP_TILE_COLUMNS) * h
          self.bitmap.blt(x, y, b2, Rect.new(0, 0, w, h))}
    else
      w1 = (b1.width * rate).to_i
      w2 = b2.width - w1
      self.bitmap.fill_rect(@hp_x, @hp_y, b1.width, b1.height, Color.new(0, 0, 0, 0))
      self.bitmap.blt(@hp_x, @hp_y, b1, Rect.new(0, 0, w1, b1.height))
      self.bitmap.blt(@hp_x + w1, @hp_y, b2, Rect.new(w1, 0, w2, b2.height))
    end
    draw_sp
  end


18
Script Requests / 8-16bit Zelda Hearts for Blizz ABS?
October 07, 2012, 12:32:49 am
Hi!

I want to be able to modify the ABS health display so it displays zelda style hearts in place of a standard life bar. I wanted to begin with 3 hearts, and have each heart represent approximately 100 hit points, with something like half a heart being 50 hit points. Basically, I want the computer to round to the nearest block of 50 and display half and whole hearts in red (healthy/fill) and pink (injured/unfilled). Every 50 hit points or fraction thereof would be another heart segment displayed, in rows of 10 hearts per 1000 hit points.

Each heart would be around 12-24 pixels wide/tall with minimal spacing so a full row of 10 might be 1/5th to 1/3rd of the screen width. It's been a while since I tried importing pictures, but it may be possible with draw tools and fill (I'm not proficient at this and never was good at programmed drawing).

I believe this code below is part of the section that would be amended:

Spoiler: ShowHide
#----------------------------------------------------------------------------
 # create_health_sprite
 #  Creates a health sprite.
 #----------------------------------------------------------------------------
 def create_health_sprite
   # if health bars active and observing enemy
   if BlizzABS::Config::ENEMY_HEALTH_BARS > 0 &&
       @character.is_a?(Map_Enemy) && !@character.hide_health &&
       @character.opacity > 0
     # create a sprite
     @health = Sprite.new(@viewport)
     # whether ENEMY_HEALTH_BARS_MATCH_WIDTH is active and tile graphic
     if @character.tile_id < 384 &&
         BlizzABS::Config::ENEMY_HEALTH_BARS_MATCH_WIDTH
       # set the width
       width = @sprite.bitmap.width / 4
     else
       # set the width to default
       width = 32
     end
     # x offset
     @health.ox = width / 2
     # create bitmap
     @health.bitmap = Bitmap.new(width, 6)
     # fill bitmap background for better display
     @health.bitmap.fill_rect(0, 0, width, 6, Color.new(0, 26, 0))
     # set health bar z coordinate
     @health.z = 1
     # set health bar opacity
     @health.opacity = BlizzABS::Config::ENEMY_HEALTH_BARS
   end
 end
 #----------------------------------------------------------------------------
 # update_health
 #  Handles health sprite updating.
 #----------------------------------------------------------------------------
 def update_health
   # move health sprite along with sprite
   @health.x = @sprite.x
   @health.y = @sprite.y - @sprite.oy - 6
   @health.z = @sprite.z + 1
   # if enemy HP have changed
   if @hp != @character.battler.hp || @battler_id != @character.battler_id
     # rate of filling
     rate = @character.battler.hp.to_f / @character.battler.maxhp
     # get empty bar bitmap
     bitmaps = [$BlizzABS.cache.image('empty_enemy_bar'),
         $BlizzABS.cache.image('enemy_bar')]
     # change hue of bar bitmap
     bitmaps[1].hue_change((rate / 0.8 - 1.25) * 120)
     # temporary variable
     width = @health.bitmap.width - 2
     # draw empty bar bitmap
     @health.bitmap.stretch_blt(Rect.new(1, 0, width, 6), bitmaps[0],
         Rect.new(0, 0, 1, 6))
     # draw bar bitmap
     @health.bitmap.stretch_blt(Rect.new(1, 0, rate * width, 6), bitmaps[1],
         Rect.new(0, 0, 1, 6))
     # store new values
     @hp, @battler_id = @character.battler.hp, @character.battler_id
   end
 end


19
RMXP Script Database / Re: [XP] Blizz-ABS
October 01, 2012, 12:45:17 am
i haven't messed with XP since last year, but I decided to try a Zelda style game and installed the Blizz ABS system, and I've been digging through the help files, trying to figure out how to get something like a status menu or character sheet to appear, kind of like in the original setup or something closer to a Zelda (8 bit) inventory menu + stats.

The interface is so different I'm not even sure where to begin. - I'm asking because I'm guessing there's already some menu display option with stats that 'pauses' the action, or something similar, and I just haven't been able to find it, or it's some kind of add on someone else already programmed and I just have to install it once I know what it is.
20
i finally figured out what i was doing wrong:

i was checking for a skill #0 in technique #0...x when I should have been checking for a skill #1 in technique #0.

EDIT:

spoke too soon:


 def maxhp
   vitality = x99(self.sta, endurance_check)
    n = [[vitality + @maxhp_plus, 1].max, 999999].min
   for i in @states
     n *= $data_states[i].maxhp_rate / 100.0
   end
   n = [[Integer(n), 1].max, 999999].min
   return n
 end


Can't get the part that says "@maxhp_plus" to work. I have copies in both game actor and battler 1.

EDIT
Spoiler: ShowHide
ok i fiddled with it some more and discovered the @maxhp_plus setting is working at initialization (i.e. when I set it to 100 my base hit points were all +100), but after initialization, the bonus does not change. this means at some point, the ability of maxhp_plus to be changed during play somehow disappeared in my rewrite.

edit:

so I've been tinkering some, and concluded I have no clue why it won't work. I tried @maxhp_plus as an attr_accessor and it still crashed.

I think this section:


 def maxhp=(maxhp)
   @maxhp_plus += maxhp - self.maxhp
   @maxhp_plus = [[@maxhp_plus, -9999].max, 9999].min
   @hp = [@hp, self.maxhp].min
 end


is probably what's preventing it from working. It's like when I switch from

this:

 def maxhp
   n = [[base_maxhp + @maxhp_plus, 1].max, 9999].min
   for i in @states
     n *= $data_states[i].maxhp_rate / 100.0
   end
   n = [[Integer(n), 1].max, 9999].min
   return n
 end


to this:


 def maxhp
   vitality = x99(self.sta, endurance_check)
    n = [[vitality + @maxhp_plus, 1].max, 999999].min
   for i in @states
     n *= $data_states[i].maxhp_rate / 100.0
   end
   n = [[Integer(n), 1].max, 999999].min
   return n
 end


only the changes to self.sta and endurance update. Put another way, when the program turns on, ALL THREE attributes:
1. self.sta [stamina]
2. endurance_check [endurance]
3. maxhp_plus

work fine. After the game starts, using things like events to change these attributes only works for:
1. self.sta [stamina]
2. endurance_check [endurance]

while
3. maxhp_plus

which is useful for things like spell buffs, remains whatever it is set to during initialization. I have no idea why these other attributes are able to change after initialization while maxhp_plus fails, since they are part of the same definition.




P.S.
 vitality = x99(self.sta, endurance_check)


just means :
 self.sta * (endurance_check + 2) 


EDIT:
Ok, I got it working. I think what I was doing was trying to use change HP instead of change Parameters> MaxHP. Which also threw me off because I hadn't done much eventing since last year. :facepalm:

"Modify" button, please.  - Zer0

Please don't double post within 24 hours - game_guy