Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

What's wrong with Spriteset_Battle?

Arcor

Member

For some reason it's randomly decided that it doesn't want to accept this block of code.

Code:
    @enemy_sprites = []
    for enemy in $game_troop.enemies.reverse
[COLOR=Red]      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))[/COLOR]
    end

the red line is the one it finds an error with. it says

"Wrong number of arguments (2 for 1)"

anyone help?

thanks in advance.
-Arcor
 

Arcor

Member

If you mean the "def initialize" bit then here it is.

Code:
  def initialize
    @viewport1 = Viewport.new(0, 0, 640, 320)
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport4 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 101
    @viewport3.z = 200
    @viewport4.z = 5000
    @battleback_sprite = Sprite.new(@viewport1)
    @enemy_sprites = []
    for enemy in $game_troop.enemies.reverse
      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
    end
    @actor_sprites = []
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @weather = RPG::Weather.new(@viewport1)
    @picture_sprites = []
    for i in 51..100
      @picture_sprites.push(Sprite_Picture.new(@viewport3,
        $game_screen.pictures[i]))
    end
    @timer_sprite = Sprite_Timer.new
    update
  end

I haven't edited it though, this just randomly happens :S
 

Arcor

Member

So it is, misread your post...

Code:
def initialize(viewport, battler = nil)
    super(viewport)
    @battler = battler
    @battler_visible = false
  end

i've recently installed Trickster's Multi-Attack script, and it seems i installed it wrongly, as in the Sprite_Battler class i only had an update and no initialize method. :S

Still not entirely sure on what's going off, because if i try replacing the default Sprite_Battler's update method with the one from Trickster, it doesn't display HP/SP or IP text, nor the actor's name. just trying a couple more things at the minute to fix that.

EDIT: Nope, can't seem to get the text to appear. even copying the scripts from the Multi-Attack demo.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top