Hello Cemetech Users. I was wondering what you can do with an appvar in ICE, which things you can store in one and how many. For example, in Geometry Dash a whole level was stored in an appvar. Until now I have only stored lists in an appvar, but I would be interested in what you can use an appvar for.
It's literally like any other file. Keep whatever raw data you want in there in whatever format you want, even in your own formats.
Like I said, any binary data. There is no distinction between lists and strings with appvars, it just depends on how you read and write.
MateoConLechuga wrote:
Sure. You can store any arbitrary data in whatever format you want.
And how would I do that. Sorry for all the asking, I just think it's cool. I now have a lot of ideas about games that I might still be able to program.
Take a look at the ICE documentation here under the File I/O section
https://htmlpreview.github.io/?https://github.com/PeterTillema/ICE/blob/master/documentation/commands.html#fileioc
https://htmlpreview.github.io/?https://github.com/PeterTillema/ICE/blob/master/documentation/commands.html#fileioc
The big problem is that I'm German and I don't understand most of the documentation and don't find what I'm looking for. For example, I don't understand what Offset and Origin are for sum(10,OFFSET,ORIGIN,SLOT) and unfortunately this is not explained in the documentation.
In general, the term “origin” in this context typically means a starting position, while “offset” is a distance forward or backward from that starting position at which to perform an operation.
I have one more question. How can I store a list and a string in the same appvar and how can I retrieve them? If that's even possible? Because I imagine Appvars to be like a normal variable, it can only store one thing. In my case I want to store a list and a string in the appvar LEVEL. Is that possible?
Yan-Nick wrote:
I have one more question. How can I store a list and a string in the same appvar and how can I retrieve them? If that's even possible? Because I imagine Appvars to be like a normal variable, it can only store one thing. In my case I want to store a list and a string in the appvar LEVEL. Is that possible?
Yes, an Appvar is literally a sequence of bytes and can represent anything smaller than 65516 bytes.
beckadamtheinventor wrote:
Yan-Nick wrote:
I have one more question. How can I store a list and a string in the same appvar and how can I retrieve them? If that's even possible? Because I imagine Appvars to be like a normal variable, it can only store one thing. In my case I want to store a list and a string in the appvar LEVEL. Is that possible?
Yes, an Appvar is literally a sequence of bytes and can represent anything smaller than 65516 bytes.
How would I have to do that?
Yan-Nick wrote:
beckadamtheinventor wrote:
Yan-Nick wrote:
I have one more question. How can I store a list and a string in the same appvar and how can I retrieve them? If that's even possible? Because I imagine Appvars to be like a normal variable, it can only store one thing. In my case I want to store a list and a string in the appvar LEVEL. Is that possible?
Yes, an Appvar is literally a sequence of bytes and can represent anything smaller than 65516 bytes.
How would I have to do that?
It's like a file on a PC.
ICE code to overwrite to the appvar "File" with "Hello World!", including the (automatic) 0 at the end of the string.
Code:
sum(1,"File","w"->D
sum(4,"Hello World!",13,1,D
sum(3,D
Yan-Nick wrote:
Ok, but if I then store a list in the appvar, isn't the string "Hello World!" gone?
If you want to append (add to the end)
Code:
sum(2,'L₁',"r",2→D
sum(18,D→PTR
sum(16,D→LEN
sum(3,D
sum(1,"File","a+"→D
sum(4,PTR,LEN,1,D
sum(3,D
Just like any file on a PC.
NOTE: there has to be single quotes around the token L₁, otherwise it will not work correctly.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
» Go to Registration page
» Goto page 1, 2 Next
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 1 of 2
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement