Playing the game multiple times


#1

Hi,I’m a studying programming and its my second years in university. I want to learn something about your coding. I’m making a new game with my friend and I want to try something new if you can help me, I will be a happy man :slight_smile: Anyway I want players to play this game multiple times like everyone here, but I want to add something to my game and I don’t know how can I do it. I want to add unlocking system to my game. For an example, I will give a chance to player about choosing their races and I will lock some of them. When players finished the game first time they will have the chance to choose the locked races when they start again to play. I can’t do it codes you gave us when I try it the locked races stays locked. Considering the system you make, its reseting itself so it’s expected. Is it possible to add a new folder in the game. This will keep my codes in it and when the player starts from the beginning the locked races will stay unlocked. Thanks for reading this I will wait your messages :slight_smile:


#2

With the current way CS works, you would have to create your own, unique, end-of-game scene. By default typing *ending gives the player a choice of playing again, sharing the game, etc, but it’ll reset the game. For you, you’d want to have the “play again” option be a custom choice that would reset all the variables (and activate/deactivate any unlockables) before dropping the player back at the very start of the game.

SO:

*label beginning
Beginning scene! Choose a character.
#Human.
#Elf.
*if robotunlocked
#Robot

Then the game happens.

Then the ending scene.
#Play again.
*set robotunlocked true
*set othervariables to defaultvalues
*goto beginning
#End the game.
*ending

HOWEVER, I think CoG might require you use their *ending somewhere in your game if you want to publish it? Idk. And also, if the player ever clicks “restart the game” their unlocks will be gone, so obviously this isn’t an optimal setup, but it’s unfortunately the only way I know to accomplish what you want. Maybe someone else has an idea?


#3

You could setup a password which if they reach the end they will be given. At the start of a game if they have the password it can unlock features.


#4

I am unfamiliar with how CS works, but you may be able to do it in a way similar to how it is done in sequels. You know, allow the player to load a completed saved game at the beginning.


#5

Thanks all of you. Seems like the Lordirish’s way is the most logically way to do that :slight_smile:


#6

The easiest way is to have a variable that works like a code.

For example…

*create job “”
*create talent “”

*label begin

What is your talent?
*input_text talent

*label char_choice

You are a…
*choice
#Writer
*set job “writer”
*goto job

#Coder
*set job “coder”
*goto job

*if (skill = “drawing”)
#Artist
*set job “artist”
*goto job

*label job

You do the job well.

You have unlocked the following talent drawing
*ending

With this way the first time you play only writer or coder will appear once you reach the end you get a “code” in this example drawing which you can enter when you are asked about your talent the next time you play which in turns adds the third choice of artist.

I hope this helps!


#7

Yeah it’s good too. It’s similar to Lordirish’s with different code I can try that too. Anyway thanks again :slight_smile:


#8

This is why I would want achievements to act as permanent boolean values in that they could be called from *ifs, that would solve everything.