-
Notifications
You must be signed in to change notification settings - Fork 11
Dumping Achievements for an Existing Game
-
Open the game in the emulator (this downloads the existing achievements and code notes from the server).
- Note the Game ID (or get it from the web site)
-
Select the
New Script
menu option in RATools, then enter theGame ID
and pressSearch
.- This will populate the specified file with all of the published (core) achievements for the game.
-
Select one or more achievements to dump (all will be selected initially)
-
On the right side of the window are a list of addresses referenced in the selected achievements.
- You can give any or all of them names. For each address associated to a name, a helper function will be generated
-
Press the
Create
button. This will generate a new script. -
From the File menu, select
Save
orSave Script As
. Enter a filename and hit Save. -
Select one of the achievements in the left-hand pane.
- This will show the individual conditions of the achievement and the code notes associated with them.
-
Click on the "Source" link just above the conditions.
- This will take you to the code that was generated for the achievement.
achievement( title = "Dominated Grass Land", description = "Clear every stage and minigame in World 1", points = 10, id = 4217, badge = "04848", published = "12/28/2013 4:49:25 AM", modified = "12/28/2013 5:26:10 AM", trigger = bit7(0x007D04) == 1 && bit7(0x007D08) == 1 && bit3(0x007D08) == 1 && bit7(0x007D0A) == 1 && bit5(0x007D0A) == 1 && bit5(0x007D0C) == 1 && bit0(0x007D04) == 1 && bit0(0x007D08) == 1 && bit1(0x007D06) == 1 && byte(0x000727) == 0 && repeated(20, word(0x007DFC) == 10800) && word(0x007DFC) == 3879 && byte(0x000079) == 0 && byte(0x000075) == 0 && never(byte(0x000727) != 0) )
The first 9
bit
checks are the completion flags. Thebyte
check is the world. Therepeated()
andword
check are to ensure the player spends some time on the end of world screen. The next twobyte
s are coordinate checks, and the finalnever
resets therepeated()
hitcount if the player is completing a world other than the first.For demonstration purposes, let's simply remove everything but the world check and level 1 complete check (or whatever you feel like removing from your test achievement):
achievement( title = "Dominated Grass Land", description = "Clear every stage and minigame in World 1", points = 10, id = 4217, badge = "04848", published = "12/28/2013 4:49:25 AM", modified = "12/28/2013 5:26:10 AM", trigger = bit7(0x007D04) == 1 && byte(0x000727) == 0 )
-
The hollow circle next to the achievement in the left pane will change to a half-filled circle. This indicates the generated achievement differs from the server achievement.
- If you view the achievement, you'll see a side-by-side diff comparing the core implementation to the generated one.
- The items on the left are were
Generated
. The items in the right are inCore
. You should see a bunch of stuff inCore
that isn't inGenerated
to reflect the requirements we removed. - You may see some half-filled circles for other achievements because the compiler eliminated some duplicate conditions or other small optimizations.
-
Right+click on the modified achievement and select
Update Local
. This will write the generated achievement to the "XXXX-User.txt" file, which the emulator uses forLocal Achievement
development. -
In the emulator, refresh the user achievements for the game. You can use the
Refresh from Disk
button or reload the game from theRecent
menu.- The achievement should show up as Modified in the achievements list.
- The other generated achievements will not appear in the
Local Achievements
list unless you alsoUpdate Local
for them.
-
Activate the achievement in
Local Achievements
and test it.- With our modifications, it should trigger after completing stage 1-1 (or whatever is appropriate based on the changes you made to your achievement). As this is a locally modified version of the achievement, you won't actually receive the points for completing it.
- If it is not behaving correctly, you can further modify the script, recompile it, update local, refresh the emulator, and try again. Repeat as many times as necessary.
-
Once you feel the changes are correct, you're ready to commit the changes to the server.
- NOTE: Do not upload the changes you've made to your test achievement. The achievement was presumably working correctly. The remaining steps are informational, and only apply if you're actually fixing a broken achievement!
- Unfortunately, RATools does not currently support writing the updated achievement directly to the server.
- This is actually preferred so we can do another round of testing before committing.