UPDATE:
Version 1.0 stable has been publically released here: http://forum.cubers.net/thread-2277-post...l#pid46287 - The original script remains below for historical purposes.
For the past week or so I've been putting a lot of time into creating an achievements system in AssaultCube using only CubeScript. Therefore by nature it's slightly cludgy and has a few drawbacks ;), but I don't think that will stop anyone from having a bit of fun with it. I had a few ideals that I wanted to adhere to when making the script:
- It should encourage the use of all the different weapons, as well as encourage the playing of multiple game modes.
- It should be tough enough to provide a decent amount of gameplay time before being able to level up/complete the script.
- It should be easy enough to be beaten by everyone, newbies and "pros" alike within a reasonable timeframe, to avoid drawing redundant gameplay out.
- It should be simple, light and efficient (as far as CubeScript will allow).
I wasn't able to do everything I wanted to because of the last bit, therefore things like CTF/HTF/KTF/KTKF flags are all the same in the script's eyes. Adding that would add a rather large amount of lines to the script and there *is* a lot going on already! However, I do plan on continuing development of this script to add as much as feasibly possible, feature-wise - to it without breaking your client! But that'll only be in future versions assuming the tests go well.
As it sits, there are 15 achievements that you must unlock before you can move onto the next, higher, harder level. There is a 16th, "secret" achievement that is unlockable after a certain period of time. ;)
There are 3 levels, the first being the easiest (EASY), second being the norm (INTERMEDIATE), and the third being the hardest (HARD). In order to move onto the next difficulty EVERY achievement on that difficulty level must be unlocked. So you can't earn a higher level achievement without having gotten all of the lower ones first (encouraging gameplay). Once you have unlocked all of the achievements (15 total for each level) including the level 3's (HARD) achievements, you will see a message telling you that you beat the script, and a total number of enemies killed count since you first started working towards earning all the achievements. To replay the script (if you're trying to unlock/discover the secret achivement, replaying it *is* necessary) simply type:
[SELECT ALL] Code:
/reset_achievements
...restarting AC will also do the trick. To view your progress there is the "My Achievements" menu. To bind this menu to a key you MUST edit line 346 of the script. Change "KEY" to a valid key from keymap.cfg. For instance:
[SELECT ALL] Code:
bind RALT [showmenu "My Achievements"] // Binds the right ALT key to show the menu
[SELECT ALL] Code:
bind M [showmenu "My Achievements"] // Binds the M key to show the menu
If you don't do this you'll see an 'unknown key "KEY"' error when starting AC. The only end user idents (commands) for the script are:
[SELECT ALL] Code:
/reset_achievements - Resets your achievement progress.
/reset_all_achievements - Resets EVERYTHING, script completions counter, secret achievement progress, etc.
/show_killstreak_switch - Enables or disables the showing of killstreak messages upon every kill you get.
Questions, comments, feedback, etc. of any kind is very welcome! Please abide by the attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) license when modifying and/or redistributing.
Last but not least, the script:
[SELECT ALL] Code:
// achievements.cfg by DES|Bukz - version 1.0 beta - Last Update: February 10th, 2011
// An attempt to add an achievements system in AssaultCube via strictly CubeScript. Requires,
// tools.cfg, and saved.cfg to be writable for progress to be stored/saved between sessions.
// Includes a simple leveling system to make the achievements harder to obtain over-time.
// This script is licensed under the attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) license:
// http://creativecommons.org/licenses/by-nc-sa/3.0/
if (checkalias cur_achievement_level) [] [alias cur_achievement_level 1]
if (checkalias show_killstreak_switch) [] [alias show_killstreak_switch 0]
// Create alias lists for various loops throughout the script.
alias achievement_aliases_2 [fragged_achievement_stat gibbed_achievement_stat slashed_achievement_stat headshot_achievement_stat splattered_achievement_stat killstreak_achievement_stat akimbo_achievement_stat]
alias achievement_aliases_3 [gave_fragged_ gave_gibbed_ gave_slashed_ gave_headshot_ gave_splattered_]
alias achievement_aliases_4 [gave_ratio_ gave_flag_ gave_killstreak_ gave_akimbo_ gave_assault_ gave_sub_ gave_sniper_ gave_carbine_ gave_shotgun_ gave_usp_]
alias achievement_aliases_5 [assault_achievement_stat sub_achievement_stat sniper_achievement_stat carbine_achievement_stat shotgun_achievement_stat usp_achievement_stat kills_achievement_stat]
alias achievement_acts [fragged gibbed slashed headshot splattered]
alias other_achievements_list [ratio flag killstreak akimbo assault sub sniper carbine shotgun usp]
// The various achievement goal lists/tables.
// Frags, gibs, knives, headshots, splatters.
// [f g k h s]
alias level_1_achievements_list [3 2 2 2 3]
alias level_2_achievements_list [5 4 4 4 5]
alias level_3_achievements_list [8 6 6 6 8]
// Ratio, flags, killstreak, duals (akimbo), assault rifle, sub machine gun, precision (sniper), carbine, noob cannon (shotgun), usp (pistol).
// [ r f k d a s p c n u]
alias level_1_others_list [3.0 2 2 3 20 20 15 15 15 10]
alias level_2_others_list [5.0 4 4 6 50 50 30 30 30 20]
alias level_3_others_list [8.0 6 6 9 80 80 60 60 60 40]
// OT OT OT OT OT OT
// make_achievement_aliases - Creates various aliases used by the script only if they do not already exist.
alias make_achievement_aliases [
loop tmp_ach_loop 5 [
loop tmp_ach_loop_2 3 [
if (checkalias (format "%1%2" (at $achievement_aliases_3 $tmp_ach_loop) (+ $tmp_ach_loop_2 1))) [] [
alias (format "%1%2" (at $achievement_aliases_3 $tmp_ach_loop) (+ $tmp_ach_loop_2 1)) 0
]
]
]
loop tmp_ach_loop_3 (listlen $achievement_aliases_4) [
loop tmp_ach_loop_4 3 [
if (checkalias (format %1%2 (at $achievement_aliases_4 $tmp_ach_loop_3) (+ $tmp_ach_loop_4 1))) [] [
alias (format "%1%2" (at $achievement_aliases_4 $tmp_ach_loop_3) (+ $tmp_ach_loop_4 1)) 0
]
]
]
loop tmp_ach_loop_5 (listlen $achievement_aliases_5) [
if (checkalias (at $achievement_aliases_5 $tmp_ach_loop_5)) [] [
alias (at $achievement_aliases_5 $tmp_ach_loop_5) 0
]
]
loop tmp_ach_loop_6 5 [
if (checkalias (format "cur_%1_level" (at $achievement_acts $tmp_ach_loop_6)) (at (getalias (format "level_%1_achievements_list" $cur_achievement_level)) $tmp_ach_loop_6)) [] [
alias (format "cur_%1_level" (at $achievement_acts $tmp_ach_loop_6)) (at (getalias (format "level_%1_achievements_list" $cur_achievement_level)) $tmp_ach_loop_6)
]
]
loop tmp_ach_loop_7 (listlen $other_achievements_list) [
if (checkalias (format "cur_%1_level" (at $other_achievements_list $tmp_ach_loop_7)) (at (getalias (format "level_%1_others_list" $cur_achievement_level)) $tmp_ach_loop_7)) [] [
alias (format "cur_%1_level" (at $other_achievements_list $tmp_ach_loop_7)) (at (getalias (format "level_%1_others_list" $cur_achievement_level)) $tmp_ach_loop_7)
]
]
if (checkalias achievements_counter) [] [alias achievements_counter 0]
if (checkalias gave_achievements_comp) [] [alias gave_achievements_comp 0]
if (checkalias gave_pwned_bukz) [] [alias gave_pwned_bukz 0]
]
// reset_achievement_stats - Reset conline stat holders.
alias reset_achievement_stats [
loop tmp_ach_loop (listlen $achievement_aliases_2) [
alias (at $achievement_aliases_2 $tmp_ach_loop) 0
]
]
// reset_achievements - Reset all achievements progress.
alias reset_achievements [
reset_achievement_stats
alias cur_achievement_level 1
alias gave_achievements_comp 0
loop tmp_ach_loop 5 [
loop tmp_ach_loop_2 3 [
alias (format "%1%2" (at $achievement_aliases_3 $tmp_ach_loop) (+ $tmp_ach_loop_2 1)) 0
]
]
loop tmp_ach_loop_3 (listlen $achievement_aliases_4) [
loop tmp_ach_loop_4 3 [
alias (format "%1%2" (at $achievement_aliases_4 $tmp_ach_loop_3) (+ $tmp_ach_loop_4 1)) 0
]
]
loop tmp_ach_loop_5 (listlen $achievement_aliases_5) [
alias (at $achievement_aliases_5 $tmp_ach_loop_5) 0
]
set_achievement_levels
]
// reset_all_achievements - Resets everything, including secret achievement progress and script completions counter.
alias reset_all_achievements [
alias achievements_counter 0
alias gave_pwned_bukz 0
reset_achievement_stats
reset_achievements
]
// set_achievement_levels - Checks all achievements and sets the proper current level's goals.
alias set_achievement_levels [
loop tmp_ach_loop 5 [
alias (format "cur_%1_level" (at $achievement_acts $tmp_ach_loop)) (at (getalias (format "level_%1_achievements_list" $cur_achievement_level)) $tmp_ach_loop)
]
loop tmp_ach_loop_2 (listlen $other_achievements_list) [
alias (format "cur_%1_level" (at $other_achievements_list $tmp_ach_loop_2)) (at (getalias (format "level_%1_others_list" $cur_achievement_level)) $tmp_ach_loop_2)
]
]
// Execute script core aliases on every run.
make_achievement_aliases
reset_achievement_stats
set_achievement_levels
// get_achievement_stats - Collect stats from conline.
alias get_achievement_stats [
if $connected [
if (< $cur_achievement_level 4) [
loop tmp_ach_loop 5 [
if_conline_has (format "you %1" (at $achievement_acts $tmp_ach_loop)) but_not "teammate" [
if (strcmp (at $achievement_acts $tmp_ach_loop) fragged) [
if (= (curweapon) 1) [+= usp_achievement_stat 1] []
if (= (curweapon) 2) [+= carbine_achievement_stat 1] []
if (= (curweapon) 3) [+= shotgun_achievement_stat 1] []
if (= (curweapon) 4) [+= sub_achievement_stat 1] []
if (= (curweapon) 5) [+= sniper_achievement_stat 1] []
if (= (curweapon) 6) [+= assault_achievement_stat 1] []
if (= (curweapon) 9) [+= akimbo_achievement_stat 1] []
] []
if (strcmp (at $achievement_acts $tmp_ach_loop) slashed) [] [alias slashed_achievement_stat 0]
if (strcmp (at $achievement_acts $tmp_ach_loop) headshot) [+= sniper_achievement_stat 1] []
if (strcmp (at $achievement_acts $tmp_ach_loop) splattered) [+= shotgun_achievement_stat 1] []
+= (format "%1_achievement_stat" (at $achievement_acts $tmp_ach_loop)) 1
+= killstreak_achievement_stat 1
if $show_killstreak_switch [echo (c 3)Killstreak (c 0) $killstreak_achievement_stat] []
+= kills_achievement_stat 1
] []
]
if (alive) [] [
alias fragged_achievement_stat 0
alias gibbed_achievement_stat 0
alias headshot_achievement_stat 0
alias splattered_achievement_stat 0
alias killstreak_achievement_stat 0
alias akimbo_achievement_stat 0
]
] []
] []
]
// check_achievement_stats - Analyzes the stats that get_achievement_stats collects and awards the client with the
// proper achievement if it has been unlocked.
alias check_achievement_stats [
if $connected [
if (< $cur_achievement_level 4) [
loop tmp_ach_loop 5 [
if (&& (>= (getalias (format "%1_achievement_stat" (at $achievement_acts $tmp_ach_loop))) (getalias (format "cur_%1_level" (at $achievement_acts $tmp_ach_loop)))) (= (getalias (format "gave_%1_%2" (at $achievement_acts $tmp_ach_loop) $cur_achievement_level)) 0)) [
alias (format "gave_%1_%2" (at $achievement_acts $tmp_ach_loop) $cur_achievement_level) 1
give_achievement (at $achievement_acts $tmp_ach_loop)
] []
]
if (&& (>= (curratio (findcn $curname)) $cur_ratio_level) (= (getalias (format "gave_ratio_%1" $cur_achievement_level)) 0)) [
alias (format "gave_ratio_%1" $cur_achievement_level) 1
give_achievement ratio
] []
if (&& (>= (at (pstat_score (findcn $curname)) 0) $cur_flag_level) (= (getalias (format "gave_flag_%1" $cur_achievement_level)) 0)) [
alias (format "gave_flag_%1" $cur_achievement_level) 1
give_achievement flag
] []
if (&& (>= $killstreak_achievement_stat $cur_killstreak_level) (= (getalias (format "gave_killstreak_%1" $cur_achievement_level)) 0)) [
alias (format "gave_killstreak_%1" $cur_achievement_level) 1
give_achievement killstreak
] []
if (&& (>= $akimbo_achievement_stat $cur_akimbo_level) (= (getalias (format "gave_akimbo_%1" $cur_achievement_level)) 0)) [
alias (format "gave_akimbo_%1" $cur_achievement_level) 1
give_achievement akimbo
] []
if (&& (>= $assault_achievement_stat $cur_assault_level) (= (getalias (format "gave_assault_%1" $cur_achievement_level)) 0)) [
alias (format "gave_assault_%1" $cur_achievement_level) 1
give_achievement assault
alias assault_achievement_stat 0
] []
if (&& (>= $sub_achievement_stat $cur_sub_level) (= (getalias (format "gave_sub_%1" $cur_achievement_level)) 0)) [
alias (format "gave_sub_%1" $cur_achievement_level) 1
give_achievement sub
alias sub_achievement_stat 0
] []
if (&& (>= $sniper_achievement_stat $cur_sniper_level) (= (getalias (format "gave_sniper_%1" $cur_achievement_level)) 0)) [
alias (format "gave_sniper_%1" $cur_achievement_level) 1
give_achievement sniper
alias sniper_achievement_stat 0
] []
if (&& (>= $carbine_achievement_stat $cur_carbine_level) (= (getalias (format "gave_carbine_%1" $cur_achievement_level)) 0)) [
alias (format "gave_carbine_%1" $cur_achievement_level) 1
give_achievement carbine
alias carbine_achievement_stat 0
] []
if (&& (>= $shotgun_achievement_stat $cur_shotgun_level) (= (getalias (format "gave_shotgun_%1" $cur_achievement_level)) 0)) [
alias (format "gave_shotgun_%1" $cur_achievement_level) 1
give_achievement shotgun
alias shotgun_achievement_stat 0
] []
if (&& (>= $usp_achievement_stat $cur_usp_level) (= (getalias (format "gave_usp_%1" $cur_achievement_level)) 0)) [
alias (format "gave_usp_%1" $cur_achievement_level) 1
give_achievement usp
alias usp_achievement_stat 0
] []
] []
] []
]
// check_achievement_levels - Checks all achievements to see if all the current level's achievments have been
// been unlocked, if so, bumps the client up to the next level and updates the goals.
// Also serves as end script message for when the client finishes all the achievements.
alias check_achievement_levels [
if $connected [
if (< $cur_achievement_level 5) [
alias have_achievement_counter 0
loop tmp_ach_loop 5 [
if (= (getalias (format "gave_%1_%2" (at $achievement_acts $tmp_ach_loop) $cur_achievement_level)) 1) [+= have_achievement_counter 1] []
]
loop tmp_ach_loop_2 (listlen $other_achievements_list) [
if (= (getalias (format "gave_%1_%2" (at $other_achievements_list $tmp_ach_loop_2) $cur_achievement_level)) 1) [+= have_achievement_counter 1] []
]
if (= $have_achievement_counter 15) [
+= cur_achievement_level 1
if (&& (= $cur_achievement_level 4) (= $gave_achievements_comp 0)) [
alias gave_achievements_comp 1
+= achievements_counter 1
if (&& (>= $achievements_counter 3) (= $gave_pwned_bukz 0)) [
alias gave_pwned_bukz 1
echo (c 3)You unlocked secret achievement (c 1)Pwn Bukz! (c 2)Beat the achievements script (c 5)3 (c 2)or more times! (c 0)GG!
] []
echo (c 3) $kills_achievement_stat (c 2)noobs were killed during the making of this film. (c 5)";)"
echo (c 0)You completed the achievements script! (c 2)Use (c 5)/reset_achievements (c 2)to start over!
] [
if (< $cur_achievement_level 4) [
echo " " (c 0)*** (c 1)LEVEL UP (c 0)***
if (= $cur_achievement_level 2) [echo New difficulty: (c 2)INTERMEDIATE] [if (= $cur_achievement_level 3) [echo New difficulty: (c 3)HARD] []]
set_achievement_levels
] []
]
] []
] []
] []
]
// give_achievement - Prints pretty stuff on the console for the client when an achievement is unlocked.
alias give_achievement [
if (< $cur_achievement_level 4) [
if (strcmp $arg1 fragged) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Unstoppable! (c 2)Get (c 5) $cur_fragged_level (c 2)frags without dying!] []
if (strcmp $arg1 gibbed) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Grenadier! (c 2)Get (c 5) $cur_gibbed_level (c 2)grenade gibs without dying!] []
if (strcmp $arg1 slashed) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Knife Specialist! (c 2)Get (c 5) $cur_slashed_level (c 2)consecutive knife gibs!] []
if (strcmp $arg1 headshot) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Sharp Shooter! (c 2)Get (c 5) $cur_headshot_level (c 2)headshots without dying!] []
if (strcmp $arg1 splattered) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Noob Cannon! (c 2)Get (c 5) $cur_splattered_level (c 2)shotgun splatters without dying!] []
if (strcmp $arg1 ratio) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Ratio Whore! (c 2)Get a (c 5) $cur_ratio_level (c 2)or higher ratio!] []
if (strcmp $arg1 flag) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Flag Runner! (c 2)Get (c 5) $cur_flag_level (c 2)or more flags in a single round!] []
if (strcmp $arg1 killstreak) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Rampage! (c 2)Get a (c 5) $cur_killstreak_level (c 2)or higher kill streak without dying!] []
if (strcmp $arg1 akimbo) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Akimbo Madman! (c 2)Get (c 5) $cur_akimbo_level (c 2)or more kills with the akimbo without dying!] []
if (strcmp $arg1 assault) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)AR Marksman! (c 2)Get (c 5) $cur_assault_level (c 2)or more kills with the assault rifle overtime!] []
if (strcmp $arg1 sub) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)SMG Massacre! (c 2)Get (c 5) $cur_sub_level (c 2)or more kills with the sub machine gun overtime!] []
if (strcmp $arg1 sniper) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Pro Sniper! (c 2)Get (c 5) $cur_sniper_level (c 2)or more kills with the sniper rifle overtime!] []
if (strcmp $arg1 carbine) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Carbine Rage! (c 2)Get (c 5) $cur_carbine_level (c 2)or more kills with the carbine overtime!] []
if (strcmp $arg1 shotgun) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Shotgun Lunatic! (c 2)Get (c 5) $cur_shotgun_level (c 2)or more kills with the shotgun overtime!] []
if (strcmp $arg1 usp) [echo (c 3)You unlocked level (c 5) $cur_achievement_level (c 1)Pistol Whipper! (c 2)Get (c 5) $cur_usp_level (c 2)or more kills with the pistol overtime!] []
] []
]
// Various plugins to native aliases/conloop to ensure automation.
add2conloop [get_achievement_stats]
add2conloop [check_achievement_stats]
add2conloop [check_achievement_levels]
addcheck_msa [reset_achievement_stats]
// gen_achievement_alias_list - Returns a list of ALL aliases used by the script, except for saved.cfg session
// dependant aliases.
alias gen_achievement_alias_list [
alias achievement_aliases []
add2list achievement_aliases "achievement_acts achievement_aliases achievement_aliases_2 achievement_aliases_3 achievement_aliases_4 achievement_aliases_5 check_achievement_levels check_achievement_stats gen_achievement_alias_list get_achievement_stats give_achievement other_achievements_list have_achievement_counter make_achievement_aliases reset_achievements reset_achievement_stats set_achievement_levels"
loop tmp_ach_loop (listlen $achievement_aliases_2) [
add2list achievement_aliases (at $achievement_aliases_2 $tmp_ach_loop)
]
loop tmp_ach_loop_2 3 [
add2list achievement_aliases (format "level_%1_achievements_list" (+ $tmp_ach_loop_2 1))
add2list achievement_aliases (format "level_%1_others_list" (+ $tmp_ach_loop_2 1))
]
loop tmp_ach_loop_3 (listlen $achievement_acts) [
add2list achievement_aliases (format "cur_%1_level" (at $achievement_acts $tmp_ach_loop_3))
]
loop tmp_ach_loop_4 (listlen $other_achievements_list) [
add2list achievement_aliases (format "cur_%1_level" (at $other_achievements_list $tmp_ach_loop_4))
]
result $achievement_aliases
]
// Clear all the script's aliases on quit.
addlistonquit (gen_achievement_alias_list)
// A menu to keep track of progress.
newmenu [My Achievements]
menuitemvar [if (= $cur_achievement_level 1) [concat Current difficulty: (c 0)EASY] [if (= $cur_achievement_level 2) [concat Current difficulty: (c 2)INTERMEDIATE] [concat Current difficulty: (c 3)HARD]]]
menuitem [] -1
menuitemvar [if (|| (= (getalias (format "gave_fragged_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Unstoppable (c 5)- (c 2)Get (c 5) $cur_fragged_level (c 2)frags without dying!] [concat (c 1)Unstoppable (c 5)- (c 2)Get (c 5) $cur_fragged_level (c 2)frags without dying! (c 4) (concatword $fragged_achievement_stat / $cur_fragged_level)]]
menuitemvar [if (|| (= (getalias (format "gave_gibbed_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Grenadier (c 5)- (c 2)Get (c 5) $cur_gibbed_level (c 2)grenade gibs without dying!] [concat (c 1)Grenadier (c 5)- (c 2)Get (c 5) $cur_gibbed_level (c 2)grenade gibs without dying! (c 4) (concatword $gibbed_achievement_stat / $cur_gibbed_level)]]
menuitemvar [if (|| (= (getalias (format "gave_slashed_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Knife Specialist (c 5)- (c 2)Get (c 5) $cur_slashed_level (c 2)consecutive knife gibs!] [concat (c 1)Knife Specialist (c 5)- (c 2)Get (c 5) $cur_slashed_level (c 2)consecutive knife gibs! (c 4) (concatword $slashed_achievement_stat / $cur_slashed_level)]]
menuitemvar [if (|| (= (getalias (format "gave_headshot_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Sharp Shooter (c 5)- (c 2)Get (c 5) $cur_headshot_level (c 2)headshots without dying!] [concat (c 1)Sharp Shooter (c 5)- (c 2)Get (c 5) $cur_headshot_level (c 2)headshots without dying! (c 4) (concatword $headshot_achievement_stat / $cur_headshot_level)]]
menuitemvar [if (|| (= (getalias (format "gave_splattered_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Noob Cannon (c 5)- (c 2)Get (c 5) $cur_splattered_level (c 2)shotgun splatters without dying!] [concat (c 1)Noob Cannon (c 5)- (c 2)Get (c 5) $cur_splattered_level (c 2)shotgun splatters without dying! (c 4) (concatword $splattered_achievement_stat / $cur_splattered_level)]]
menuitemvar [if (|| (= (getalias (format "gave_ratio_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Ratio Whore (c 5)- (c 2)Get a (c 5) $cur_ratio_level (c 2)or higher ratio!] [concat (c 1)Ratio Whore (c 5)- (c 2)Get a (c 5) $cur_ratio_level (c 2)or higher ratio! (c 4) (concatword (curratio (findcn $curname)) / $cur_ratio_level)]]
menuitemvar [if (|| (= (getalias (format "gave_flag_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Flag Runner (c 5)- (c 2)Get (c 5) $cur_flag_level (c 2)or more flags in a single round!] [concat (c 1)Flag Runner (c 5)- (c 2)Get (c 5) $cur_flag_level (c 2)or more flags in a single round! (c 4) (concatword (at (pstat_score (findcn $curname)) 0) / $cur_flag_level)]]
menuitemvar [if (|| (= (getalias (format "gave_killstreak_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Rampage (c 5)- (c 2)Get a (c 5) $cur_killstreak_level (c 2)or higher kill streak without dying!] [concat (c 1)Rampage (c 5)- (c 2)Get a (c 5) $cur_killstreak_level (c 2)or higher kill streak without dying! (c 4) (concatword $killstreak_achievement_stat / $cur_killstreak_level)]]
menuitemvar [if (|| (= (getalias (format "gave_akimbo_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Akimbo Madman (c 5)- (c 2)Get (c 5) $cur_akimbo_level (c 2)or more kills with the akimbo without dying!] [concat (c 1)Akimbo Madman (c 5)- (c 2)Get (c 5) $cur_akimbo_level (c 2)or more kills with the akimbo without dying! (c 4) (concatword $akimbo_achievement_stat / $cur_akimbo_level)]]
menuitemvar [if (|| (= (getalias (format "gave_assault_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)AR Marksman (c 5)- (c 2)Get (c 5) $cur_assault_level (c 2)or more kills with the assault rifle overtime!] [concat (c 1)AR Marksman (c 5)- (c 2)Get (c 5) $cur_assault_level (c 2)or more kills with the assault rifle overtime! (c 4) (concatword $assault_achievement_stat / $cur_assault_level)]]
menuitemvar [if (|| (= (getalias (format "gave_sub_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)SMG Massacre (c 5)- (c 2)Get (c 5) $cur_sub_level (c 2)or more kills with the sub machine gun overtime!] [concat (c 1)SMG Massacre (c 5)- (c 2)Get (c 5) $cur_sub_level (c 2)or more kills with the sub machine gun overtime! (c 4) (concatword $sub_achievement_stat / $cur_sub_level)]]
menuitemvar [if (|| (= (getalias (format "gave_sniper_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Pro Sniper (c 5)- (c 2)Get (c 5) $cur_sniper_level (c 2)or more kills with the sniper rifle overtime!] [concat (c 1)Pro Sniper (c 5)- (c 2)Get (c 5) $cur_sniper_level (c 2)or more kills with the sniper rifle overtime! (c 4) (concatword $sniper_achievement_stat / $cur_sniper_level)]]
menuitemvar [if (|| (= (getalias (format "gave_carbine_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Carbine Rage (c 5)- (c 2)Get (c 5) $cur_carbine_level (c 2)or more kills with the carbine overtime!] [concat (c 1)Carbine Rage (c 5)- (c 2)Get (c 5) $cur_carbine_level (c 2)or more kills with the carbine overtime! (c 4) (concatword $carbine_achievement_stat / $cur_carbine_level)]]
menuitemvar [if (|| (= (getalias (format "gave_shotgun_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Shotgun Lunatic (c 5)- (c 2)Get (c 5) $cur_shotgun_level (c 2)or more kills with the shotgun overtime!] [concat (c 1)Shotgun Lunatic (c 5)- (c 2)Get (c 5) $cur_shotgun_level (c 2)or more kills with the shotgun overtime! (c 4) (concatword $shotgun_achievement_stat / $cur_shotgun_level)]]
menuitemvar [if (|| (= (getalias (format "gave_usp_%1" $cur_achievement_level)) 1) (>= $cur_achievement_level 4)) [concat (c 0)UNLOCKED (c 5)- (c 1)Pistol Whipper (c 5)- (c 2)Get (c 5) $cur_usp_level (c 2)or more kills with the pistol overtime!] [concat (c 1)Pistol Whipper (c 5)- (c 2)Get (c 5) $cur_usp_level (c 2)or more kills with the pistol overtime! (c 4) (concatword $usp_achievement_stat / $cur_usp_level)]]
menuitemvar [if (= $gave_pwned_bukz 1) [concat (c 0)UNLOCKED (c 5)- (c 1)Pwn Bukz (c 5)- (c 2)Beat the achievements script (c 5)3 (c 2)or more times!] []]
menuitem [] -1
menuitemvar [if (= $achievements_counter 0) [concat (c 4)You beat the achievements script (c 3) $achievements_counter (c 4)times.] [if (= $achievements_counter 1) [concat (c 4)You beat the achievements script (c 5) $achievements_counter (c 4)times.] [if (= $achievements_counter 2) [concat (c 4)You beat the achievements script (c 2) $achievements_counter (c 4)times.] [concat (c 4)You beat the achievements script (c 0) $achievements_counter (c 4)times.]]]]
menuitem [] -1
menuitemvar [concat (c 2)Killstreak settings] [showmenu "Achievements Killstreak Settings"]
menuitemvar [concat (c 3)Reset achievement progress] [showmenu "Confirm Achievements Reset"]
newmenu [Achievements Killstreak Settings]
menuitemslider [Show killstreak messages: ] 0 1 [$show_killstreak_switch] 1 ["no" "yes"] [show_killstreak_switch = $arg1]
menuitem [] -1
menuitemvar [concat (c 4)OK] [closemenu "Achievements Killstreak Settings"; sleep 0 [closemenu "My Achievements"]]
newmenu [Confirm Achievements Reset]
menuitemvar [concat (c 2)Are you sure you want to reset (c 3)ALL (c 2)of your achievements progress?]
menuitem [] -1
menuitemvar [concat (c 0)Yes] [reset_achievements; closemenu "Confirm Achievements Reset"; sleep 0 [showmenu "My Achievements"]]
menuitemvar [concat (c 3)No] [closemenu "Confirm Achievements Reset"; sleep 0 [closemenu "My Achievements"]]
// Achievements menu bind.
bind KEY [showmenu "My Achievements"]
docsection [Achievements];
docident [reset_achievements] [Resets ALL of your achievements progress!];
docident [show_killstreak_switch] [Enables or disables the showing of killstreak messages on the console.];
docexample [/show_killstreak_switch = 1] [Enables the messages.];
docexample [/show_killstreak_switch = 0] [Disables the messages.];
docremark [If enabled, a message showing your current killstreak will show up on the console everytime you get a kill.];
Copy and paste the above code into a text file and save it as "achievements.cfg".
1) Move this file to your "/config/" folder in the root installation dir for AC. Add "exec config\achievements.cfg" to your autoexec.cfg file. Save and start AC, the script should be installed.
...OR...
2) Create a "scripts" folder in the root installation dir for AC. Move this file to the folder. Add "execdir scripts" to your autoexec.cfg file. Save and start AC, the script should be installed.
Note: If using method #2 during installation, you can put any .cfg files containing valid cubescript into the "scripts" folder you created to install future scripts quickly and easily. Any .cfg files in this folder will be automatically executed on startup. Also, the values used in the achievement goals lists/tables are entirely experimental! If they turn out to be too easy I will crank them up for the next release and vice-versa. Suggestions on better values are extremely welcomed! Please report any problems you may have or bugs you may find! This script requires the latest tools.cfg to function!
The script doesn't work during bot rounds, that would be too easy to get achievements IMO. If anyone really wants it to work in bot rounds I'll paste a revision to the script that allows it.
Also don't forget to change the bind so you can easily see your progress! Enjoy. :)