The documentation in Blitz3d lists the possibility of doing an array of types. However, the code given is both brief and does not explain the proper steps for using them. This is what it shows in the Blitz3d docs:
Now, I have a particular need for an array of types. I need to record the x, y, and z positions of multiple units over a period of movement. For example, I need to plot out the x, y, and z of Unit1 for 5 consecutive seconds, while also tracking the x, y, and z of Unit2 over the same 5 seconds. So each second, I would like to store the position of each unit, until I have 5 seconds worth of data. So far, I can code up to the following point, but I don't know how to get to any of the individual values in the array. Help!
You can create variables or arrays of custom types using a '.' type tag followed by the type name. For example: Global mine.MyType Dim all_mine.MyType( 100 )
Now, I have a particular need for an array of types. I need to record the x, y, and z positions of multiple units over a period of movement. For example, I need to plot out the x, y, and z of Unit1 for 5 consecutive seconds, while also tracking the x, y, and z of Unit2 over the same 5 seconds. So each second, I would like to store the position of each unit, until I have 5 seconds worth of data. So far, I can code up to the following point, but I don't know how to get to any of the individual values in the array. Help!
Type t_unit_loc Field x Field y Field z End Type Dim unit_loc.t_unit_loc(5) For val=1 To 2 unit_loc.t_unit_loc(5) = New t_unit_loc Next ;This gets me 2 arrays of types to use with unit1 and ;unit2, but how do I put the values in each x, y, and z?