Beta 62 Achievement Migration Issues

Some (possibly all) games are getting this error when they run the 62 database migration:

/home/ares/aresmush/game/config/page.yml. #<Thread:0x0000558bc6f100c0@/home/ares/.rvm/gems/ruby-2.6.3/gems/eventmachine-1.2.7/lib/eventmachine.rb:1067 run> terminated with exception (report_on_exception is true): Traceback (most recent call last):

If this happens, it just means that there was an error switching over your leveled achievements (scene_participation_10, scene_participation_20, etc.) to a single achievement (scene_participation with a count attached).

To fix it, just put this into the handle method of your tinker command and run tinker. FYI this will spam the game channel.

Character.all.each do |c|
          c.achievements.each do |achievement|
            if (achievement.name =~ /fs3_joined_combat_/)
              count = achievement.name.split('_').last.to_i
              Achievements.award_achievement(c, 'fs3_joined_combat', count)
              achievement.delete
            end

            if (achievement.name =~ /scene_participant_/)
              count = achievement.name.split('_').last.to_i
              if (count > 0)
                Achievements.award_achievement(c, 'scene_participant', count)
                achievement.delete
              end
            end
            
            if (achievement.name =~ /cookie_received_/)
              count = achievement.name.split('_').last.to_i
              Achievements.award_achievement(c, 'cookie_received', count)
              achievement.delete
            end
          end
        end

If you have any other leveled custom achievements, you can do the same thing for those.

2 Likes

Since there were some issues with the achievement migrations, it might be a good idea just to double-check your logs to make sure you’re not seeing errors like:

 2019-09-13 13:55:50 WARN - Achievement not found: word_count 

That indicates that the migration didn’t add the achievement to the config file. You can use the files in the game.distr folder for reference if you find something missing. Let me know if you have any questions.

Hrm. So I seem to be having this for the fs3skills. I have this in fs3skills_misc.yml:

  achievements:
    fs3_luck_spent:
      type: fs3
      message: Spent a luck point.
    fs3_roll:
      type: fs3
      message: Rolled a skill.

But I’m seeing WARN - Achievement not found: fs3_luck_spent and WARN - Achievement not found: fs3_roll in the error log.

No other error messages, and the other achievements seem to be working fine.

That’s strange. If you do config fs3skills/achievements with an admin in game do you see the config? Just making sure it got loaded properly.

+============================================================================+
Config Section: fs3skills/achievements

{
  "fs3_luck_spent": {
    "type": "fs3",
    "message": "Spent a luck point."
  },
  "fs3_roll": {
    "type": "fs3",
    "message": "Rolled a skill."
  }
}
+============================================================================+

It must have been in the logs for a while, but today’s the first day I sat down to fiddle with things in over a week.

So the config is there. Is the achievements method in fs3skills.rb there as well?

def self.achievements
  Global.read_config('fs3skills', 'achievements')
end

And does Global.read_config('fs3skills', 'achievements') return the same thing that the config command does?

1 Like

It was the fs3skills.rb that was missing it. I see what I did now.

My bad. Thank you! :slight_smile:

1 Like