• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

WriteString - Save a string at runtime

Joined
Nov 26, 2017
Messages
59
Let's assume I want to store the actual date and time when the game is over in a logfile that I can later access manually. I'm doing the following, but it seems to not update the file at all:

(gamedata2 is defined as int-array, gamedata is defined as string)

'write game status to file
gamedata2=GetDate()
gamedata=" GameOver:"+gamedata2[2]+"/"+gamedata2[1]+"-"+gamedata2[3]+":"+gamedata2[4]
Local file:=FileStream.Open("cerberus://internal/usage.txt","a")
file.WriteString(gamedata,"utf8")
file.Close
 
I will try tonight or tommorow. Some questions:

Which target platform and OS?
Was the file initially created and is already there, so you just want to update it?
 
It's Mac OS X 10.9.5.
Yes, the file is already there and should be updated. With each game played, it should write the start-time and end-time to the file, so I can later see how many games have been played and how long they lasted.
 
Hm, so it must be the file or the location of the file. Mine is:

computer.buildv2018-04-22/glfw3/xcode/internal/usage.txt

(computer is the cerberus file name)

It still doesn't do anything on my system. What can it be?
 
Are you sure it doesn't update? Your code adds the same value in a row. Is that location of your code even called?
Where on your mac is the app stored?

There is a file example in the examples/mojo/mak folder, you can modify it and will see that it works.
 
- Yes, I'm sure it is called, since it's at the start of the game AND at the end of the game.

- The file usage.txt is still the same at the end, modification date didn't change and the content is only what has been there before, which is just "Usage "

- Maybe I should upload to dropbox and let you take a look. I'm really clueless here.
 
Ok, I have seen your screenshot and you are looking into the initial folder of your project. You need to look into the internal folder inside your app resources.
 
I also didn't find the .cerberusstate file. I enabled showing hidden files, then searched for the file, but there is none.
 
@yodasvideoarcade Seriously, dawlane has showed you where to look for regarding Apple app bundles. OSX is not Windows nor Linux.
Windows 10 handles files and folders where you can store stuff differently than XP.
If you are not willing to familiarize yourself with the development platform you want to release your apps on, you won't get very far.
CX is definitely not a tool for someone who wants just to press a button and voila, the app gets uploaded into the appstore.

Do you find at least the .app file that was created from Xcode? Or are you unable to locate that too?
If you found it, this is the app bundle. Right click on that file and select Show content.
There inside the resources folder and its children, you find what you are looking for.
 
I don't use Windows or Linux, no idea about how it works there. I just used Blitzmax, Monkey, and now Cerberus, all on Mac. I don't need to release the apps, nor upload to the app store. They just need to run on HTML5 and on my computer (or the one I copy it to). Please try some of my games at yodasvideoarcade.com and tell me they're not fun to play. ;-)

Yes, now I found it. In appname.buildv2018-04-22/glfw3/xcode/build/release/

How could I have known that the actual app I click on to run it is called an app-bundle? And also, how could I know that right-clicking on it shows a folder with contents?

But anyway, now I know. I appreciate the explaination. That's exactly what I needed. If you ever come to Frankfurt, let me know so you can be my guest to play one of my Escape Rooms.
 
Back
Top Bottom