PDA

View Full Version : Nested dynamic arrays in actor properties



LagMasterSam
11-27-2007, 06:54 PM
I know in UT2004 it was possible to have nested dynamic arrays that were configurable in the editor. For example...



class TTVolume extends Volume
placeable;

var(Actions) array< class<TTVolumeActionGroup> > ActionGroups;




class TTVolumeActionGroup extends Object
abstract;

var(Actions) array< class<TTVolumeAction> > Actions;


I have no problem adding a TTVolumeActionGroup to the ActionGroups array within TTVolume. However, there doesn't seem to be an option in the editor for adding a TTVolumeAction to an ActionGroup within the ActionGroups array.


EDIT - Fixed


I needed to add editinline and editinlinenew...



class TTVolume extends Volume
placeable;

var() editinline array< class<TTVolumeActionGroup> > ActionGroups;




class TTVolumeActionGroup extends Object
hidecategories(Object)
editinlinenew
abstract;

var(Actions) editinline array< class<TTVolumeAction> > Actions;




class TTVolumeAction extends Object
hidecategories(Object)
editinlinenew
abstract;

VerteX
11-27-2007, 08:36 PM
:o i wish i could find my own solution *cries*

Wormbo
11-28-2007, 08:58 AM
Wait, why do you use an abstract class for this? It can't be instanced unless you want to use special subclasses. The more logical way to do it is using structs:


struct S {
var() array<X> A;
};

var() array<S> AoA;


Also note that class objects cannot be inline-edited by design. If you want to use editinline, use instances, not classes.

LagMasterSam
11-28-2007, 10:17 AM
The reason I'm doing it this way is to completely separate my Base package from any code that might need to be modified. By using class objects, I can modify the operation of the non-abstract TTVolumeActions/TTVolumeActionGroups classes without having to distribute a new Base package or break map compatibility between Mod versions.

Base Package:
Concrete Volume Class (Only placeable item)
Abstract Action Group Class
Abstract Action Class
Abstract Game Class

Modifiable Package:
Concrete Action Group Classes
Concrete Action Classes
Concrete Game Class
etc...

The method I'm using does work using editinline because I have two packages as shown above. :)