brainstorm
Member
Having Trouble with the code below... on this line:
@spriteset.battler(@nv4).setmove(@nv3.display_x - offset, @nv3.display_y + 1, @nv4.screen_z)
It's saying undefined method '-' for nilclass.... But offset and @spriteset.enemy_sprites[0].display_x are defined.... so what's the problem...
@spriteset.battler(@nv4).setmove(@nv3.display_x - offset, @nv3.display_y + 1, @nv4.screen_z)
It's saying undefined method '-' for nilclass.... But offset and @spriteset.enemy_sprites[0].display_x are defined.... so what's the problem...
Code:
@nv3 = @spriteset.enemy_sprites[0]
@nv4 = $game_troop.enemies[0]
if @nv3 != nil
@nv3 = @spriteset.enemy_sprites[0]
@nv4 = $game_troop.enemies[0]
offset = offset_value(@nv4)
if @spriteset.battler(@nv3) != nil
@nv3 = @spriteset.enemy_sprites[0]
@nv4 = $game_troop.enemies[0]
@battler = @nv4
@spriteset.battler(@nv4).setmove(@nv3.display_x - offset, @nv3.display_y + 1, @nv4.screen_z)
@spriteset.battler(@nv4).setmove(@nv3.display_x + offset, @nv3.display_y - 1, @nv4.screen_z)
@spriteset.battler(@nv4).setmove(@nv3.display_x + 1, @nv3.display_y - offset, @nv4.screen_z)
@spriteset.battler(@nv4).setmove(@nv3.display_x - 1, @nv3.display_y + offset2, @nv4.screen_z)
end
end