Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Levels in game

anonymous
Guest
Quote
2019-02-12 12:07:00

My game has 10 levels. But now player can select any level in menu. For example player not complete first level, but can start second level. How to save number of completed levels?


ishmaru
Guest
Quote
2019-02-12 20:30:50

You can use coppercube variables easily for this. And you can save and load it easily too.

You need one variable per stage and when the level is complete set it to 1. Then on menu you just check if variable is one for each level and make button visable.


anonymous
Guest
Quote
2019-02-13 13:08:00

If the player closed the game, open it again, the progress will be saved?


just_in_case
Moderator
Quote
2019-02-20 05:36:40

You can use variables as ishmaru already answered..... To load them even after the game exits and restared... You can save variables yo external text file or to the registry itself bh using the load variable and save variable action....

Hope that helps.


hihisisy
Registered User
Quote
2019-03-18 19:39:23

ishmaru wrote:
You can use coppercube variables easily for this. And you can save and load it easily too.

You need one variable per stage and when the level is complete set it to 1. Then on menu you just check if variable is one for each level and make button visable.

My game has 10 levels. But now player can select any level in menu. For example player not complete first level, but can start second level. How to save number of completed levels?


DeltaXGames
Guest
Quote
2019-03-18 20:54:47

If you can code a little you could save it in a plain text file.
Save it in a plaintext file separate all the completed levels by a comma and load them into an array using Javascript.
You can then easily search this array to know which levels have already been played.
You might want to encrypt the file though and decryt it before loadiinng it in an array. I personally would not use any complex encryption algorithm, knowing me, I might just base64 the whole thing :D


Robo
Guest
Quote
2019-06-25 03:53:47

Hi Guys,

I have created a large array in CopperCube just for inventory yet need another 10-20 like it and be able to save and load into the game.

As I understand it CopperCube does not natively support saving arrays so a separate text file needs to be created like you said.

Can anyone direct me on how to code that in javascript ?
I offer $50 to anyone who can offer the code to me that is able to save and load back the array into the game.

Can pay via Paypal. I need this functionality.

Please help me.
Robert Codell
codellrob@gmail.com


Robo
Guest
Quote
2019-06-25 04:37:19

by the way - this is my array data format:

var invMe= [
{name: 'Bandage', qty: 2, group: 'health', regen: 2, affects: 'heal', condition: 0.8, weight: 0.1, protection: 0.0, thermal: 0.0, tex: 'bandages.png', sound: 'bandaging', nu: 2},
{name: 'Medkit', qty: 2, group: 'health', regen: 7, affects: 'heal', condition: 0.8, weight: 0.3, protection: 0.0, thermal: 0.0, tex: 'medkits.png', sound: 'medkit', nu: 2},
{name: 'Herbs', qty: 3, group: 'health', regen: 2, affects: 'heal', condition: 1.0, weight: 0.1, protection: 0.0, thermal: 0.0, tex: 'bars.png', sound: 'eatBar', nu: 3},
{name: 'Energy Stim', qty: 2, group: 'health', regen: 5, affects: 'energy', condition: 0.9, weight: 0.7, protection: 0.0, thermal: 0.0, tex: 'waters.png', sound: 'drink', nu: 2},
{name: 'Water bottle', qty: 2, group: 'food', regen: 5, affects: 'thirst', condition: 0.9, weight: 0.7, protection: 0.0, thermal: 0.0, tex: 'waters.png', sound: 'drink', nu: 5},
{name: 'Packed food', qty: 3, group: 'food', regen: 7, affects: 'hunger', condition: 0.8, weight: 0.5, protection: 0.0, thermal: 0.0, tex: 'foods.png', sound: 'eatFood', nu: 2},
{name: 'Energy bar', qty: 4, group: 'food', regen: 3, affects: 'hunger', condition: 0.7, weight: 0.2, protection: 0.0, thermal: 0.0, tex: 'bars.png', sound: 'eatBar', nu: 3},
{name: 'Meat', qty: 4, group: 'food', regen: 7, affects: 'hunger', condition: 0.7, weight: 0.2, protection: 0.0, thermal: 0.0, tex: 'meats.png', sound: 'eatMeat', nu: 3},
{name: 'Mushrooms1', qty: 3, group: 'food', regen: 1, affects: 'hunger', condition: 1.0, weight: 0.1, protection: 0.0, thermal: 0.0, tex: 'shrooms.png', sound: 'eatFood', nu: 2},
{name: 'Clothing1', qty: 1, group: 'clothing', regen: 0, affects: 'protection', condition: 0.9, weight: 0.5, protection: 1.0, thermal: 5.0, tex: 'bandages.png', sound: 'bandaging', nu: 2},
{name: 'Clothing2', qty: 1, group: 'clothing', regen: 0, affects: 'protection', condition: 0.9, weight: 1.0, protection: 1.0, thermal: 10.0, tex: 'bandages.png', sound: 'bandaging', nu: 2},
{name: 'Clothing3', qty: 1, group: 'clothing', regen: 0, affects: 'protection', condition: 0.9, weight: 1.5, protection: 1.0, thermal: 15.0, tex: 'bandages.png', sound: 'bandaging', nu: 2},
{name: 'Clothing4', qty: 1, group: 'clothing', regen: 0, affects: 'protection', condition: 0.9, weight: 2.5, protection: 1.0, thermal: 25.0, tex: 'bandages.png', sound: 'bandaging', nu: 2},
{name: 'Keypass1', qty: 1, group: 'items', regen: 0, affects: 'access', condition: 0.9, weight: 0.1, protection: 0.0, thermal: 0.0, tex: 'bandages.png', sound: 'bandaging', nu: 2},
{name: 'Keypass2', qty: 1, group: 'items', regen: 0, affects: 'access', condition: 0.9, weight: 0.1, protection: 0.0, thermal: 0.0, tex: 'bandages.png', sound: 'bandaging', nu: 2},
{name: 'Keypass3', qty: 1, group: 'items', regen: 0, affects: 'access', condition: 0.9, weight: 0.1, protection: 0.0, thermal: 0.0, tex: 'bandages.png', sound: 'bandaging', nu: 2},
{name: 'bottles', qty: 3, group: 'items', regen: 0, affects: 'access', condition: 0.9, weight: 0.01, protection: 0.0, thermal: 0.0, tex: 'bottles.png', sound: 'drink', nu: 2},
];


Robo
Guest
Quote
2019-07-15 04:20:44

Never mind on that request - I ended up getting a more basic array to save after converting to a string. It works now...see my inventory setup post.

Cheers.


ancryia
Registered User
Quote
2019-09-26 05:55:09

Have you tried the command of System? Use Input TXT files with JavaScrpit. i have not tried, but i think it should work.

Robo wrote:
Hi Guys,

I have created a large array in CopperCube just for inventory yet need another 10-20 like it and be able to save and load into the game.

As I understand it CopperCube does not natively support saving arrays so a separate text file needs to be created like you said.

Can anyone direct me on how to code that in javascript ?
I offer $50 to anyone who can offer the code to me that is able to save and load back the array into the game.

Can pay via Paypal. I need this functionality.

Please help me.
Robert Codell
codellrob@gmail.com



Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (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