Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Load and store a variable explanation?

j9907
Registered User
Quote
2018-06-19 12:00:31

So I thought i figured out this issue, but I'm still not getting how this works. When does the "Save variable" option come into use? Is it when the variable number / value changes? and when a scene starts, do I use the "set variable" option to create the variable and then load that variable in a different scene?


behroz-khan
Registered User
Quote
2018-06-19 15:28:28

I will answer you but can you please brief your question?


j9907
Registered User
Quote
2018-06-20 01:07:27

I just want a clear explanation on what I have to do:

I didn't want to say what I wanted to do (it was a secret) but this is my idea:

At the end of each level you will be taken to an item shop where you can purchase what I call "player skins". This allows you to choose a different character. My idea is you collect a specific coin for a specific character. For instance, here is what I have (as an idea; the names and such are different so I don't give away what this project is based on / about)

level1-to-level2 - This is set to 0 when the level starts. This signifies that you are going from level 1 to level 2, and it's set to 1 when the level ends. Once taken to the item shop, it will load this variable and do a check: Does this equal 1? if so, unhide the item shop 2D overlay for the next level. so, if you beat level 1, an item store overlay shows up for items which can be used for level 2.

Say if i have a character named Green and I want to play as him for the next level. When the first level starts, the variable "green-coin-level2" is set to false and this will be set to true when you pick up a specially colored coin.

Upon the level's completion, the item shop will load the variable and do a check: does this equal true? if so, unhide the "BUY" button. When the player clicks the buy button, it will save the variable (is this correct?) and fade the screen and then load the next level.

It will also save another variable called "green-level2" and set that to true

When the next level loads, it will do a check: Does "green-level2" equal true? If so, delete the normal player and then make "green" visible and set the camera to one which follows this character. otherwise it defaults to the normal player.


behroz-khan
Registered User
Quote
2018-06-20 04:42:22

You are right! Now you have to do what i am going to tell you:
      In level one, add a green coin and add on proximinity invisible the coin

or delete the coin, set variable (green coin) to 1 (means the player piked up the green coin)

and save the variable to disk(green coin)

Now when the player goes to shop load the variable (green coin),

check if variable is 1 hide can't overlay unhide buy button or else unhide can't overlay and hide buy button before first drawing

and when the player buys it do variable (green man) to 1 and save the variable (green man) to disk

And in level two load variable (green man), check if variable is 1 hide normal man and unhide Green man

or else empty before first drawing

Any mistakes? please tell me!
And soon i will give you an example (ccb) if you wish!


behroz-khan
Registered User
Quote
2018-06-21 19:57:46

Here is the example (ccb) file for you question!
https://drive.google.com/open?id...


j9907
Registered User
Quote
2018-06-22 05:44:09

Thanks. I'll take a look at this and if it works you'll be in the credits :) I'll probably just put "the wonderful people at the Ambiera forum" instead of your name since at least a few people have helped me.


behroz-khan
Registered User
Quote
2018-06-23 02:33:39

Thanks!


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internatio?al" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact