Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] - [MatrixUtils] Simple Achievements List/Code

Author
Message
Mr909
6
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 13th Nov 2012 18:28
So, this is a very simple achievements list/structural code that might help someone else who wants some sort of achievements system in their game. For beginners, there is a fairly simple UDT to play with and some valuable WHILE-ENDWHILE code to look at (or at least I found it rather enlightening once I got it to work ), and for anyone else, hey, it's code you don't have to write.

Supports:
-Secret, "You see the name but not the details" achievements
-Hidden, "This achievement doesn't show until you earn it" achievements
-As well as your standard, you come, you see, you conquer achievements.

Up and down scroll, space gives you the achievement for debug testing. Notice you cannot see an achievement called "Sneaky Sneaky", although it exists. This is what a "Hidden" achievement would be like "Big Game Hunter" is the sample "Secret" achievement.

Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Nov 2012 20:10
Here's another method for loading your array with data that'll cut down on the number of lines of code.



"You're not going crazy. You're going sane in a crazy world!" ~Tick
Mr909
6
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 13th Nov 2012 20:51
Yeah. I was trying a similar method for the prompt code and I was suffering some issues. For anyone else reading the snippet, I provide a golden piece of advice for all your DBPro adventures:

DO WHAT PHAELAX DOES.


But yeah. I have been doing a lot with data, but I'm still shaky about it.

What do you think of my code, Phaelax? Any further criticisms?
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Nov 2012 16:44
My only other comment would be to be careful with the WHILE loop. If you had an entire list of hidden achievements, you'd get stuck in an endless loop.

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Mr909
6
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 14th Nov 2012 19:28
I thought of that. I don't imagine, though, unless the person running the code was TRYING to break it, that they'd ever create an achievements list with no achievements

Login to post a reply

Server time is: 2019-04-25 09:51:06
Your offset time is: 2019-04-25 09:51:06