Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Common ways for saving the game

atra
Guest
Quote
2020-06-28 18:35:42

Hello i was wondering how one would go about creating savegames within coppercube.

I figured it would probably be having a button or something call a js action but im not very fermiliar with scripting coppercube so i was hoping someone could maybe link to some recourses or post a quick explenation.


count2rfeit
Registered User
Quote
2020-06-28 20:21:49

there really is no quick explication for saving games in CC.

here is a link to search the Forum

https://www.ambiera.com/forum.ph...

you can type in what you what to know about (load/save game?) and it will pull up the posts it finds about the subject...


just_in_case
Moderator
Quote
2020-07-22 07:37:36

the saving procedure is varies from game to game so it depends on the type of game you are developing in most cases saving all the variables right before the game exits and load them all before the first drawing does the required stuff. but sometimes the game condition is that it is also required to save positions and all those stuff so this needs a more stuff to be added and sometime a game need to save high-scores only and nothing else...

so it is completely dependent on the type of game how you want to save it....

It will be easy if it will automatically access all the variables and there will be an option to save and load them all at once..but sadly there is currently no option to do this.


Robo
Guest
Quote
2020-09-11 02:24:47

I never use the inbuilt save variable menu item in CC - its far too limited and slow.

Very easy to just record all your data in arrays instead and save that in one simple step:

if you have an array called 'arrayData' and want to save inside a folder "insideFolderIfWanted':

var data = arrayData.toString();
ccbWriteFileContent('insideFolderIfWanted/save.dat', data);


You can open this DAT file using notepad to view it you want also.

To load again just use:

var data = ccbReadFileContent('insideFolderIfWanted/save.dat');

If you have multiple variables in the save file then you will need a template to match the variable name to the value under it and just for loop over each one to setup on load.


veganpete
Registered User
Quote
2020-09-17 22:24:28

An easy way to save any game (coppercube or not) is to simply snapshot the RAM and then load the snapshot back to RAM when you restart the game. This is something you'd would do by calling a 3RD party RAM snapshot program from within coppercube using a command to save and load.


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