UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[TUT] Adding achievements to your map

broken avatar :(
Created 8 years ago
by BluntStuffy
0 Members and 1 Guest are viewing this topic.
6,912 views
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie

I wasn't sure if i should release this because this tutorial might look a bit complicated, and i'm not sure if people even want to add this to their maps.. But in the end it's really easy to use and i had it laying around anyways, so i decided to post this. Just read carefully step by step and i hope it's understandable. Adding your own achievements just takes 2 or 3 lines of code after you followed this tut!

This script will allow you to put achievements in your map, their stats will save between games. For example when you add an achievement: "Kill 100 zombies" and a player gets 75 kills, then dies and starts a new game and get 25 kills he will earn the achievement.
When a player unlocks an achievement a message shows up on screen, and you can choose to also have an icon appear, a sound play, and have points rewarded.

You can add your own achievements for your map pretty simple, anything like 'Kill X amount of zombies' or 'Kill a boss without jugg' or 'Open 50 doors' or whatever you want.
For now the player will just get the message on screen once, and it will be "unlocked". There's no menu to view your achievements or anything like that ( yet, might do it depending on if people actually use this.. )



1.
Lets get started, first download the files and put them in the correct folder. One goes into your \RAW\mp\ folder, and the other in your \MODS\mapname\maps\ folder.



2.
Open your _zombiemode.gsc and around line 60-70 you'll see similar line's, add this one:
         
Code Snippet
Plaintext
	maps\_blst_achievements::init();


3.
to include the stringtable-csv in your mod, add this line to the mod.csv in your mod-builder-tab on launcher;
   
Code Snippet
Plaintext
	stringtable,mp/my_achievements.csv


4.
if you want to use (custom) shaders for the achievement-notify's, add the materials to a .csv and make sure the images are included in your mod! They will be precached automaticly by the script, so no need to worry about that.


5.
Now how to setup you own achievements: note: i left two examples in the files so its easier to understand. You can just remove / change those as you wish.

First a short explanation to clear things up:
You can add multiple 'levels' for one achievement, for example you can add one for killing 10 zombies and then also one for killing 25 zombies.
Obviously those are 'the same' achievement( ...they are related to the same stat -> zombie kills ) so to tell the game they are the same stat but a different achievement you'll need to add two 'names' for each achievement you add. One is called the 'name' and the other the 'ref'!
 * The achievement NAME, wich should be the same for all achievements that relate to the same stat! So in the example above both could be named: kills_all
 * The achievement REF, wich should be different for all achievements! so in the example above it could be: kills_all_1 and kills_all_2
   
Make sure you pay attention to that, then adding achievements is going to be easy  :)


6.
Open the file you copied to raw\mp\ named: my_achievements.csv it basicly works the same as a soundalias. This just stores stuff like strings. You need to add every achievement you want to use in your map here.
this is an example of a line from that file:
Code Snippet
Plaintext
1,kills_all,kills_all_1,Kill 10 zombies,2105,10,250,specialty_juggernaut_zombies,

In the following order ( the bold text between the braces refers to the example line above )
   0.   Index    ( 1 )
   1.   Achievement NAME ( see explanation in the previous step )   ( kills_all )
   2.   Achievement REF ( see explanation in the previous step )    ( kills_all_1 )
   3.   Achievement description: The line that will show up on screen once the player unlocks the achievement, if you dont want a this fill in: none   ( Kill 10 zombies )
   4.   Stat number: ( 2105 ) THIS ONE IS IMPORTANT: there's a few rules to follow with these
      You make up the numbers yourself, but keep these rules:
      - start counting from 2100
      - increase by 5, so go from 2100 to 2105 to 2110 etc
      - each achievement that has the same achievement NAME should have the same stat number ( ...they are related to the same stat! )
   5.   The amount needed to complete this achievement, so in the example: Kill 10 zombies. The amount will be 10.    ( 10 )
   6.   If you want the players to recieve points for unlocking this achievement, add the amount of points here. Otherwise fill in: none  ( 250 )
   7.   If you want a shader to appear on screen for this achievement add it here ( the material name ). Otherwise fill in: none    ( specialty_juggernaut_zombies )
   


7.
Next open the _blst_achievements.gsc, at the top you'll see the line's to setup the achievements. If you want a sound to play when a player unlocks an achievement, change it in this line:

Code Snippet
Plaintext
level.achievement_sound = "none";

Next to tell the script wich achievements to add, copy this line once for every achievement you added, and edit it: Fill in the correct achievement REF for every achievement you want to add ( "kills_all_1" in the example below )

Code Snippet
Plaintext
	level.custom_achievements[level.custom_achievements.size] = "kills_all_1";


8.

That's everything to setup the script, but now comes the hard part. You need to make the game keep track of the achievements you added. For example if you add an achievement 'Use the mystery box 5 times' you need to edit the box-script, and make the game count the stats.
You can do that by adding the following line in a script:

Code Snippet
Plaintext
	self maps\_blst_achievements::add_to_my_stat( "use_box_5_times", 1 );

In this line 'self' is the player! You need to fill in the correct achievement NAME ( not ref! ). The '1' tells the game to add 1 to the stat. It will automaticly check for achievement-unlocks every time you use that line so no need to add anything else.
   
For some people this will be the hard part to figure out, i'll try to help out if needed in the topic below. In the download i allready made the 'zombie kills' achievement work, the one for opening doors does not work! It's just an example!! If you want to make that work, you need to add the line mentioned above in _zombiemode_blockers_new for each door/debris trigger.



Last thing, in the _blst_achievements.gsc there's one level. var at the top called: level.map_testing    If you set that to true, it will use prints to display your current stats so you can easily test stuff, and at game start you have the option to reset your stats.

Last Edit: May 12, 2016, 10:02:49 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Nice man. I love the idea of growing progress when you play. I'd like to be rewarded for continually playing a map, say better or upgraded starting pistol, or start with qr or jug, or something like that after 5000 kills or something. Maybe a perk you only get by getting the achievement like half price everything... or something that once you get it you use it every game like another player... Anyway, awesome job as always!

Maybe I'll add it and give an upgraded pistol to players at start for like 5000 or 10000 kills, or beating the map on hard or something...
Last Edit: April 28, 2016, 09:24:08 pm by MakeCents
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
Awesome tut man! I am sure I will find some good use for this in the future!
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Killer tut man! You're one of the best scripters on the forum hands down :)

Haha, if only that was true


Nice man. I love the idea of growing progress when you play. I'd like to be rewarded for continually playing a map, say better or upgraded starting pistol, or start with qr or jug, or something like that after 5000 kills or something. Maybe a perk you only get by getting the achievement like half price everything... or something that once you get it you use it every game like another player... Anyway, awesome job as always!

Maybe I'll add it and give an upgraded pistol to players at start for like 5000 or 10000 kills, or beating the map on hard or something...

Those are pretty sweet ideas, and way more rewarding for the players then just some points. Would be cool to have some of these achievements in a map!


Awesome tut man! I am sure I will find some good use for this in the future!
Thanks man, not sure if people will find this worth the trouble but if you make up some rewards like MC mentioned it's way cooler allready i suppose. Hope it comes in handy at some point  :)
broken avatar :(
×
broken avatar :(
OnionmanVere Bo21
Location: ieu dnt wnt 2 no
Date Registered: 27 September 2013
Last active: 1 year ago
Posts
1,864
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Mapper
My Groups
More
Personal Quote
ok
Signature
Aye mate you don't know me so y don't you shut tf up ok buddy :)

×
Scobalula's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Box Mappers Elite
Box Mappers Elite
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Scobalula's Contact & Social Links
hmmm this will be a very nice addition to my map.

Some ideas I have include possibly rewarding players for using a certain gun for x rouns, or x rounds over x round, like if the player keeps the Magnum over Round 20 and uses it for 5-10 rounds, it'll be their starting pistol from now on, and maybe getting x pick ups of Vulture Aid ammo rewards them with temporary infinite ammo or something like that.

This is definitely beast.
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
Some ideas I have include possibly rewarding players for using a certain gun for x rouns, or x rounds over x round, like if the player keeps the Magnum over Round 20 and uses it for 5-10 rounds, it'll be their starting pistol from now on, and maybe getting x pick ups of Vulture Aid ammo rewards them with temporary infinite ammo or something like that.

That sounds like a really cool idea.

There are so many possibilities people can do with these achievements
Last Edit: April 29, 2016, 09:48:03 pm by thezombiekilla6
broken avatar :(
×
broken avatar :(
Location: gbNewport
Date Registered: 2 November 2014
Last active: 2 years ago
Posts
1,265
Respect
Forum Rank
Zombie Colossus
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Embrace the Darkness
×
Tim Smith's Groups
Tim Smith's Contact & Social Linkstimsmith90THEREALBaDBoY17TimSmithMy clan Website
And here he's bluntstuffy. Helping the community as he can. Very good tut man. Gonna use that.
broken avatar :(
×
broken avatar :(
Location: usArizona
Date Registered: 12 September 2013
Last active: 4 years ago
Posts
28
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
aka Watch Me Lag on Steam.
×
meddle2k's Groups
meddle2k's Contact & Social LinksWatch Me LagMetalaxisMeddle2KMeddle2K
Thanks, probably going to use this in my map. Cool idea.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 24 May 2016
Last active: 3 years ago
Posts
32
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Strangers are just friends you haven’t met yet.
Signature
I don't post often but when I do I probably make myself seem like an idiot. Also, I don't need people to help me grow up! I drink milk.
×
Fancygamer1738's Contact & Social LinksH3X-4h3x_4H3X--4
Cool tut. Can't wait to see what I can do with this. ;)
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
great stuff man. ik the acheivements can be "saved" when restarting the map. But what about when you quit out of the game to the desktop, then reload waw/map. will they still remain?

Double Post Merge: April 13, 2021, 01:17:39 am

sorry to be a pain but do you think you could add a "remove_from_stat" func? and im not referring to the reset func. my stats will be fluctuating throughout the game so as you have already scripted a "add_to_stat" func, i need a "deduct_from_stat" func. :)

EDIT: nvm i realised i could deduct through the add func aha

EDIT2: great stuff for releasing this mod man you're a life saver!

EDIT3: This is what i managed to do with your mod - https://www.ugx-mods.com/forum/scripting/50/save-feature-for-custom-zombies/19658/msg165280#msg165280 :)
broken avatar :(
×
broken avatar :(
Location: ca
Date Registered: 29 December 2020
Last active: 3 weeks ago
Posts
9
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
DontGetSeen's Groups
DontGetSeen's Contact & Social Links
This is awesome man!! I decided to use this as a way to make a ranking/level up system in my map.
 
I basically just did
 
1,kills_all,kills_all_1,Rank 1,2105,50,250,specialty_juggernaut_zombies,
2,kills_all,kills_all_2,Rank 2,2110,150,500,specialty_juggernaut_zombies,
3,kills_all,kills_all_3,Rank 3,2115,275,500,specialty_juggernaut_zombies,
4,kills_all,kills_all_4,Rank 4,2120,400,500,specialty_juggernaut_zombies,
5,kills_all,kills_all_5,Rank 5,2125,700,500,specialty_juggernaut_zombies,
6,kills_all,kills_all_6,Rank 6,2130,1150,500,specialty_juggernaut_zombies,
 
etc. etc. etc. etc. etc..
 
I'll be changing the shaders to the WAW ranking icons/shaders of course. And i might edit the kills and stuff, gotta do some tweaking.
 
I also went into your script in *_blst_achievements.gsc* and changed the "Challenge complete" setText to "Rank up:" instead.
 
Now my map seems like it has an actual progression/ranking system that saves between games, i added it since some people enjoy playing with it because it adds a bit of replayability.:D
 
 
I'll be sure to credit you when i publish the map :)
 
 
 
Although, i wish it would show it some how on the hud what "rank" you are. Maybe i can find how to. and edit your script and do it:thumbsup-smiley:
 
 

 
Loading ...