Chapter 3: Custom Achievements #
A lot of the code in the following tutorial comes from GD Surge by OmgRod (which parts of it come from other existing GD fangames like Lunar and Odyssey), so credit to the developers of these mods for writing this code!
A YouTube tutorial for this is coming very soon... 👀
Creating/Overriding Achievements #
Geometry Dash handles its achievements in the AchievementManager class. To create custom achievements, you may hook the following function:
1#include <Geode/Geode.hpp>2#include <Geode/modify/AchievementManager.hpp>34using namespace geode::prelude;56class $modify(MyAchievementManager, AchievementManager) {7 void addManualAchievements() {8 // PRACTICE MODE9 AchievementManager::addAchievement("geometry.ach.level01a", "[Achievement Name]", "Completed '[Level Name]' in Practice mode", "Complete '[Level Name]' in Practice mode", "[ICON UNLOCK]", 1);10 // NORMAL MODE11 AchievementManager::addAchievement("geometry.ach.level01b", "[Achievement Name]", "Completed '[Level Name]' in Normal mode", "Complete '[Level Name]' in Normal mode", "[ICON UNLOCK]", 1);12 // 3 COINS (OPTIONAL, explanation later)13 AchievementManager::addAchievement("geometry.ach.[myfangame].levelcoin01", "[Achievement Name]", "Collected all 3 Secret Coins on '[Level Name]'", "Collect all 3 Secret Coins on '[Level Name]'", "[ICON UNLOCK]", 1);1415 // VAULT CODES (OPTIONAL, explanation later)16 AchievementManager::addAchievement("geometry.ach.[myfangame].vault01", "[Achievement Name]", "Entered code '[Vault Code]' in The Vault", "A secret is required", "[ICON UNLOCK]", 0);1718 // ROBTOP ACHIEVEMENTS - REMOVE ANY YOU MAY NOT WANT IN-GAME19 AchievementManager::addAchievement("geometry.ach.demon01", "Reflex Champion", "Completed a Demon difficulty level in Normal mode", "Complete a Demon difficulty level in Normal mode", "icon_19", 1);20 AchievementManager::addAchievement("geometry.ach.coins01", "Coins?!", "Collected 5 Secret Coins", "Collect 5 Secret Coins", "icon_31", 1); // checked21 AchievementManager::addAchievement("geometry.ach.coins02", "Maybe behind that block?", "Collected 10 Secret Coins", "Collect 10 Secret Coins", "ball_02", 1);22 AchievementManager::addAchievement("geometry.ach.coins03", "I.. Need... MORE!", "Collected 15 Secret Coins", "Collect 15 Secret Coins", "color2_16", 1);23 AchievementManager::addAchievement("geometry.ach.coins04", "We wants it!", "Collected 20 Secret Coins", "Collect 20 Secret Coins", "ufo_03", 1);24 AchievementManager::addAchievement("geometry.ach.coins05", "We needs it!", "Collected 25 Secret Coins", "Collect 25 Secret Coins", "icon_32", 1);25 AchievementManager::addAchievement("geometry.ach.coins06", "Must have the precious", "Collected 30 Secret Coins", "Collect 30 Secret Coins", "color_15", 1);26 AchievementManager::addAchievement("geometry.ach.coins07", "They stole it from us!", "Collected 35 Secret Coins", "Collect 35 Secret Coins", "ball_04", 1);27 AchievementManager::addAchievement("geometry.ach.coins08", "Where is it?! Where is it?!", "Collected 40 Secret Coins", "Collect 40 Secret Coins", "icon_08", 1);28 AchievementManager::addAchievement("geometry.ach.jump01", "Bounce", "Jumped 1000 times", "Jump 1000 times", "color2_05", 0);29 AchievementManager::addAchievement("geometry.ach.jump02", "I like jumping", "Jumped 10000 times", "Jump 10000 times", "color2_11", 0);30 AchievementManager::addAchievement("geometry.ach.jump03", "You jump like a pro!", "Jumped 20000 times", "Jump 20000 times", "color2_12", 0);31 AchievementManager::addAchievement("geometry.ach.jump04", "Hop Hop Hop", "Jumped 50000 times", "Jump 50000 times", "ufo_05", 0);32 AchievementManager::addAchievement("geometry.ach.jump05", "Can't stop jumping!!!", "Jumped 100000 times", "Jump 100000 times", "ball_13", 0);33 AchievementManager::addAchievement("geometry.ach.jump06", "Jumper", "Jumped 200000 times", "Jump 200000 times", "color_56", 0);34 AchievementManager::addAchievement("geometry.ach.jump07", "You need to rest...", "Jumped 300000 times", "Jump 300000 times", "icon_371", 0);35 AchievementManager::addAchievement("geometry.ach.jump08", "Jumpman", "Jumped 400000 times", "Jump 400000 times", "dart_93", 0);36 AchievementManager::addAchievement("geometry.ach.jump09", "One hop this time!", "Jumped 500000 times", "Jump 500000 times", "icon_365", 0);37 AchievementManager::addAchievement("geometry.ach.jump10", "Leaps and bounds!", "Jumped 750000 times", "Jump 750000 times", "dart_45", 0);38 AchievementManager::addAchievement("geometry.ach.jump11", "Jump King", "Jumped 1000000 times", "Jump 1000000 times", "swing_32", 0);39 AchievementManager::addAchievement("geometry.ach.attempt01", "Trial and error", "Did 100 attempts", "Do 100 attempts", "color2_06", 0);40 AchievementManager::addAchievement("geometry.ach.attempt02", "Crash Tester", "Did 500 attempts", "Do 500 attempts", "color2_07", 0);41 AchievementManager::addAchievement("geometry.ach.attempt03", "You Shall Not Pass!", "Did 2000 attempts", "Do 2000 attempts", "color2_14", 0);42 AchievementManager::addAchievement("geometry.ach.attempt04", "Ouch...", "Did 10000 attempts", "Do 10000 attempts", "color2_17", 0);43 AchievementManager::addAchievement("geometry.ach.attempt05", "That hurts!", "Did 20000 attempts", "Do 20000 attempts", "dart_03", 0);44 AchievementManager::addAchievement("geometry.ach.attempt06", "Never Give Up", "Did 30000 attempts", "Do 30000 attempts", "icon_341", 0);45 AchievementManager::addAchievement("geometry.ach.attempt07", "Never Surrender", "Did 40000 attempts", "Do 40000 attempts", "color_96", 0);46 AchievementManager::addAchievement("geometry.ach.attempt08", "Mom said it's my turn", "Did 60000 attempts", "Do 60000 attempts", "ship_161", 0);47 AchievementManager::addAchievement("geometry.ach.attempt09", "If at first you don't succeed", "Did 80000 attempts", "Do 80000 attempts", "icon_407", 0);48 AchievementManager::addAchievement("geometry.ach.attempt10", "Stop Trying", "Did 100000 attempts", "Do 100000 attempts", "swing_09", 0);49 AchievementManager::addAchievement("geometry.ach.attempt11", "This could become a meme", "Did 135000 attempts", "Do 135000 attempts", "ball_117", 0);50 AchievementManager::addAchievement("geometry.ach.attempt12", "Take a break!", "Did 185000 attempts", "Do 185000 attempts", "ball_46", 0);51 AchievementManager::addAchievement("geometry.ach.attempt13", "Made an attempt", "Did 250000 attempts", "Do 250000 attempts", "ship_65", 0);52 AchievementManager::addAchievement("geometry.ach.attempt14", "This is the one", "Did 300000 attempts", "Do 300000 attempts", "icon_368", 0);53 AchievementManager::addAchievement("geometry.ach.youtube", "GeometryTube", "Subscribed to OmgRod on YouTube", "Subscribe to OmgRod on YouTube", "color2_20", 0);54 AchievementManager::addAchievement("geometry.ach.twitter", "Geometry Bird!", "Followed OmgRod on Twitter", "Follow OmgRod on Twitter", "color2_31", 0);55 AchievementManager::addAchievement("geometry.ach.facebook", "Number one fan!", "Attempted to like OmgRod on Facebook", "Attempt to like OmgRod on Facebook", "ball_41", 0);56 AchievementManager::addAchievement("geometry.ach.twitch", "Streaming Star!", "Followed OmgRod on Twitch", "Follow OmgRod on Twitch", "icon_149", 0);57 AchievementManager::addAchievement("geometry.ach.discord", "Join the Surge!", "Joined the OmgRod Discord server", "Join the OmgRod Discord server", "icon_150", 0);58 AchievementManager::addAchievement("geometry.ach.reddit", "Redditor!", "Joined the OmgRod subreddit", "Join the OmgRod subreddit", "icon_483", 0);59 AchievementManager::addAchievement("geometry.ach.special01", "So close", "Crashed at over 95% on a main level in normal mode", "Crash at over 95% on a main level in normal mode", "color2_18", 0);60 AchievementManager::addAchievement("geometry.ach.secret01", "Rampage!", "Destroyed a player", "A secret is required", "color2_19", 0);61 AchievementManager::addAchievement("geometry.ach.secret02", "Dominating!", "Destroyed 50 players", "A secret is required", "icon_41", 0);62 AchievementManager::addAchievement("geometry.ach.secret02b", "Ultrakill!", "Destroyed 100 players", "A secret is required", "color2_27", 0);63 AchievementManager::addAchievement("geometry.ach.secret03", "Godlike!", "Destroyed 200 players", "A secret is required", "icon_39", 0);64 AchievementManager::addAchievement("geometry.ach.secret03b", "Wickedsick!", "Destroyed 500 players", "A secret is required", "color2_21", 0);65 AchievementManager::addAchievement("geometry.ach.secret04", "Master Detective", "Found the hidden coin", "A hidden treasure is required", "color_71", 0);66 }67};
For each achievement, ensure you replace the following:
[Achievement Name]with your achievement's name (try make it short and fun)[Level Name]with your level's name[myfangame]with the name of your fangame (alphanumeric only), e.g.surge[ICON UNLOCK]with the icon you would like to unlock - way to type this is below
Icon Unlocks #
You can make your achievements award the user icons and colors. Below is a table that explains how icon names must be written:
| Type | Code Name | Example | Notes |
|---|---|---|---|
| Cube | icon | icon_01 | - |
| Ship | ship | ship_02 | - |
| Ball | ball | ball_03 | - |
| UFO | ufo | ufo_04 | May also be called bird. |
| Wave | wave | wave_05 | May also be called dart. |
| Robot | robot | robot_06 | - |
| Spider | spider | spider_07 | - |
| Swing(copter) | swing | swing_08 | - |
| Jetpack | jetpack | jetpack_09 | i think its jetpack but i still need confirmation on that. |
| Primary Color | color | color_10 | - |
| Secondary Color | color2 | color2_11 | - |
| Death Effect | death | death_12 | - |
| Special | special | special_13 | likely for misc stats like paths? im unsure |
| Ship Streak | shipstreak | shipstreak_14 | likely for misc stats like paths |
If these numbers pass 99, you may write them as 100, 101, 102... and the game will still know what icon you want to unlock.
We will look through how to register icons in a future tutorial.
