Announcement

Collapse
No announcement yet.

3D arrays and defaultproperties

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    3D arrays and defaultproperties

    Code:
    struct Directional
    {
    	var array<int> AnimIndices;
    };
    
    struct AttackSequence
    {
    	// 0 = forward
    	// 1 = backward
    	// 2 = left
    	// 3 = right
    	var Directional Direction[4];
    };
    
    var array<AttackSequence> AttackSequences;
    
    defaultproperties
    {
    	AttackSequences(0)=(Direction=(AnimIndices=(3,4,5),AnimIndices=(6,7,8),AnimIndices=(9,10,11),AnimIndices=(12,13,14))
    }
    The above code does not compile. I'm wondering how do I set the default properties for this 3 dimensional array?

    I have a dynamic array inside a static array inside another dynamic array. Accessing the data is easy in normal code. It looks like this and does compile:
    Code:
    AttackSequences[0].Direction[3].AnimIndices[1] = 1; // an example

    #2
    doh.

    AttackSequences(0)=(Direction=(AnimIndices=(3,4,5) ,AnimIndices=(6,7,8),AnimIndices=(9,10,11),AnimInd ices=(12,13,14)))

    I was missing a ")" at the end of my statement. I think that was my syntax problem. :noob:

    Comment


      #3
      Actually while that code compiled it appears to assigning only the AnimIndices of Direction[0] and not the other 3 directions in the direction array. So there still something I'm missing.


      EDIT:

      AttackSequences(0)=(Direction[0]=(AnimIndices=(3,4,5)),Direction[1]=(AnimIndices=(6,7,8)),Direction[2]=(AnimIndices=(9,10,11)),Direction[3]=(AnimIndices=(12,13,14))))

      This is how you do it.

      Comment

      Working...
      X