• 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

How do you count and list files?

Wingnut

Well-known member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
1,414
How do I save my levels on desktop targets?
I want to read the complete folder to count and list all the levels inside the folder beside my executable?

How do you do it on Android? and where would the files go there is no executable file? Can i have my levels on the sdcard? I want them loose somehow not tucked inside the apk.

If that's impossible, the desktop is still possible right?
 
How do I save my levels on desktop targets?
SaveString, FileStream and DataBuffer come to my mind.

I want to read the complete folder to count and list all the levels inside the folder beside my executable?

Did you discover the LoadDir command? Preferable from the BRL.FileSystem module.

And resource paths, I am sure you saw that already


How do you do it on Android? and where would the files go there is no executable file? Can i have my levels on the sdcard? I want them loose somehow not tucked inside the apk.
Forget the SD card. Not possible with standard CX. And there is no guaranteed way to get that directory anyway. It changes almost with every Android release. Sometimes Android blocks its access also.
 
SaveString, FileStream and DataBuffer come to my mind.

LoadDir is totally new to me
How do all these ways of reading files differentiate? String are for strings I understand so FileStream and DataBuffer are my two choices because I want to use binary bytes and integers.

Can you stream realtime from the web using filestream?

Which one of all these would you suggest to learn first if you where to use file cross all platforms? Web is important.
 
LoadDir is totally new to me
Studying the help files of a programming language/tool upfront to see it what functionality it provides is something I always recommend and do so myself.

Regarding using FileStream, Android and SD card... you must have forgotten your own posts and discoveries...


Web is important.

On Web you can only use SaveString to store data inside the browsers local storage. Well I could think of using a php script in combination with httprequests and store data onto a server. But that goes beyond my time here.

How do all these ways of reading files differentiate? .... FileStream and DataBuffer .....
Well with FileStream you can use to write and read from files down to a byte level. Databuffer can load a file into memory and then read and write to that memory. I recommend to read the documentation on these parts, I think it explains it well.
 
The helpfiles are huge, me persoanlly have not even been able to read half of it yet and I've tried for few weeks now.
It's hard to know where to start. I need to check those documents out I have no memory of discovered anything.

Thanks, at least I know more where to start looking now, I will try understand how to talk to a Node server next that would be a great help saving levels and highscores.
 
I just got used to it basically, no reason whatsoever other than that. I've been doing some multiplayer coding in JavaScript and love it.

I'm happy to take any suggestions for back-ends that's easy to use and has good pricing.
 
Back
Top Bottom