≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Replacing external CCB files with EXE files
Posted by:
(you are not logged in)
Enter the missing letter in: "Internati?nal"
(you are not logged in)
Text:
[quote][b]srfstudio[/b] wrote: This is only for users that are (justifiably) worried about using ’ccbSwitchToCCBFile’ because their game can’t be compiled into a single exe because of the editor’s memory limitations. …also only for those users that haven’t figured this out already :) ////////// Explanation on how I stumbled onto this solution, you can skip it… In my new game, I had the main exe file with menu, intro, and two levels but the third level had to be externalized because the editor kept crashing. So everything was normal for CC because I was never able to successfully get more than two levels into a single work-file :) I had a load-game option in the game’s menu, auto-save in level 2, and auto-save in level 3, so that means: load& auto-save in exe and auto-save in external ccb. When I tried to load a saved game from Level 3 I noticed that I was actually loading the saved data from Level 2 and not Level 3. After some time I realized that my ‘Application Title’ under ‘Publishing Settings’ was named correctly in the main file but left ‘Unnamed Application’ in the external ccb file. I didn’t bother to change it because I thought that any ccb file connected through the ‘ccbSwitchToCCBFile’ code will automatically inherit the app-title from the main game-file. That’s not the case, any external ccb file that we connect to with ‘ccbSwitchToCCBFile’ will keep it’s original app-title. My saved variables from Level 3 are not being loaded from the game’s menu because the app is treating them like saved data from another app. That means that it’s treating external ccb files as different games, which means that differently titled files are treated as different games. After that I realized that I can have an unlimited number of exe files titled with the same name and have one saved-variables data for all of them :) And I was right: simple box level compiled with the same title as the main game was able to change my saved variables. ////////// The system of exe files instead of external ccb files All your files (game levels) must be named exactly the same in Tools > Publishing Settings > Application Title. In your main game file (first exe to start the game) you need to have: 1. ‘New Game’ button that will reset all of the saved data 2. ‘Load Game’ button for loading auto-saved data 3. After loading auto-saved data, instead of ‘ccbSwitchToCCBFile(“level3.ccbâ€);’ you need ‘system(“START level3.exeâ€); ccbEndProgram();’ that will start level3.exe and close currently opened exe file. In all of the following levels compiled to exe you need to have: 1. Loading of auto-saved data in ‘Before First Drawing Do Something’ 2. Always saving data before continuing to a different exe file. 3. ‘Go To Menu’ button with ‘system(“START main.exeâ€); ccbEndProgram();’ instead of ‘ccbSwitchToScene(“menuâ€);’ This way you can have (reasonably) protected levels (compiled into exe files) instead of multiple ccb files that can be easily opened and edited. The same system is also possible with an external txt file for saving data or some other method, it doesn’t have to be CC’s native ‘Load Or Store Variable From Or To Disk’. The reason why I’m using native Load/Save actions is that my game has some specific systems that are preventing me from having a txt file in the game-folder and I’m too lazy for messing with C:/Users/XYZ/Documents absolute/relative paths :) Hopefully this will be helpful to someone. Cheers![/quote]
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