[RESOLVED] Problem with Explosive type items in Blizz-ABS

Started by Cody64, July 18, 2008, 12:29:47 am

Previous topic - Next topic

Cody64

I've been using Blizz-ABS for a while now and I absolutely love it.  However, I recently encountered a problem that has me stumped...  I created a "Grenade" item that causes the game to crash whenever I use it :S...  Here is the code that I have in my blizz-abs script for it (generated by the blizz-abs config)

 module Items
   
    def self.type(id)
      case id
      when 43 then return [0, 3.0] # Grenade : Shooting / Thrusting
      end
      return [2, 0.0]
    end
   
    def self.range(id)
      return 5.5
    end
   
  end


In the database, I have the "Scope" set to "One Enemy", the Occasion as "Always", and the Target Animation set to "Explosion 1" (the id is 099).  I have it set up to inflict 50 damage, and is a consumable item.

When I run my game, set the item to the hotkey, and press the item key; the game crashes and I get this error:

Script 'Sprite_Character' line 72: TypeError occurred.  no implicit conversion from nil to integer.

I'm not intirely sure what is wrong :S...  I don't know, maybe I've just been on the PC too long today, lol.  Anyhow, any help would be greatly appreciated :).

Thanks in advance, and keep up the great work on the awesome script  :up:

Aqua

Well, the problem is within the script 'Sprite_Character'

Please post that script up here or at least line 72 so we can help you solve the problem.

Nortos

Sprite_Character is just a default rmxp script

you haven't made any edits to it have you?

if not it's an error with abs.
Are you using any other custom scripts?

Aqua

Oh.  and do you have a character set that's named the same as the icon used for the grenade item?

Cody64

if @character.animation_id != 0
      animation = $data_animations[@character.animation_id]
      animation(animation, true)
      @character.animation_id = 0
    end


That's the code that's giving me the problem...  Line 72 is the 2nd line.  I have not made any edits to this...

To answer your other questions:

1.  Yes, I do have a charset of the same name.
2.  Yeah, I am using some other scripts...  I haven't gotten any errors with them when using projectile weapons, but I guess that doesn't mean that they're not causing a problem with exploding items...  I'll have to go and comment some out and see if that fixes the problem...

Btw, thanks for the speedy replies!  I'm not used to that in a forum, lol  :rockit:

Aqua

Oooh!

I know what's wrong...

when 43 then return [0, 3.0] # Grenade : Shooting / Thrusting


You need to define what animation for the explosion like

when 43 then return [0, 3.0, 99] # Grenade : Shooting / Thrusting

Cody64

Wow, I feel dumb now, lol.  That worked  :D!  Thanks for the help!  I used the Blizz-ABS config to generate that script, but it must not have added the explosion for some reason :S...

Once again, thanks for the help and double thanks for the speedy replies  :up:

Nortos

aha, good joob aqua
i didnt really read instructions just gave a quick reason why it might not be working lol

stupid school studying  :(