[XP] Blizz-ABS

Started by Blizzard, January 09, 2008, 08:21:56 am

Previous topic - Next topic

Galatea

Ok its working now.
thx aqua and blizz!  :haha:

ozoke

hiya,
this is a great script but im gettin an error randomly after using a skill
heres the error


and heres the section of code it refers to

        # if instant skill
        if ai.act[2] == SUMMON || ai.act[2] != SHOOT &&
            (skill.scope == 0 || skill.scope == 2 || skill.scope == 4 ||
            skill.scope == 6 || skill.scope == 7)
          # instant execution


im not using any other scripts that could confilct with BABS.
does any1 know why im gettin this error, if its a stupid mistake on my behalf sorry.

Satoh

What action are you taking immediately before the error appears?

It could simply be an undocumented error, or something that only happens when specific conditions are met...
Requesting Rule #1: BE SPECIFIC!!

Light a man a fire and he'll be warm for a night...
Light a man afire and he'll be warm for the rest of his life... ¬ ¬;

My Resources

ozoke

October 23, 2008, 12:03:12 pm #903 Last Edit: October 23, 2008, 12:09:14 pm by ozoke
nothing realy. i can play through a little test and not use a skill and its fine, but then if i use a skill, at some point after using it i get the error.

EDIT
it only happens when i change the skills in the database, im probably just editing the skills wrong. (new to rmxp)

Blizzard

October 23, 2008, 03:56:14 pm #904 Last Edit: October 23, 2008, 05:20:12 pm by Blizzard
You must be using an older version of Blizz-ABS since this seems to me as the bug I fixed a couple of versions before. Try upgrading to the most recent version frist.

EDIT:

If you are using Blizz-ABS v1.99, then Tons of Add-ons v6.6 and higher will not work properly! Put this code RIGHT BELOW PART 3 of Blizz-ABS to prevent a crash. Since Tons of Add-ons v6.6. and higher doesn't have Death Roulette anymore, Blizz-ABS v1.99 will not be able to use it.

Spoiler: ShowHide
module BlizzABS
 
  def self.skillitem_process(ch, object)
    case object
    when RPG::Skill
      skill, d, time = true, Skills.range(object.id), Skills.trap(object.id)
      type, charge = Skills.type(object.id), Skills.charge(object.id)
    when RPG::Item
      skill, d, time = false, Items.range(object.id), Items.trap(object.id)
      type, charge = Items.type(object.id), Items.charge(object.id)
    end
    charge[0] == 2 if ch.is_a?(Map_Enemy) && charge[0] == 3
    if charge[0] != 0 && !ch.charging?
      ch.setup_charge(object, charge)
      return false
    end
    return true if object.scope == 0
    if object.scope == 7
      if skill
        ch.skill_effect(ch, ch.battler, object)
        self.check_special_skills(ch.battler, [ch], object)
      else
        ch.item_effect(ch, object)
      end
      return true
    end
    d = 1 if d < 1
    case object.scope
    when 1 then enemy, dead, all = true, false, false
    when 2 then enemy, dead, all = true, false, true
    when 3 then enemy, dead, all = false, false, false
    when 4 then enemy, dead, all = false, false, true
    when 5 then enemy, dead, all = false, true, false
    when 6 then enemy, dead, all = false, true, true
    end
    target_all = death_roulette = false
    if $tons_version != nil && $tons_version >= 4.5 && skill
      if $tons_version >= 6.02 &&
          $game_system.TARGET_EM_ALL && FULL_TARGET_IDS.include?(object.id)
        target_all = all = true
      end
    end
    ai = ch.AI_data
    if ch.is_a?(Map_Actor)
      group = (((ch == $game_player || ch.restriction != 3) == enemy) ?
          ai.negative : ai.positive)
    else
      group = (((ch.restriction == 3) == enemy) ? ai.positive : ai.negative)
    end
    if ch == $game_player && (charge[0] == 0 || charge[0] != 0 &&
        !ch.charging?) && (target_all || type[0] == HOMING ||
        type[0] == DIRECT || type[0] == BEAM && all)
      handling = 0
    else
      handling = ((type[0] == SHOOT || type[0] == HOMING ||
          type[0] == TRAP) ? 1 : 2)
    end
    case handling
    when 0
      range = [ch.real_x/4+16, ch.real_y/4+16, d*32, 0]
      screen = Rect.new($game_map.display_x/4, $game_map.display_y/4, 640, 480)
      targets, other = [], []
      $scene.spriteset.character_sprites.each {|sprite|
          battler = sprite.character
          if battler.is_a?(Map_Battler) && !battler.is_a?(Map_Remote)
            self.set_target(battler, dead, group, type, all, target_all, screen,
                range, targets, other)
          end}
      available = $scene.spriteset.character_sprites.find_all {|sprite|
          targets.include?(sprite.character)}
      return false if available.size == 0
      available.sort {|a, b| b.y > a.y ? 1 : b.y < a.y ? -1 : (b.x <=> a.x)}
      $game_temp.select_data = [ch, object, other, available]
      return false
    when 1
      case type[0]
      when SHOOT
        if all
          projectype = (skill ? REMBreakSkill : REMBreakSkill)
        else
          projectype = (skill ? REMNormalSkill : REMNormalItem)
        end
        targets = [d]
      when HOMING
        range = [ch.real_x/4+16, ch.real_y/4+16, d*32, 0]
        targets, other = [], []
        screen = Rect.new($game_map.display_x/4, $game_map.display_y/4, 640, 480)
        ($game_map.battlers + BlizzABS.player.actors).each {|battler|
            self.set_target(battler, dead, group, type, all, target_all, screen,
                range, targets, other)}
        projectype = (skill ? REMInitSkill : REMInitItem)
      when TRAP
        targets, other = [], []
        projectype = (skill ? REMTrapSkill : REMTrapItem)
      end
    when 2
      if type[0] == DIRECT
        range = [ch.real_x/4+16, ch.real_y/4+16, d*32, 0]
      elsif !all
        range = case ch.direction
        when 2 then Rect.new(ch.real_x/4, ch.real_y/4+16, 32, d*32)
        when 4 then Rect.new(ch.real_x/4+16-d*32, ch.real_y/4, d*32, 32)
        when 6 then Rect.new(ch.real_x/4+16, ch.real_y/4, d*32, 32)
        when 8 then Rect.new(ch.real_x/4, ch.real_y/4+16-d*32, 32, d*32)
        end
        this = nil
        $scene.spriteset.character_sprites.each {|spr|
            if spr.character == ch
              this = spr
              break
            end}
        if this != nil
          sprite = Sprite.new($scene.spriteset.viewport1)
          begin
            sprite.bitmap = RPG::Cache.character(object.icon_name, 0)
            w1, h = sprite.bitmap.width, sprite.bitmap.height
          rescue
            w1, h = 24, d*32
            sprite.bitmap = Bitmap.new(w1, h)
            b = Cache.image(16)
            (0...h).each {|i|
                a = (i < h/2 ? i**2*2 : (h-i-1)**2*2)
                a = 255 if a > 255
                sprite.bitmap.blt(0, i, b, Rect.new(0, 0, b.width, b.height), a)}
          end
            w2 = case ch.direction
            when 6 then 16-w1/2
            else
              w1/2+16
            end
          case ch.direction
          when 2
            sprite.angle, sprite.ox = 0, w1/2
            sprite.x, sprite.y, sprite.z = this.x, this.y, this.z+1
          when 4
            sprite.angle, sprite.ox, sprite.oy = 270, w2, w1/2+16
            sprite.x, sprite.y, sprite.z = this.x-w1-16, this.y, this.z-1
          when 6
            sprite.angle, sprite.ox, sprite.oy = 90, -w2, -w1/2+16
            sprite.x, sprite.y, sprite.z = this.x+16, this.y, this.z-1
          when 8
            sprite.angle, sprite.ox, sprite.oy = 180, w1/2, h+16
            sprite.x, sprite.y, sprite.z = this.x, this.y-h-32, this.z-32
          end
          Cache.beams.push([sprite, 20])
          beam = true
        end
      end
      screen = Rect.new($game_map.display_x/4, $game_map.display_y/4, 640, 480)
      targets, other = [], []
      ($game_map.battlers + BlizzABS.player.actors).each {|battler|
          self.set_target(battler, dead, group, type, all, target_all, screen,
              range, targets, other)}
    end
    if targets.size == 0 && projectype != REMTrapSkill &&
        projectype != REMTrapItem
      return (beam == true)
    end
    if $full_reflection_system != nil && $full_reflection_system >= 3.0 &&
        targets[0].is_a?(Map_Battler) && skill && !beam && !death_roulette &&
        !BlizzCFG::BREAK_REFLECT.include?(object.id) &&
        projectype != REMTrapSkill && projectype != REMTrapItem
      BlizzCFG.reflection_effect_blizzabs(ch, targets, other, object)
    end
    targets = [targets[rand(targets.size)]] if !all && !beam || death_roulette
    if projectype != nil
      explode = (type[1] > 0 ? type[1, 2] : nil)
      if projectype == REMTrapSkill || projectype == REMTrapItem
        proj = Map_Trap.new(object.icon_name, ch, object.id, d, time,
            projectype, group, dead, explode)
        Cache.remotes.push(proj)
      else
        targets.each {|target|
            proj = Map_Projectile.new(object.icon_name, ch, object.id, target,
                projectype, group, dead, explode)
            Cache.remotes.push(proj)}
      end
    elsif skill
      targets.each {|target|
          dam = (target.battler.damage.is_a?(Numeric) ?
              target.battler.damage : 0)
          target.skill_effect(ch, ch.battler, object)
          target.battler.damage += dam if target.battler.damage.is_a?(Numeric)}
      self.check_special_skills(ch.battler, targets, object)
    else
      targets.each {|target| target.item_effect(ch, object)}
    end
    return true
  end
 
  def self.check_special_skills(battler, targets, skill)
    if $tons_version != nil && $tons_version >= 6.4
      if $game_system.ABSORB_HP_SP
        damages = 0
        if SKILL_IDS_HP.include?(skill.id)
          targets.each {|target|
              if target.battler.damage.is_a?(Numeric)
                damages += target.battler.damage
              end}
          battler.hp += damages
          battler.damage = -damages
        elsif SKILL_IDS_SP.include?(skill.id)
          targets.each {|target|
              if target.battler.damage.is_a?(Numeric)
                damages += target.battler.spdamage
                target.battler.damage = nil
                target.check_spdamage
              end}
          battler.sp += damages
        end
      end
      if $game_system.SP_DAMAGE_SKILL && SPKILL_IDS.include?(skill.id)
        targets.each {|target|
            if target.battler.damage.is_a?(Numeric)
              target.battler.damage = nil
              target.check_spdamage
            end}
      end
      battler.hp = 0 if $game_system.DESTRUCTOR_SKILL && battler.set_to_die
      if $game_system.BLUE_MAGIC_SKILL && BLUE_MAGIC_IDS.include?(skill.id)
        targets.each {|target| target.battler.damage = nil}
        target = targets[rand(targets.size)]
        if rand(100) < skill.hit
          if target.battler.is_a?(Game_Enemy)
            ids = []
            target.battler.actions.each {|act|
                ids.push(act.skill_id) if act.kind == 1}
          elsif target.battler.is_a?(Game_Actor)
            ids = target.battler.skills.clone
          end
          if ids.size > 0
            newskill = $data_skills[ids[rand(ids.size)]]
            if battler.skills.include?(newskill.id)
              target.battler.damage = "#{newskill.name} known"
            else
              target.battler.learn_skill(newskill.id)
              target.battler.damage = "#{newskill.name} learned"
            end
          else
            target.battler.damage = 'None available'
          end
        else
          target.battler.damage = 'Miss'
        end
      end
    end
  end
 
end

class Scene_Map
 
  def initialize_selection
    user, object, sprites = $game_temp.select_data[0, 2] + [$game_temp.select_data[3]]
    case object.scope
    when 1 then enemy, dead, all = true, false, false
    when 2 then enemy, dead, all = true, false, true
    when 3, 7 then enemy, dead, all = false, false, false
    when 4 then enemy, dead, all = false, false, true
    when 5 then enemy, dead, all = false, true, false
    when 6 then enemy, dead, all = false, true, true
    end
    if $tons_version != nil && object.is_a?(RPG::Skill) &&
        ($tons_version >= 6.02 && $game_system.TARGET_EM_ALL &&
        FULL_TARGET_IDS.include?(object.id))
      all = true
    end
    sprites.each {|sprite| sprite.z += 1000000}
    @index = 0
    Graphics.freeze
    tone = $game_screen.tone
    $scene.spriteset.viewport1.tone = Tone.new(tone.red-32, tone.green-32,
        tone.blue-32, tone.gray)
    $game_system.se_play($data_system.decision_se)
    @win = Window_Help.new
    @win.z, @win.opacity = 10000, 192
    r = BlizzABS::Skills.range(object.id)*32
    r = 32 if r < 32
    @ranges = [Sprite.new(@spriteset.viewport1),
               Sprite.new(@spriteset.viewport1)]
    @ranges[0].z = @ranges[1].z = 950000
    color = (object.scope < 3 ?
        Color.new(255, 0, 0, 96) : Color.new(0, 128, 255, 96))
    if BlizzABS::Skills.type(object.id)[0] == BlizzABS::BEAM && all
      @ranges[0].bitmap = Bitmap.new(640, 480)
      @ranges[1].bitmap = Bitmap.new(638, 478)
      @ranges[0].bitmap.fill_rect(0, 0, 640, 480, Color.new(255, 255, 0, 160))
      @ranges[0].bitmap.fill_rect(1, 1, 638, 478, Color.new(0, 0, 0, 0))
      @ranges[1].x = @ranges[1].y = 1
      @ranges[1].bitmap.fill_rect(0, 0, 638, 478, color)
    else
      @ranges[0].bitmap = Bitmap.new(r*2+32, r*2+32)
      @ranges[1].bitmap = Bitmap.new(r*2+32, r*2+32)
      @ranges[0].x, @ranges[0].y = user.screen_x, user.screen_y
      @ranges[1].x, @ranges[1].y = user.screen_x, user.screen_y
      @ranges[0].ox, @ranges[0].oy = r+16, r+32
      @ranges[1].ox, @ranges[1].oy = r+16, r+32
      @ranges[0].bitmap.draw_circle(0, 0, r.to_i+16, Color.new(255, 255, 0, 160))
      @ranges[0].bitmap.draw_circle(1, 1, r.to_i+15, Color.new(0, 0, 0, 0))
      @ranges[1].bitmap.draw_circle(1, 1, r.to_i+15, color)
    end
    if all
      sprites.each {|sprite| sprite.select = 1}
      @win.set_text('All', 1)
    else
      sprites[0].select = 1
      @win.set_text(sprites[0].character.battler.name, 1)
    end
    @ranges[1].color.set(255, 255, 0, (16-Graphics.frame_count%32).abs * 8)
    Graphics.transition
  end
 
  def process_selection
    case $game_temp.select_data[1].scope
    when 1 then enemy, dead, all = true, false, false
    when 2 then enemy, dead, all = true, false, true
    when 3, 7 then enemy, dead, all = false, false, false
    when 4 then enemy, dead, all = false, false, true
    when 5 then enemy, dead, all = false, true, false
    when 6 then enemy, dead, all = false, true, true
    end
    object, sprites = $game_temp.select_data[1], $game_temp.select_data[3]
    if $tons_version != nil && object.is_a?(RPG::Skill) &&
        ($tons_version >= 6.02 && $game_system.TARGET_EM_ALL &&
        FULL_TARGET_IDS.include?(object.id))
      all = true
    end
    @ranges[1].color.set(255, 255, 0, (16-Graphics.frame_count%32).abs * 8)
    sprites.each {|sprite| sprite.update_select}
    if !all
      @win.set_text(sprites[@index].character.battler.name, 1)
      if Input.repeat?(Input::LEFT) || Input.repeat?(Input::UP)
        $game_system.se_play($data_system.cursor_se)
        sprites[@index].select = 0
        @index = (@index+1) % sprites.size
        sprites[@index].select = 1
      elsif Input.repeat?(Input::RIGHT) || Input.repeat?(Input::DOWN)
        $game_system.se_play($data_system.cursor_se)
        sprites[@index].select = 0
        @index = (@index+sprites.size-1) % sprites.size
        sprites[@index].select = 1
      end
    end
    if Input.repeat?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      targets = false
    elsif Input.repeat?(Input::C)
      $game_system.se_play($data_system.decision_se)
      if all
        targets = []
        sprites.each {|sprite| targets.push(sprite.character)}
      else
        targets = [sprites[@index].character]
      end
    end
    return targets
  end
 
  def execute_selection(targets)
    Graphics.freeze
    $game_temp.select_data[3].each {|sprite|
        sprite.select = 0
        sprite.update_select
        sprite.z -= 1000000}
    $scene.spriteset.viewport1.tone = $game_screen.tone
    ch, object, other = $game_temp.select_data[0, 3]
    if targets != false
      case object
      when RPG::Skill
        skill = true
        type = BlizzABS::Skills.type(object.id)
        charge = BlizzABS::Skills.charge(object.id)
      when RPG::Item
        skill = false
        type = BlizzABS::Items.type(object.id)
        charge = BlizzABS::Items.charge(object.id)
      end
      if charge[0] == 0
        ch.set_usage_animation(object)
        if skill
          if $full_reflection_system != nil && $full_reflection_system >= 3.0 &&
              !BlizzCFG::BREAK_REFLECT.include?(object.id)
            BlizzCFG.reflection_effect_blizzabs(ch, targets, other, object)
          end
          if BlizzABS::Config::ACTOR_SKILL_SPRITES
            ch.setup_sprites("_skl#{object.id}")
          else
            ch.setup_sprites('_skl')
          end
          ch.set_action(ch.skill_penalty(object.id))
          ch.skill_consumption(object)
          projectype = BlizzABS::REMInitSkill
        else
          ch.setup_sprites('_itm')
          ch.set_action(ch.item_penalty(object.id))
          ch.item_consumption(object)
          projectype = BlizzABS::REMInitItem
        end
        ch.common_event_call(object)
        if type[0] == BlizzABS::HOMING
          explode = (type[1] > 0 ? type[1, 2] : nil)
          targets.each {|target|
              proj = Map_Projectile.new(object.icon_name, ch, object.id, target,
                  projectype, $game_player.AI_data.negative,
                  (object.scope == 5 || object.scope == 6), explode)
              BlizzABS::Cache.remotes.push(proj)}
        elsif skill
          targets.each {|target|
              dam = (target.battler.damage.is_a?(Numeric) ?
                  target.battler.damage : 0)
              target.skill_effect(ch, ch.battler, object)
              target.battler.damage += dam if target.battler.damage.is_a?(Numeric)}
          BlizzABS.check_special_skills(ch.battler, targets, object)
        else
          targets.each {|target| target.item_effect(ch, object)}
        end
      else
        ch.setup_charge(object, charge)
      end       
    end
    (@ranges + [@win]).each {|object| object.dispose}
    @ranges = @index = @tone = @win = $game_temp.select_data = nil
    Graphics.transition
  end
 
end
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Aqua

This is a question I'd ask on IRC, but it's down right now sooo...

Just to refresh my memory...

Would lots of dropped items on the map add to lag?

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ozoke

it was somet to do with the way i setup the skill, i reset the skills database and remade the skills and it works fine now.
as for the death roulette thing in tons 6.6 i just went through the roulette skill and deleted all the parts that said death and didnt get the problem for that any more. dont know if that will cause a problem with that skill if it was turned on but idont plan on using that one anyway.

thanks for the reply's though

Blizzard

Yeah, that's basically what I did in that patch, I removed the Death Roulette conditions.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Shadonking

iv added that extra bit under part 3 and the skills are working now but it lags really bad when there are more then three enemies on the screen and it also lags when using skills. will Blizz 2.0 have this problem? if not it doesnt matter about the lag.





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Blizzard

No, it won't since I will test everything properly.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ozoke

i found out what was causing me to get my error, just incase anybody else gets it it was cus of a mobs skill not mine. in the enemy databse i didnt notice that one of mobs had like a blank skill, the mob was trying to use it but it wasnt there.

Satoh

Lol I did that too with the amount of EXP given...
Requesting Rule #1: BE SPECIFIC!!

Light a man a fire and he'll be warm for a night...
Light a man afire and he'll be warm for the rest of his life... ¬ ¬;

My Resources

Vein Pyroclasm

Ok here's what i did.  I downloaded your sample game and just copied the added on scripts you had on it into my game.  Then when I went and downloaded the 1.99 ver, I simply highlighted everything in "(Blizz-ABS) DEMO CONFIG" and deleted it.  I then inserted parts 1,2, & 3 one after the other.

Did i do something wrong? Cause now i get some message after i try to start the game that says about line 4608: SystemStackError occured

Stack level too deep

Aqua

Um... get rid of ANY trace of the old version of Blizz-ABS from the sample game.

Only use the 3 parts from 1.99 and it should work fine.  (as long as the scripts are in the right order)

Vein Pyroclasm

October 26, 2008, 07:32:32 pm #915 Last Edit: October 26, 2008, 11:30:45 pm by Vein Pyroclasm
Quote from: Aqua on October 26, 2008, 07:12:21 pm
Um... get rid of ANY trace of the old version of Blizz-ABS from the sample game.

Only use the 3 parts from 1.99 and it should work fine.  (as long as the scripts are in the right order)


YAY that's what was wrong...OMG I'm like super happy now! Thank YOU!

I want to make my character able to switch from rod to gun or vice versa during battle, how do i do that?

And how do i go about making the gun shoot distant targets instead of me having to get close?

ozoke

using the config tool, go to the weapons option and change the range map squares to a higher figure than 1.5 for the weapon you want to increase the range for.

Blizzard

Also, for quick switching weapons on the map, you can get ANY script that does that (Blizz-ABS doesn't support it on the map). Blizz-ABS should work fine with it.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Vein Pyroclasm

Lol thanks and one last thing then i'll stop bugging yall lol.....but how do i make the sprites i've made for my character that show her holding a shield....I noticed when i push defend with Sir-Lag-A-Lot he holds up a shield, so i made a sprite of my char similar to that, but i don't know how to get it to show the sprite when i push block.

Blizzard

October 27, 2008, 03:07:18 pm #919 Last Edit: October 27, 2008, 03:09:23 pm by Blizzard
Name the defending spriteset the same as the original and add "_def" (without the double quotes) at the end. Also, turn on "Actor Action Sprites". This is all basically written in the manual.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.