Hi,
I'm new here and at first i would like to thank Shvillr for his help during my very first steps.
I want to do a few things and it seems like I need your help.
Right now I managed to load a value from a file into a variable and display this value in different colors depending on the value.
I use the TextFloatRef field in the RenderText item like MyVariable.value and it displays e.g. 65 if an A is in the textfile.
My next step was going to read a value out of a persistent array.
(two dimensions)
But I dont know how to address it. MyArray[1,1] does not work.
Choosing TextArray in the Text item does not show anything.
How to read out this data? Do I have to initialize something first?
My next step will be reading in data into an array from a file.
Two dimensional array (49x49). I have to loop the read in process for each line but where and which item?
And what does the FileNameFloatRef field in the File item does?
Thanks in advance
Raziel
Read Array data (from file) and use it
Moderator: Moderators
Read Array data (from file) and use it
- Attachments
-
- level load array test.zip
- Project file without my messed up tryouts...
- (32.36 KiB) Downloaded 506 times
Hi Raziel,
The property you assign FileMoveData to has to be a Float ( you're using a Integer ). This is a old* limitation that should be pretty easy to lift .. but for the time being, just stick to Float
And FileNameFloatRef is another old* feature that lets you add a number to a filename when you want to save / load many files ( for example .. level0, level1, level2 etc ). These days you can simply change the FileName using a ZExpression instead.
*From back when ZGE only supported Variable Type = Float and nothing else.
Welcome to the club ~
Kjell
The property you assign FileMoveData to has to be a Float ( you're using a Integer ). This is a old* limitation that should be pretty easy to lift .. but for the time being, just stick to Float

And FileNameFloatRef is another old* feature that lets you add a number to a filename when you want to save / load many files ( for example .. level0, level1, level2 etc ). These days you can simply change the FileName using a ZExpression instead.
*From back when ZGE only supported Variable Type = Float and nothing else.
Welcome to the club ~
Kjell

The TextFloatRef property is only for Floats. Simply set the Text property directly using a ZExpression when you want to display the content of a Array cell. Attached is a basic example.
K
- Attachments
-
- Array.zgeproj
- (518 Bytes) Downloaded 526 times
I produce a crash
I make a loop with as many iterations as SizeDim1 or SizeDim2
During my iterations I want to use FileMoveData item but I don't know how?
Here the not messed up file. (removed my attemps)
Reading into variable works. Reading out and drawing out of array too now (thanks) but reading from file into array makes problems.

I make a loop with as many iterations as SizeDim1 or SizeDim2
During my iterations I want to use FileMoveData item but I don't know how?
Here the not messed up file. (removed my attemps)
Reading into variable works. Reading out and drawing out of array too now (thanks) but reading from file into array makes problems.
- Attachments
-
- level load array test.zip
- (1.12 KiB) Downloaded 502 times
Hi Raziel,
Try the attached example .. it won't get any easier then that. Keep in mind that I've removed all line breaks ( Carriage Return + Line Feed ) from Map.txt for simplicity's sake.
K
Try the attached example .. it won't get any easier then that. Keep in mind that I've removed all line breaks ( Carriage Return + Line Feed ) from Map.txt for simplicity's sake.
K
- Attachments
-
- LoadMap.zip
- (774 Bytes) Downloaded 536 times
Hey, thank you again Kjell!
That is what I needed. I have to dump it itno a temporary variable before storing into an array. Slowly I start understanding...
Will try more and continue.
Thank you very much!
Code: Select all
Array[MapX.Iteration,MapY.Iteration] = Data;
Will try more and continue.
Thank you very much!