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.

Geek Culture / Unlockables

Author
Message
Vental
14
Years of Service
User Offline
Joined: 25th Apr 2011
Location:
Posted: 26th Jul 2011 05:01
For a game that I'm making, is there any easy way with Dark Basic to create unlockable characters and items, etc.? If there is no easy way, could someone tell me the normal, only way to do it?
heyufool1
16
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 26th Jul 2011 05:08 Edited at: 26th Jul 2011 05:10
First of all this should be in the DBPro board, but I'll answer anyway.

Yes, it is possible. However, you are over thinking the problem. You seem to currently be in what I call the "game specific" state of mind, where you have to be in the programming state of mind. DBPro doesn't have a function that is like, "add unlockable". However, DBPro does support variables (obviously) so you simply create a boolean variable representing the unlockable and set it to false. Then when you want the unlockable unlocked you set the variable to true. I don't know the DBPro syntax so I'll put some pseudo code:

boolean specialGun = false

(This would be in the loop)
if specialGun = true
fire special bullet

In order to unlock the special gun, you would just set specialGun to true. Programming is about using variables and various structures to solve problems. You can't expect everything to be written for you already so if it isn't, use the language to solve the problem. Hopefully you understand what I mean.

"So hold your head up high and know. It's not the end of the road"
Switch Game Engine
Vental
14
Years of Service
User Offline
Joined: 25th Apr 2011
Location:
Posted: 26th Jul 2011 07:22
Yeah, but I still don't get at what time the item would be unlocked within the game. You know, like after doing a mission and such.
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 26th Jul 2011 07:31
...

So, are you wanting help with the code or the design of your game?


~Plystire

A rose is only a rose until it is held and cherished -- then it becomes a treasure.
Non Sequitur M
16
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 26th Jul 2011 07:38

Quote: "Yeah, but I still don't get at what time the item would be unlocked within the game."

Whenever you want.

Let's say they had to reach a hidden room. You would check to see if they were within the confines of said secret room. If so, then you'd set the SpecialGun variable to 1(or true).

So, in this example(all pseudo code), you would check to see where they were at:


It's easy to make unlockables. I wish we saw it more with DBP games!

Anyway, hope this helps.

Amo.
Vental
14
Years of Service
User Offline
Joined: 25th Apr 2011
Location:
Posted: 26th Jul 2011 17:18
Amo, this does help, the only thing that I was wondering with unlocking is characters and vehicles in a racing game. And User, I'm just needing help with this little code piece.
Ocho Geek
17
Years of Service
User Offline
Joined: 16th Aug 2007
Location: Manchester, UK
Posted: 26th Jul 2011 19:52 Edited at: 26th Jul 2011 19:52
Presumably you'd want to have unlockable's saved.
You'd add it to the game save file, you'd just have several boolean variables, so that "achievement 1 unlocked" is "true" ect.

that would be simple enough, just add it to the procedure where the save file is written


Not Spanish, Not Eight, Just Ocho

Vental
14
Years of Service
User Offline
Joined: 25th Apr 2011
Location:
Posted: 27th Jul 2011 03:16
Since I'm new to this whole making video games thing, I may need help to see how you actually put unlockables in an actual code, though. Not meaning a video, and I'm not trying to get on anyone's nerves with these coding questions. But can someone please explain to me how it works, in a brief sort of way if you don't want to type a ton.
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 27th Jul 2011 03:52
I'm afraid you're coming at the problem from completely the wrong direction. DBPro doesn't have a command or bunch of commands that just 'adds an unlockable', there are a million million different ways to do what you are asking, and they all depend on what you have already coded your game to do, exactly how you want it to work etc. We know you're not trying to get on anyone's nerves, but you could do with with reading some tutorials first Check this out.

We're all here to help you man, but you need to fiddle around and get some basic knowledge first Experiment a bit, it's very satisfying when you solve a problem by yourself!

Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 27th Jul 2011 05:37 Edited at: 27th Jul 2011 05:38
Yes, he's right, I think some basic coding tutorials would do you far more good than an explanation from one of us.

Perhaps you should set your immediate goal to something a little more manageable? Maybe start off with an easier game to make, and after seeing how that game is made and getting your hands dirty with a bit of code from some tutorials, you can set your sights a bit higher from there.

Pong was always my favorite to start off with. Maybe even aiming to make a new kind of pong game will help you to achieve something meaningful and learn a lot in the process.


~Plystire

A rose is only a rose until it is held and cherished -- then it becomes a treasure.
Kezzla
16
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 27th Jul 2011 07:32
Here's a little program to get you in the ball park.
There are much more efficient ways to rewrite this code I'm showing you. I'm just keeping this easy to understand.



hopefully this gives you some insight into how code can be used to unlock content.
kezzla

Sometimes I like to use words out of contents
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 27th Jul 2011 13:18
I'd worry about making the game first, before all cosmetic things like achievements.



Support a charitable indie game project!
Vental
14
Years of Service
User Offline
Joined: 25th Apr 2011
Location:
Posted: 27th Jul 2011 19:04
Okay, thankyou everyone! This has been dang helpful! And, just a random question: Has the Dark Studio Bonanza deal ended yet?
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 27th Jul 2011 19:15
Looks still available to me. Also, excellent use of the word dang there

Vental
14
Years of Service
User Offline
Joined: 25th Apr 2011
Location:
Posted: 27th Jul 2011 21:55
Okay, thankyou Inser Name Here.

Login to post a reply

Server time is: 2025-05-20 23:41:02
Your offset time is: 2025-05-20 23:41:02