Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
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? |
||||
|
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. |
||||
|
If the player closed the game, open it again, the progress will be saved? |
||||
|
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. |
||||
|
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? |
||||
|
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 |
||||
|
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 |
||||
|
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}, ]; |
||||
|
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. |
||||
|
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 |
|